Add more helper functions, be more consistent.
Note: more consts may be needed. I keep forgetting what they do after the parameters.
This commit is contained in:
+42
-3
@@ -201,6 +201,27 @@ float TimingData::GetStopAtRow( int iNoteRow, bool &bDelayOut ) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
float TimingData::GetStopAtRow( int iRow )
|
||||
{
|
||||
for( unsigned i = 0; i < m_StopSegments.size(); i++ )
|
||||
{
|
||||
if ( !m_StopSegments[i].m_bDelay && m_StopSegments[i].m_iStartRow == iRow )
|
||||
return m_StopSegments[i].m_fStopSeconds;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
float TimingData::GetDelayAtRow( int iRow )
|
||||
{
|
||||
for( unsigned i = 0; i < m_StopSegments.size(); i++ )
|
||||
{
|
||||
if ( m_StopSegments[i].m_bDelay && m_StopSegments[i].m_iStartRow == iRow )
|
||||
return m_StopSegments[i].m_fStopSeconds;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TimingData::GetWarpToRow( int iWarpBeginRow ) const
|
||||
{
|
||||
for( unsigned i=0; i<m_WarpSegments.size(); i++ )
|
||||
@@ -273,16 +294,34 @@ int TimingData::GetBPMSegmentIndexAtBeat( float fBeat )
|
||||
return i;
|
||||
}
|
||||
|
||||
const TimeSignatureSegment& TimingData::GetTimeSignatureSegmentAtBeat( float fBeat ) const
|
||||
int TimingData::GetTimeSignatureSegmentIndexAtRow( int iRow )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < (int)(m_vTimeSignatureSegments.size()) - 1; i++ )
|
||||
if( m_vTimeSignatureSegments[i+1].m_iStartRow > iRow )
|
||||
break;
|
||||
return i;
|
||||
}
|
||||
|
||||
TimeSignatureSegment& TimingData::GetTimeSignatureSegmentAtRow( int iRow )
|
||||
{
|
||||
int iIndex = BeatToNoteRow( fBeat );
|
||||
unsigned i;
|
||||
for( i=0; i<m_vTimeSignatureSegments.size()-1; i++ )
|
||||
if( m_vTimeSignatureSegments[i+1].m_iStartRow > iIndex )
|
||||
if( m_vTimeSignatureSegments[i+1].m_iStartRow > iRow )
|
||||
break;
|
||||
return m_vTimeSignatureSegments[i];
|
||||
}
|
||||
|
||||
int TimingData::GetTimeSignatureNumeratorAtRow( int iRow )
|
||||
{
|
||||
return GetTimeSignatureSegmentAtRow( iRow ).m_iNumerator;
|
||||
}
|
||||
|
||||
int TimingData::GetTimeSignatureDenominatorAtRow( int iRow )
|
||||
{
|
||||
return GetTimeSignatureSegmentAtRow( iRow ).m_iDenominator;
|
||||
}
|
||||
|
||||
BPMSegment& TimingData::GetBPMSegmentAtBeat( float fBeat )
|
||||
{
|
||||
static BPMSegment empty;
|
||||
|
||||
+12
-1
@@ -207,6 +207,10 @@ public:
|
||||
void SetStopAtBeat( float fBeat, float fSeconds ) { SetStopAtRow( BeatToNoteRow(fBeat), fSeconds ); }
|
||||
void SetStopAtBeat( float fBeat, float fSeconds, bool bDelay ) { SetStopAtRow( BeatToNoteRow(fBeat), fSeconds, bDelay ); } // (sm-ssc)
|
||||
float GetStopAtRow( int iNoteRow, bool &bDelayOut ) const;
|
||||
float GetStopAtRow( int iRow );
|
||||
float GetStopAtBeat( float fBeat ) { return GetStopAtRow( BeatToNoteRow(fBeat) ); }
|
||||
float GetDelayAtRow( int iRow );
|
||||
float GetDelayAtBeat( float fBeat ) { return GetDelayAtRow( BeatToNoteRow(fBeat) ); }
|
||||
void SetTimeSignatureAtRow( int iRow, int iNumerator, int iDenominator );
|
||||
void SetTimeSignatureAtBeat( float fBeat, int iNumerator, int iDenominator ) { SetTimeSignatureAtRow( BeatToNoteRow(fBeat), iNumerator, iDenominator ); }
|
||||
void SetTimeSignatureNumeratorAtRow( int iRow, int iNumerator );
|
||||
@@ -226,7 +230,14 @@ public:
|
||||
void AddWarpSegment( const WarpSegment &seg );
|
||||
void AddTickcountSegment( const TickcountSegment &seg );
|
||||
int GetBPMSegmentIndexAtBeat( float fBeat );
|
||||
const TimeSignatureSegment& GetTimeSignatureSegmentAtBeat( float fBeat ) const;
|
||||
int GetTimeSignatureSegmentIndexAtRow( int iRow );
|
||||
int GetTimeSignatureSegmentIndexAtBeat( float fBeat ) { return GetTimeSignatureSegmentIndexAtRow( BeatToNoteRow(fBeat) ); }
|
||||
TimeSignatureSegment& GetTimeSignatureSegmentAtRow( int iRow );
|
||||
TimeSignatureSegment& GetTimeSignatureSegmentAtBeat( float fBeat ) { return GetTimeSignatureSegmentAtRow( BeatToNoteRow(fBeat) ); }
|
||||
int GetTimeSignatureNumeratorAtRow( int iRow );
|
||||
int GetTimeSignatureNumeratorAtBeat( float fBeat ) { return GetTimeSignatureNumeratorAtRow( BeatToNoteRow(fBeat) ); }
|
||||
int GetTimeSignatureDenominatorAtRow( int iRow );
|
||||
int GetTimeSignatureDenominatorAtBeat( float fBeat ) { return GetTimeSignatureDenominatorAtRow( BeatToNoteRow(fBeat) ); }
|
||||
BPMSegment& GetBPMSegmentAtBeat( float fBeat );
|
||||
int GetTickcountSegmentIndexAtRow( int iRow );
|
||||
int GetTickcountSegmentIndexAtBeat( float fBeat ) { return GetTickcountSegmentIndexAtRow( BeatToNoteRow(fBeat) ); }
|
||||
|
||||
Reference in New Issue
Block a user