further refactorization of TimingSegments (use more templates!)
This commit is contained in:
@@ -307,6 +307,35 @@ inline int BeatToNoteRowNotRounded( float fBeatNum ) { return (int)( fBeatNum
|
||||
* @return the beat. */
|
||||
inline float NoteRowToBeat( int iRow ) { return iRow / (float)ROWS_PER_BEAT; }
|
||||
|
||||
// These functions can be useful for function templates,
|
||||
// where both rows and beats can be specified.
|
||||
|
||||
/**
|
||||
* @brief Convert the note row to note row (returns itself).
|
||||
* @param row the row to convert.
|
||||
*/
|
||||
static inline int ToNoteRow(int row) { return row; }
|
||||
|
||||
/**
|
||||
* @brief Convert the beat to note row.
|
||||
* @param beat the beat to convert.
|
||||
*/
|
||||
static inline int ToNoteRow(float beat) { return BeatToNoteRow(beat); }
|
||||
|
||||
/**
|
||||
* @brief Convert the note row to beat.
|
||||
* @param row the row to convert.
|
||||
*/
|
||||
static inline float ToBeat(int row) { return NoteRowToBeat(row); }
|
||||
|
||||
/**
|
||||
* @brief Convert the beat row to beat (return itself).
|
||||
* @param beat the beat to convert.
|
||||
*/
|
||||
static inline float ToBeat(float beat) { return beat; }
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user