style cleanup

This commit is contained in:
Glenn Maynard
2004-02-26 06:00:52 +00:00
parent 324e07d383
commit 84f2b06713
+17 -16
View File
@@ -197,14 +197,16 @@ float TimingData::GetElapsedTimeFromBeat( float fBeat ) const
return fElapsedTime; return fElapsedTime;
} }
void TimingData::ScaleRegion( float fScale, float fStartBeat, float fEndBeat ) { void TimingData::ScaleRegion( float fScale, float fStartBeat, float fEndBeat )
{
ASSERT( fScale > 0 ); ASSERT( fScale > 0 );
ASSERT( fStartBeat >= 0 ); ASSERT( fStartBeat >= 0 );
ASSERT( fStartBeat < fEndBeat ); ASSERT( fStartBeat < fEndBeat );
int ix = 0; unsigned ix = 0;
for (ix = 0; ix < m_BPMSegments.size(); ix++) { for ( ix = 0; ix < m_BPMSegments.size(); ix++ )
{
const float fSegStart = m_BPMSegments[ix].m_fStartBeat; const float fSegStart = m_BPMSegments[ix].m_fStartBeat;
if( fSegStart < fStartBeat ) if( fSegStart < fStartBeat )
continue; continue;
@@ -214,7 +216,8 @@ void TimingData::ScaleRegion( float fScale, float fStartBeat, float fEndBeat ) {
m_BPMSegments[ix].m_fStartBeat = (fSegStart - fStartBeat) * fScale + fStartBeat; m_BPMSegments[ix].m_fStartBeat = (fSegStart - fStartBeat) * fScale + fStartBeat;
} }
for (ix = 0; ix < m_StopSegments.size(); ix++) { for( ix = 0; ix < m_StopSegments.size(); ix++ )
{
const float fSegStart = m_StopSegments[ix].m_fStartBeat; const float fSegStart = m_StopSegments[ix].m_fStartBeat;
if( fSegStart < fStartBeat ) if( fSegStart < fStartBeat )
continue; continue;
@@ -225,29 +228,27 @@ void TimingData::ScaleRegion( float fScale, float fStartBeat, float fEndBeat ) {
} }
} }
void TimingData::ShiftRows( float fStartBeat, float fBeatsToShift ) { void TimingData::ShiftRows( float fStartBeat, float fBeatsToShift )
int ix = 0; {
unsigned ix = 0;
for (ix = 0; ix < m_BPMSegments.size(); ix++) { for( ix = 0; ix < m_BPMSegments.size(); ix++ )
{
const float fSegStart = m_BPMSegments[ix].m_fStartBeat; const float fSegStart = m_BPMSegments[ix].m_fStartBeat;
if( fSegStart < fStartBeat ) if( fSegStart < fStartBeat )
continue; continue;
else {
m_BPMSegments[ix].m_fStartBeat += fBeatsToShift; m_BPMSegments[ix].m_fStartBeat += fBeatsToShift;
if (m_BPMSegments[ix].m_fStartBeat < fStartBeat) m_BPMSegments[ix].m_fStartBeat = max( m_BPMSegments[ix].m_fStartBeat, fStartBeat );
m_BPMSegments[ix].m_fStartBeat = fStartBeat;
}
} }
for (ix = 0; ix < m_StopSegments.size(); ix++) { for( ix = 0; ix < m_StopSegments.size(); ix++ )
{
const float fSegStart = m_StopSegments[ix].m_fStartBeat; const float fSegStart = m_StopSegments[ix].m_fStartBeat;
if( fSegStart < fStartBeat ) if( fSegStart < fStartBeat )
continue; continue;
else {
m_StopSegments[ix].m_fStartBeat += fBeatsToShift; m_StopSegments[ix].m_fStartBeat += fBeatsToShift;
if (m_StopSegments[ix].m_fStartBeat < fStartBeat) m_StopSegments[ix].m_fStartBeat = max( m_StopSegments[ix].m_fStartBeat, fStartBeat );
m_StopSegments[ix].m_fStartBeat = fStartBeat;
}
} }
} }