diff --git a/src/NotesLoaderBMS.cpp b/src/NotesLoaderBMS.cpp index 4a95e85d57..9eb58168ed 100644 --- a/src/NotesLoaderBMS.cpp +++ b/src/NotesLoaderBMS.cpp @@ -799,7 +799,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( PREFSMAN->m_bQuirksMode ) { BPMSegment newSeg( 0, fBPM ); - out.AddBPMSegment( newSeg ); + out.m_SongTiming.AddBPMSegment( newSeg ); if( fBPM > 0.0f ) LOG->Trace( "Inserting new positive BPM change at beat %f, BPM %f", NoteRowToBeat(0), fBPM ); else @@ -810,7 +810,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( fBPM > 0.0f ) { BPMSegment newSeg( 0, fBPM ); - out.AddBPMSegment( newSeg ); + out.m_SongTiming.AddBPMSegment( newSeg ); LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", NoteRowToBeat(0), fBPM ); } else @@ -901,7 +901,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur case BMS_TRACK_BPM: if( iVal > 0 ) { - out.SetBPMAtBeat( fBeat, (float) iVal ); + out.m_SongTiming.SetBPMAtBeat( fBeat, (float) iVal ); LOG->Trace( "Inserting new BPM change at beat %f, BPM %i", fBeat, iVal ); } else @@ -918,7 +918,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( GetTagFromMap( mapNameToData, sTagToLookFor, sBPM ) ) { float fBPM = StringToFloat( sBPM ); - out.SetBPMAtBeat( fBeat, fBPM ); + out.m_SongTiming.SetBPMAtBeat( fBeat, fBPM ); } else { @@ -937,12 +937,12 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( GetTagFromMap( mapNameToData, sTagToLookFor, sBeats ) ) { // find the BPM at the time of this freeze - float fBPS = out.m_Timing.GetBPMAtBeat(fBeat) / 60.0f; + float fBPS = out.m_SongTiming.GetBPMAtBeat(fBeat) / 60.0f; float fBeats = StringToFloat( sBeats ) / 48.0f; float fFreezeSecs = fBeats / fBPS; StopSegment newSeg( BeatToNoteRow(fBeat), fFreezeSecs ); - out.AddStopSegment( newSeg ); + out.m_SongTiming.AddStopSegment( newSeg ); LOG->Trace( "Inserting new Freeze at beat %f, secs %f", fBeat, newSeg.m_fStopSeconds ); } else diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index b1732cdf81..14e6b4bca7 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -358,7 +358,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant else if( sValueName=="BPM" ) { BPM1 = StringToFloat(sParams[1]); - out.AddBPMSegment( BPMSegment(0, BPM1) ); + out.m_SongTiming.AddBPMSegment( BPMSegment(0, BPM1) ); } else if( sValueName=="BPM2" ) { @@ -383,7 +383,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant else if( sValueName=="STARTTIME" ) { SMGap1 = -StringToFloat( sParams[1] )/100; - out.m_Timing.m_fBeat0OffsetInSeconds = SMGap1; + out.m_SongTiming.m_fBeat0OffsetInSeconds = SMGap1; } // This is currently required for more accurate KIU BPM changes. else if( sValueName=="STARTTIME2" ) @@ -409,7 +409,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant TickcountSegment tcs; tcs.m_iStartRow = BeatToNoteRow(0.0f); tcs.m_iTicks = iTickCount > ROWS_PER_BEAT ? ROWS_PER_BEAT : iTickCount; - out.m_Timing.AddTickcountSegment( tcs ); + out.m_SongTiming.AddTickcountSegment( tcs ); } else if ( sValueName=="STEP" ) { @@ -469,7 +469,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant const float beat = (BPMPos2 + SMGap1) * BeatsPerSecond; LOG->Trace( "BPM %f, BPS %f, BPMPos2 %f, beat %f", BPM1, BeatsPerSecond, BPMPos2, beat ); - out.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM2) ); + out.m_SongTiming.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM2) ); } if( BPM3 > 0 && BPMPos3 > 0 ) @@ -479,7 +479,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant const float beat = (BPMPos3 + SMGap2) * BeatsPerSecond; LOG->Trace( "BPM %f, BPS %f, BPMPos3 %f, beat %f", BPM2, BeatsPerSecond, BPMPos3, beat ); - out.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM3) ); + out.m_SongTiming.AddBPMSegment( BPMSegment(BeatToNoteRow(beat), BPM3) ); } } else @@ -515,7 +515,7 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant TickcountSegment tcs; tcs.m_iStartRow = BeatToNoteRow(fCurBeat); tcs.m_iTicks = iTickCount > ROWS_PER_BEAT ? ROWS_PER_BEAT : iTickCount; - out.m_Timing.AddTickcountSegment( tcs ); + out.m_SongTiming.AddTickcountSegment( tcs ); continue; } @@ -523,22 +523,22 @@ static bool LoadGlobalData( const RString &sPath, Song &out, bool &bKIUCompliant { float fCurBpm = (float)numTemp; //out.m_Timing.AddBPMSegment( BPMSegment( BeatToNoteRow(fCurBeat), (float)numTemp ) ); - out.m_Timing.SetBPMAtBeat( fCurBeat, fCurBpm ); + out.m_SongTiming.SetBPMAtBeat( fCurBeat, fCurBpm ); continue; } else if (BeginsWith(NoteRowString, "|E")) { // Finally! the |E| tag is working as it should. I can die happy now -DaisuMaster - float fCurDelay = 60 / out.m_Timing.GetBPMAtBeat(fCurBeat) * (float)numTemp / iTickCount; - fCurDelay += out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat) ); - out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); + float fCurDelay = 60 / out.m_SongTiming.GetBPMAtBeat(fCurBeat) * (float)numTemp / iTickCount; + fCurDelay += out.m_SongTiming.GetStopAtRow(BeatToNoteRow(fCurBeat) ); + out.m_SongTiming.SetStopAtBeat( fCurBeat, fCurDelay, true ); continue; } else if (BeginsWith(NoteRowString, "|D")) { - float fCurDelay = out.m_Timing.GetStopAtRow(BeatToNoteRow(fCurBeat) ); + float fCurDelay = out.m_SongTiming.GetStopAtRow(BeatToNoteRow(fCurBeat) ); fCurDelay += (float)numTemp / 1000; - out.m_Timing.SetStopAtBeat( fCurBeat, fCurDelay, true ); + out.m_SongTiming.SetStopAtBeat( fCurBeat, fCurDelay, true ); continue; } } diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index a74b3610a8..ef354d7bfe 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -682,7 +682,7 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut ) double fSecondsPerBeat = (iter->tickSeconds * GUITAR_MIDI_COUNTS_PER_BEAT); bpmSeg.m_fBPS = float( 1. / fSecondsPerBeat ); - songOut.m_Timing.AddBPMSegment( bpmSeg ); + songOut.m_SongTiming.AddBPMSegment( bpmSeg ); } FOREACH_CONST( MidiFileIn::TimeSignatureChange, midi.timeSignatureEvents_, iter ) @@ -692,7 +692,7 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut ) seg.m_iNumerator = iter->numerator; seg.m_iDenominator = iter->denominator; - songOut.m_Timing.AddTimeSignatureSegment( seg ); + songOut.m_SongTiming.AddTimeSignatureSegment( seg ); } diff --git a/src/NotesLoaderPMS.cpp b/src/NotesLoaderPMS.cpp index b733aa3d9f..44a125e1cb 100644 --- a/src/NotesLoaderPMS.cpp +++ b/src/NotesLoaderPMS.cpp @@ -591,7 +591,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( fBPM > 0.0f ) { BPMSegment newSeg( 0, fBPM ); - out.AddBPMSegment( newSeg ); + out.m_SongTiming.AddBPMSegment( newSeg ); LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", NoteRowToBeat(0), fBPM ); } else @@ -673,7 +673,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur case PMS_TRACK_BPM: if( iVal > 0 ) { - out.SetBPMAtBeat( fBeat, (float) iVal ); + out.m_SongTiming.SetBPMAtBeat( fBeat, (float) iVal ); LOG->Trace( "Inserting new BPM change at beat %f, BPM %i", fBeat, iVal ); } else @@ -694,7 +694,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( fBPM > 0.0f ) { BPMSegment newSeg( BeatToNoteRow(fBeat), fBPM ); - out.AddBPMSegment( newSeg ); + out.m_SongTiming.AddBPMSegment( newSeg ); LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", fBeat, newSeg.GetBPM() ); } else @@ -716,12 +716,12 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( GetTagFromMap( mapNameToData, sTagToLookFor, sBeats ) ) { // find the BPM at the time of this freeze - float fBPS = out.m_Timing.GetBPMAtBeat(fBeat) / 60.0f; + float fBPS = out.m_SongTiming.GetBPMAtBeat(fBeat) / 60.0f; float fBeats = StringToFloat( sBeats ) / 48.0f; float fFreezeSecs = fBeats / fBPS; StopSegment newSeg( BeatToNoteRow(fBeat), fFreezeSecs ); - out.AddStopSegment( newSeg ); + out.m_SongTiming.AddStopSegment( newSeg ); LOG->Trace( "Inserting new Freeze at beat %f, secs %f", fBeat, newSeg.m_fStopSeconds ); } else @@ -750,7 +750,7 @@ static void ReadGlobalTags( const NameToData_t &mapNameToData, Song &out, Measur if( fBPM > 0.0f ) { BPMSegment newSeg( iStepIndex, fBPM ); - out.AddBPMSegment( newSeg ); + out.m_SongTiming.AddBPMSegment( newSeg ); LOG->Trace( "Inserting new BPM change at beat %f, BPM %f", NoteRowToBeat(newSeg.m_iStartRow), newSeg.GetBPM() ); } diff --git a/src/NotesLoaderSMA.cpp b/src/NotesLoaderSMA.cpp index 93dcb65095..1fa083136d 100644 --- a/src/NotesLoaderSMA.cpp +++ b/src/NotesLoaderSMA.cpp @@ -113,8 +113,8 @@ bool SMALoader::LoadFromSMAFile( const RString &sPath, Song &out ) return false; } - out.m_Timing.m_sFile = sPath; - LoadTimingFromSMAFile( msd, out.m_Timing ); + out.m_SongTiming.m_sFile = sPath; + LoadTimingFromSMAFile( msd, out.m_SongTiming ); for( unsigned i=0; i 0.0f) { // LOG->Trace( "Adding a freeze segment: beat: %f, seconds = %f", new_seg.m_fStartBeat, new_seg.m_fStopSeconds ); - out.m_Timing.AddStopSegment( new_seg ); + out.m_SongTiming.AddStopSegment( new_seg ); } else { @@ -420,7 +420,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach if( PREFSMAN->m_bQuirksMode ) { // LOG->Trace( "Adding a negative freeze segment: beat: %f, seconds = %f", new_seg.m_fStartBeat, new_seg.m_fStopSeconds ); - out.m_Timing.AddStopSegment( new_seg ); + out.m_SongTiming.AddStopSegment( new_seg ); } else LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid stop at beat %f, length %f.", fFreezeBeat, fFreezeSeconds ); @@ -452,7 +452,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach // LOG->Trace( "Adding a delay segment: beat: %f, seconds = %f", new_seg.m_fStartBeat, new_seg.m_fStopSeconds ); if(fFreezeSeconds > 0.0f) - out.m_Timing.AddStopSegment( new_seg ); + out.m_SongTiming.AddStopSegment( new_seg ); else LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid delay at beat %f, length %f.", fFreezeBeat, fFreezeSeconds ); } @@ -479,13 +479,13 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach const float fNewBPM = StringToFloat( arrayBPMChangeValues[1] ); if(fNewBPM > 0.0f) - out.m_Timing.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) ); + out.m_SongTiming.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) ); else { - out.m_Timing.m_bHasNegativeBpms = true; + out.m_SongTiming.m_bHasNegativeBpms = true; // only add Negative BPMs in quirks mode -aj if( PREFSMAN->m_bQuirksMode ) - out.m_Timing.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) ); + out.m_SongTiming.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) ); else LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid BPM change at beat %f, BPM %f.", fBeat, fNewBPM ); } @@ -513,7 +513,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach const float fNewBeat = StringToFloat( arrayWarpValues[1] ); if(fNewBeat > fBeat) - out.m_Timing.AddWarpSegment( WarpSegment(fBeat, fNewBeat) ); + out.m_SongTiming.AddWarpSegment( WarpSegment(fBeat, fNewBeat) ); else { LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid Warp at beat %f, BPM %f.", fBeat, fNewBeat ); @@ -541,7 +541,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach RString sLabel = arrayLabelValues[1]; TrimRight(sLabel); if( fBeat >= 0.0f ) - out.m_Timing.AddLabelSegment( LabelSegment(fBeat, sLabel) ); + out.m_SongTiming.AddLabelSegment( LabelSegment(fBeat, sLabel) ); else { LOG->UserLog( "Song file", "(UNKNOWN)", "has an invalid Label at beat %f called %s.", fBeat, sLabel.c_str() ); @@ -591,7 +591,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach continue; } - out.m_Timing.AddTimeSignatureSegment( seg ); + out.m_SongTiming.AddTimeSignatureSegment( seg ); } } @@ -619,7 +619,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach if(iTicks >= 1 && iTicks <= ROWS_PER_BEAT ) // Constants { // LOG->Trace( "Adding a tickcount segment: beat: %f, ticks = %d", fTickcountBeat, iTicks ); - out.m_Timing.AddTickcountSegment( new_seg ); + out.m_SongTiming.AddTickcountSegment( new_seg ); } else { @@ -646,7 +646,7 @@ bool SSCLoader::LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCach const float fComboBeat = StringToFloat( arrayComboValues[0] ); const int iCombos = atoi( arrayComboValues[1] ); ComboSegment new_seg( BeatToNoteRow( fComboBeat ), iCombos ); - out.m_Timing.AddComboSegment( new_seg ); + out.m_SongTiming.AddComboSegment( new_seg ); } } diff --git a/src/NotesWriterSSC.cpp b/src/NotesWriterSSC.cpp index 69ca696756..3c4ff71a3b 100644 --- a/src/NotesWriterSSC.cpp +++ b/src/NotesWriterSSC.cpp @@ -74,7 +74,7 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) f.PutLine( "#INSTRUMENTTRACK:" + s + ";\n" ); } } - f.PutLine( ssprintf( "#OFFSET:%.6f;", out.m_Timing.m_fBeat0OffsetInSeconds ) ); + f.PutLine( ssprintf( "#OFFSET:%.6f;", out.m_SongTiming.m_fBeat0OffsetInSeconds ) ); f.PutLine( ssprintf( "#SAMPLESTART:%.6f;", out.m_fMusicSampleStartSeconds ) ); f.PutLine( ssprintf( "#SAMPLELENGTH:%.6f;", out.m_fMusicSampleLengthSeconds ) ); if( out.m_fSpecifiedLastBeat > 0 ) @@ -107,39 +107,39 @@ static void WriteGlobalTags( RageFile &f, const Song &out ) } f.Write( "#BPMS:" ); - for( unsigned i=0; im_iStartRow), iter->m_iNumerator, iter->m_iDenominator ) ); vector::const_iterator iter2 = iter; iter2++; - if( iter2 != out.m_Timing.m_vTimeSignatureSegments.end() ) + if( iter2 != out.m_SongTiming.m_vTimeSignatureSegments.end() ) f.Write( "," ); } f.PutLine( ";" ); - ASSERT( !out.m_Timing.m_TickcountSegments.empty() ); + ASSERT( !out.m_SongTiming.m_TickcountSegments.empty() ); f.Write( "#TICKCOUNTS:" ); - for( unsigned i=0; i