evil big commit (sorry):

Remove m_HoldNote array entirely.  Remove 2sAnd3s.  Store hold note
durations in the hold head.  hold_tail only still exists when InsertHoldTails
is used, to make SM parsing a little easier (may go away).  Add helpers
for iterating over ranges while including or excluding adjacent and overlapping
hold notes.  Range operations are now [start,end) instead of [start,end].
(probably more details coming to sm-dev soon)
This commit is contained in:
Glenn Maynard
2005-01-25 05:02:35 +00:00
parent 6ece8829c4
commit bb7482e722
12 changed files with 771 additions and 762 deletions
+25 -8
View File
@@ -280,7 +280,6 @@ bool DWILoader::LoadFromDWITokens(
newNoteData.SetTapNote(iCol1, iIndex, TAP_ORIGINAL_HOLD_HEAD);
if( iCol2 != -1 )
newNoteData.SetTapNote(iCol2, iIndex, TAP_ORIGINAL_HOLD_HEAD);
}
}
while( jump );
@@ -291,8 +290,29 @@ bool DWILoader::LoadFromDWITokens(
}
}
// this will expand the HoldNote begin markers we wrote into actual HoldNotes
newNoteData.Convert2sAnd3sToHoldNotes();
/* Fill in iDuration. */
for( int t=0; t<newNoteData.GetNumTracks(); ++t )
{
FOREACH_NONEMPTY_ROW_IN_TRACK( newNoteData, t, iHeadRow )
{
TapNote tn = newNoteData.GetTapNote( t, iHeadRow );
if( tn.type != TapNote::hold_head )
continue;
int iTailRow = iHeadRow;
while( newNoteData.GetNextTapNoteRowForTrack(t, iTailRow) )
{
const TapNote &TailTap = newNoteData.GetTapNote( t, iTailRow );
if( TailTap.type == TapNote::empty )
continue;
newNoteData.SetTapNote( t, iTailRow, TAP_EMPTY );
tn.iDuration = iTailRow - iHeadRow;
newNoteData.SetTapNote( t, iHeadRow, tn );
break;
}
}
}
ASSERT( newNoteData.GetNumTracks() > 0 );
@@ -303,11 +323,8 @@ bool DWILoader::LoadFromDWITokens(
return true;
}
/* STUPID ALERT!
* This value can be in either "HH:MM:SS.sssss", "MM:SS.sssss", "SSS.sssss"
* or milliseconds.
* What's even more dumb is that the value can contain a ':'. Colon is supposed to be a parameter separator!
*/
/* This value can be in either "HH:MM:SS.sssss", "MM:SS.sssss", "SSS.sssss"
* or milliseconds. */
float DWILoader::ParseBrokenDWITimestamp(const CString &arg1, const CString &arg2, const CString &arg3)
{
if(arg1.empty()) return 0;