It's hard to maintain this information when using begin() and end() so rather than wrapping the iterators, just check each time IsComposite() is called since it doesn't happen _that_ often. Just don't call IsComposite() often.

This commit is contained in:
Steve Checkoway
2006-06-26 09:33:11 +00:00
parent ec9d50c332
commit 8129d943ba
5 changed files with 15 additions and 11 deletions
+10 -1
View File
@@ -21,7 +21,6 @@ NoteData::NoteData()
void NoteData::Init()
{
m_bComposite = false;
ClearAll();
m_TapNotes = vector<TrackMap>(); // ensure that the memory is freed
}
@@ -37,6 +36,16 @@ void NoteData::SetNumTracks( int iNewNumTracks )
m_TapNotes.resize( iNewNumTracks );
}
bool NoteData::IsComposite() const
{
for( int track = 0; track < GetNumTracks(); ++track )
{
FOREACHM_CONST( int, TapNote, m_TapNotes[track], tn )
if( tn->second.pn != PLAYER_INVALID )
return true;
}
return false;
}
/* Clear [rowBegin,rowEnd). */
void NoteData::ClearRangeForTrack( int rowBegin, int rowEnd, int iTrack )