Add NoteDataUtil and move some stuff into it

This commit is contained in:
Glenn Maynard
2002-12-13 22:09:26 +00:00
parent f4f4777cfd
commit 9c6fe5cf64
3 changed files with 172 additions and 166 deletions
+12 -6
View File
@@ -61,15 +61,12 @@ public:
void PadTapNotes(int rows);
void SetTapNote(int track, int row, TapNote t);
void LoadFromSMNoteDataString( CString sSMNoteData );
CString GetSMNoteDataString();
void ClearRange( int iNoteIndexBegin, int iNoteIndexEnd );
void ClearAll() { ClearRange( 0, MAX_TAP_NOTE_ROWS ); };
void CopyRange( NoteData* pFrom, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin = -1 );
void CopyAll( NoteData* pFrom );
inline bool IsRowEmpty( int index )
inline bool IsRowEmpty( int index ) const
{
for( int t=0; t<m_iNumTracks; t++ )
if( GetTapNote(t, index) != TAP_EMPTY )
@@ -131,8 +128,6 @@ public:
void SnapToNearestNoteType( NoteType nt, float fBeginBeat, float fEndBeat ) { SnapToNearestNoteType( nt, (NoteType)-1, fBeginBeat, fEndBeat ); }
void SnapToNearestNoteType( NoteType nt1, NoteType nt2, float fBeginBeat, float fEndBeat );
NoteType GetSmallestNoteTypeForMeasure( int iMeasureIndex );
// Convert between HoldNote representation and '2' and '3' markers in TapNotes
void Convert2sAnd3sToHoldNotes();
void ConvertHoldNotesTo2sAnd3s();
@@ -141,4 +136,15 @@ public:
void ConvertHoldNotesTo4s();
};
/* Utils for NoteData. Things should go in here if they can be (cleanly and
* efficiently) implemented using only NoteData's primitives; this improves
* abstraction and makes it much easier to change NoteData internally in
* the future. */
namespace NoteDataUtil
{
NoteType GetSmallestNoteTypeForMeasure( const NoteData &n, int iMeasureIndex );
void LoadFromSMNoteDataString( NoteData &out, CString sSMNoteData );
CString GetSMNoteDataString(NoteData &in);
};
#endif