[timing] More adjustments.

This commit is contained in:
Jason Felds
2011-07-27 23:03:33 -04:00
parent 62ac849c95
commit b711e34431
2 changed files with 43 additions and 6 deletions
+35 -3
View File
@@ -277,12 +277,19 @@ void AdjustSync::AutosyncTempo()
/* We assume that the stops were measured as a number of beats.
* Therefore, if we change the bpms, we need to make a similar
* change to the stops. */
vector<TimingSegment *> &stops = timing.allTimingSegments[SEGMENT_STOP_DELAY];
vector<TimingSegment *> &stops = timing.allTimingSegments[SEGMENT_STOP];
for (unsigned i = 0; i < stops.size(); i++)
{
StopSegment *s = static_cast<StopSegment *>(stops[i]);
s->SetPause(s->GetPause() * (1.0f - fSlope));
}
// Do the same for delays.
vector<TimingSegment *> &delays = timing.allTimingSegments[SEGMENT_DELAY];
for (unsigned i = 0; i < delays.size(); i++)
{
DelaySegment *s = static_cast<DelaySegment *>(delays[i]);
s->SetPause(s->GetPause() * (1.0f - fSlope));
}
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_APPLIED.GetValue() );
}
@@ -377,8 +384,8 @@ void AdjustSync::GetSyncChangeTextSong( vector<RString> &vsAddTo )
}
}
vector<TimingSegment *> &stopTest = testing.allTimingSegments[SEGMENT_STOP_DELAY];
vector<TimingSegment *> &stopOrig = original.allTimingSegments[SEGMENT_STOP_DELAY];
vector<TimingSegment *> &stopTest = testing.allTimingSegments[SEGMENT_STOP];
vector<TimingSegment *> &stopOrig = original.allTimingSegments[SEGMENT_STOP];
for( unsigned i=0; i< stopTest.size(); i++ )
{
StopSegment *sT = static_cast<StopSegment *>(stopTest[i]);
@@ -401,6 +408,31 @@ void AdjustSync::GetSyncChangeTextSong( vector<RString> &vsAddTo )
fNew ) );
}
}
vector<TimingSegment *> &delyTest = testing.allTimingSegments[SEGMENT_DELAY];
vector<TimingSegment *> &delyOrig = original.allTimingSegments[SEGMENT_DELAY];
for( unsigned i=0; i< delyTest.size(); i++ )
{
DelaySegment *sT = static_cast<DelaySegment *>(delyTest[i]);
DelaySegment *sO = static_cast<DelaySegment *>(delyOrig[i]);
float fOld = Quantize( sO->GetPause(), 0.001f );
float fNew = Quantize( sT->GetPause(), 0.001f );
float fDelta = fNew - fOld;
if( fabsf(fDelta) > 0.0001f )
{
if ( i >= 4 )
{
vsAddTo.push_back(ETC.GetValue());
break;
}
vsAddTo.push_back( ssprintf(
CHANGED_STOP.GetValue(),
i+1,
fOld,
fNew ) );
}
}
if( vsAddTo.size() > iOriginalSize && s_fAverageError > 0.0f )
{
+8 -3
View File
@@ -1894,7 +1894,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
fDelta *= 40;
}
unsigned i;
vector<TimingSegment *> &stops = GetAppropriateTiming().allTimingSegments[SEGMENT_STOP_DELAY];
vector<TimingSegment *> &stops = GetAppropriateTiming().allTimingSegments[SEGMENT_STOP];
for( i=0; i<stops.size(); i++ )
{
if( stops[i]->GetRow() == GetRow() )
@@ -1905,7 +1905,7 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
{
// create a new StopSegment
if( fDelta > 0 )
GetAppropriateTiming().AddSegment(SEGMENT_STOP_DELAY,
GetAppropriateTiming().AddSegment(SEGMENT_STOP,
new StopSegment( GetRow(), fDelta) );
}
else // StopSegment being modified is m_SongTiming.m_StopSegments[i]
@@ -4329,11 +4329,16 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, const vector<int> &iAns
cpy = new BPMSegment(*(static_cast<BPMSegment *>(org)));
break;
}
case SEGMENT_STOP_DELAY:
case SEGMENT_STOP:
{
cpy = new StopSegment(*(static_cast<StopSegment *>(org)));
break;
}
case SEGMENT_DELAY:
{
cpy = new DelaySegment(*(static_cast<DelaySegment *>(org)));
break;
}
case SEGMENT_TIME_SIG:
{
cpy = new TimeSignatureSegment(*(static_cast<TimeSignatureSegment *>(org)));