void BPMDisplay::CycleRandomly() { DisplayBpms bpms; bpms.Add(-1); SetBPMRange( bpms ); RunCommands( SET_RANDOM_COMMAND ); m_fCycleTime = (float)RANDOM_CYCLE_SPEED; // Go to default value in event of a negative value in the metrics if( m_fCycleTime < 0 ) m_fCycleTime = 0.2f; }
void BPMDisplay::SetBpmFromSong( const Song* pSong ) { ASSERT( pSong != NULL ); switch( pSong->m_DisplayBPMType ) { case DISPLAY_BPM_ACTUAL: case DISPLAY_BPM_SPECIFIED: { DisplayBpms bpms; pSong->GetDisplayBpms( bpms ); SetBPMRange( bpms ); m_fCycleTime = 1.0f; } break; case DISPLAY_BPM_RANDOM: CycleRandomly(); break; default: FAIL_M(ssprintf("Invalid display BPM type: %i", pSong->m_DisplayBPMType)); } }
void BPMDisplay::SetBpmFromSong( const Song* pSong ) { ASSERT( pSong ); switch( pSong->m_DisplayBPMType ) { case DISPLAY_BPM_ACTUAL: case DISPLAY_BPM_SPECIFIED: { DisplayBpms bpms; pSong->GetDisplayBpms( bpms ); SetBPMRange( bpms ); m_fCycleTime = 1.0f; } break; case DISPLAY_BPM_RANDOM: CycleRandomly(); break; default: ASSERT(0); } }
void BPMDisplay::SetBpmFromCourse( const Course* pCourse ) { ASSERT( pCourse != NULL ); ASSERT( GAMESTATE->GetCurrentStyle(PLAYER_INVALID) != NULL ); StepsType st = GAMESTATE->GetCurrentStyle(PLAYER_INVALID)->m_StepsType; Trail *pTrail = pCourse->GetTrail( st ); // GetTranslitFullTitle because "Crashinfo.txt is garbled because of the ANSI output as usual." -f ASSERT_M( pTrail != NULL, ssprintf("Course '%s' has no trail for StepsType '%s'", pCourse->GetTranslitFullTitle().c_str(), StringConversion::ToString(st).c_str() ) ); m_fCycleTime = (float)COURSE_CYCLE_SPEED; if( (int)pTrail->m_vEntries.size() > CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS ) { SetVarious(); return; } DisplayBpms bpms; pTrail->GetDisplayBpms( bpms ); SetBPMRange( bpms ); }
void BPMDisplay::SetConstantBpm( float fBPM ) { DisplayBpms bpms; bpms.Add( fBPM ); SetBPMRange( bpms ); }