diff --git a/src/NoteData.cpp b/src/NoteData.cpp index 1c9cbd305a..0919a971ce 100644 --- a/src/NoteData.cpp +++ b/src/NoteData.cpp @@ -422,7 +422,7 @@ int NoteData::GetFirstRow() const for( int t=0; t < GetNumTracks(); t++ ) { int iRow = -1; - if( !GetNextTapNoteRowForTrack( t, iRow ) ) + if( !GetNextTapNoteRowForTrack( t, iRow, true ) ) continue; if( iEarliestRowFoundSoFar == -1 ) @@ -972,7 +972,7 @@ int NoteData::GetNumTracksHeldAtRow( int row ) return viTracks.size(); } -bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut ) const +bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut, bool ignoreAutoKeysounds ) const { const TrackMap &mapTrack = m_TapNotes[track]; @@ -987,6 +987,14 @@ bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut ) const return false; ASSERT( iter->first > rowInOut ); + + // If we want to ignore autokeysounds, keep going until we find a real note. + if(ignoreAutoKeysounds) { + while(iter->second.type == TapNoteType_AutoKeysound) { + iter++; + if(iter==mapTrack.end()) return false; + } + } rowInOut = iter->first; return true; } diff --git a/src/NoteData.h b/src/NoteData.h index 1e7304e836..8e88425542 100644 --- a/src/NoteData.h +++ b/src/NoteData.h @@ -243,7 +243,7 @@ public: /* Returns the row of the first TapNote on the track that has a row greater than rowInOut. */ - bool GetNextTapNoteRowForTrack( int track, int &rowInOut ) const; + bool GetNextTapNoteRowForTrack( int track, int &rowInOut, bool ignoreKeySounds=false ) const; bool GetNextTapNoteRowForAllTracks( int &rowInOut ) const; bool GetPrevTapNoteRowForTrack( int track, int &rowInOut ) const; bool GetPrevTapNoteRowForAllTracks( int &rowInOut ) const;