NoteData::GetPrevTapNoteRowForTrack

This commit is contained in:
Glenn Maynard
2004-10-25 00:25:49 +00:00
parent dafce575db
commit 514f184fef
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -788,6 +788,24 @@ bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut ) const
return true;
}
bool NoteData::GetPrevTapNoteRowForTrack( int track, int &rowInOut ) const
{
const TrackMap &mapTrack = m_TapNotes[track];
/* Find the first note >= rowInOut. */
TrackMap::const_iterator iter = mapTrack.lower_bound( rowInOut );
/* If we're at the beginning, we can't move back any more. */
if( iter == mapTrack.begin() )
return false;
/* Move back by one. */
--iter;
ASSERT( iter->first < rowInOut );
rowInOut = iter->first;
return true;
}
bool NoteData::GetNextTapNoteRowForAllTracks( int &rowInOut ) const
{
int iClosestNextRow = 999999;
+1
View File
@@ -67,6 +67,7 @@ public:
// index > afterRow.
bool GetNextTapNoteRowForTrack( int track, int &rowInOut ) const;
bool GetNextTapNoteRowForAllTracks( int &rowInOut ) const;
bool GetPrevTapNoteRowForTrack( int track, int &rowInOut ) const;
void MoveTapNoteTrack( int dest, int src );
void SetTapNote( int track, int row, const TapNote& tn );