play auto keysounds

This commit is contained in:
Chris Danford
2004-10-24 10:45:30 +00:00
parent 1b3c786213
commit eff1dc9695
12 changed files with 292 additions and 44 deletions
+26
View File
@@ -108,6 +108,7 @@ void NoteDataUtil::LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData
// that's what we've been writing to disk. -Chris
case 'M': tn = TAP_ORIGINAL_MINE; break;
case 'A': tn = TAP_ORIGINAL_ATTACK; break;
case 'K': tn = TAP_ORIGINAL_AUTO_KEYSOUND; break;
default:
/* Invalid data. We don't want to assert, since there might
* simply be invalid data in an .SM, and we don't want to die
@@ -225,6 +226,7 @@ void NoteDataUtil::GetSMNoteDataString( const NoteData &in_, CString &notes_out
case TapNote::hold_tail: c = '3'; break;
case TapNote::mine: c = 'M'; break;
case TapNote::attack: c = 'A'; break;
case TapNote::autoKeysound: c = 'K'; break;
default:
ASSERT(0); // invalid enum value
c = '0';
@@ -1718,6 +1720,30 @@ void NoteDataUtil::ShiftRows( NoteData &nd, float fStartBeat, float fBeatsToShif
nd.CopyRange( temp, 0, temp.GetLastRow(), iPasteAtRow );
}
void NoteDataUtil::RemoveAllTapsOfType( NoteData& ndInOut, TapNote::Type typeToRemove )
{
for( int t=0; t<ndInOut.GetNumTracks(); t++ )
{
FOREACH_NONEMPTY_ROW_IN_TRACK( ndInOut, t, row )
{
if( ndInOut.GetTapNote(t, row).type == typeToRemove )
ndInOut.SetTapNote( t, row, TAP_EMPTY );
}
}
}
void NoteDataUtil::RemoveAllTapsExceptForType( NoteData& ndInOut, TapNote::Type typeToKeep )
{
for( int t=0; t<ndInOut.GetNumTracks(); t++ )
{
FOREACH_NONEMPTY_ROW_IN_TRACK( ndInOut, t, row )
{
if( ndInOut.GetTapNote(t, row).type != typeToKeep )
ndInOut.SetTapNote( t, row, TAP_EMPTY );
}
}
}
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard