[sm130labels] Code ready for testing.
If a mistake was made here, let the cherry picking/blame game commence!
This commit is contained in:
+34
-6
@@ -496,11 +496,11 @@ WarpSegment& TimingData::GetWarpSegmentAtRow( int iRow )
|
||||
|
||||
int TimingData::GetTickcountSegmentIndexAtRow( int iRow ) const
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < (int)(m_TickcountSegments.size()) - 1; i++ )
|
||||
unsigned i;
|
||||
for (i=0; i < m_TickcountSegments.size() - 1; i++ )
|
||||
if( m_TickcountSegments[i+1].m_iStartRow > iRow )
|
||||
break;
|
||||
return i;
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
|
||||
TickcountSegment& TimingData::GetTickcountSegmentAtRow( int iRow )
|
||||
@@ -518,6 +518,37 @@ int TimingData::GetTickcountAtRow( int iRow ) const
|
||||
return m_TickcountSegments[GetTickcountSegmentIndexAtRow( iRow )].m_iTicks;
|
||||
}
|
||||
|
||||
float TimingData::GetPreviousLabelSegmentBeatAtRow( int iRow ) const
|
||||
{
|
||||
float backup = -1;
|
||||
for (unsigned i = 0; i < m_LabelSegments.size(); i++ )
|
||||
{
|
||||
if( m_LabelSegments[i].m_iStartRow > iRow )
|
||||
{
|
||||
if( backup > -1 )
|
||||
{
|
||||
return backup;
|
||||
}
|
||||
break;
|
||||
}
|
||||
backup = NoteRowToBeat(m_LabelSegments[i].m_iStartRow);
|
||||
}
|
||||
return NoteRowToBeat(iRow);
|
||||
}
|
||||
|
||||
float TimingData::GetNextLabelSegmentBeatAtRow( int iRow ) const
|
||||
{
|
||||
for (unsigned i = 0; i < m_LabelSegments.size(); i++ )
|
||||
{
|
||||
if( m_LabelSegments[i].m_iStartRow <= iRow )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
return NoteRowToBeat(m_LabelSegments[i].m_iStartRow);
|
||||
}
|
||||
return NoteRowToBeat(iRow);
|
||||
}
|
||||
|
||||
void TimingData::GetBeatAndBPSFromElapsedTime( float fElapsedTime, float &fBeatOut, float &fBPSOut, bool &bFreezeOut, bool &bDelayOut, int &iWarpBeginOut, float &fWarpLengthOut ) const
|
||||
{
|
||||
fElapsedTime += PREFSMAN->m_fGlobalOffsetSeconds;
|
||||
@@ -634,9 +665,6 @@ void TimingData::GetBeatAndBPSFromElapsedTimeNoOffset( float fElapsedTime, float
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
float TimingData::GetElapsedTimeFromBeat( float fBeat ) const
|
||||
{
|
||||
return TimingData::GetElapsedTimeFromBeatNoOffset( fBeat ) - PREFSMAN->m_fGlobalOffsetSeconds;
|
||||
|
||||
Reference in New Issue
Block a user