music start fixes
This commit is contained in:
@@ -34,7 +34,6 @@ struct MusicToPlay
|
||||
CString file;
|
||||
TimingData timing;
|
||||
bool HasTiming;
|
||||
CString timing_file;
|
||||
bool force_loop;
|
||||
float start_sec, length_sec, fade_len;
|
||||
};
|
||||
@@ -69,10 +68,7 @@ void StartQueuedMusic( const RageTimer &when )
|
||||
if( g_MusicToPlay.force_loop )
|
||||
g_Music->SetStopMode( RageSound::M_LOOP );
|
||||
|
||||
if( g_MusicToPlay.start_sec == -1 )
|
||||
g_Music->SetStartSeconds();
|
||||
else
|
||||
g_Music->SetStartSeconds( g_MusicToPlay.start_sec );
|
||||
g_Music->SetStartSeconds( g_MusicToPlay.start_sec );
|
||||
|
||||
if( g_MusicToPlay.length_sec == -1 )
|
||||
g_Music->SetLengthSeconds();
|
||||
@@ -149,7 +145,6 @@ void RageSounds::PlayMusic( const CString &file, const CString &timing_file, boo
|
||||
g_Music->Unload();
|
||||
|
||||
g_MusicToPlay.file = file;
|
||||
g_MusicToPlay.timing_file = timing_file;
|
||||
g_MusicToPlay.force_loop = force_loop;
|
||||
g_MusicToPlay.start_sec = start_sec;
|
||||
g_MusicToPlay.length_sec = length_sec;
|
||||
@@ -182,7 +177,7 @@ void RageSounds::PlayMusic( const CString &file, const CString &timing_file, boo
|
||||
}
|
||||
}
|
||||
|
||||
if( g_MusicToPlay.HasTiming && force_loop )
|
||||
if( g_MusicToPlay.HasTiming && force_loop && length_sec != -1 )
|
||||
{
|
||||
float fStartBeat = g_MusicToPlay.timing.GetBeatFromElapsedTime( g_MusicToPlay.start_sec );
|
||||
float fEndSec = start_sec + length_sec;
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
~RageSounds();
|
||||
void Update( float fDeltaTime );
|
||||
|
||||
void PlayMusic( const CString &file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0 ) { PlayMusic( file, "", force_loop, start_sec, length_sec, fade_len ); }
|
||||
void PlayMusic( const CString &file, bool force_loop = false, float start_sec = 0, float length_sec = -1, float fade_len = 0 ) { PlayMusic( file, "", force_loop, start_sec, length_sec, fade_len ); }
|
||||
void PlayMusic( const CString &file, const CString &timing_file, bool force_loop = false, float start_sec = -1, float length_sec = -1, float fade_len = 0 );
|
||||
void StopMusic() { PlayMusic(""); }
|
||||
CString GetMusicPath() const;
|
||||
|
||||
@@ -1211,7 +1211,8 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
m_sprCDTitleBack.UnloadTexture();
|
||||
m_DifficultyDisplay.UnsetDifficulties();
|
||||
|
||||
m_fSampleStartSeconds = m_fSampleLengthSeconds = -1;
|
||||
m_fSampleStartSeconds = 0;
|
||||
m_fSampleLengthSeconds = -1;
|
||||
switch( m_MusicWheel.GetSelectedType() )
|
||||
{
|
||||
case TYPE_SECTION:
|
||||
@@ -1308,7 +1309,8 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
m_sprCDTitleBack.UnloadTexture();
|
||||
m_DifficultyDisplay.UnsetDifficulties();
|
||||
|
||||
m_fSampleStartSeconds = m_fSampleLengthSeconds = -1;
|
||||
m_fSampleStartSeconds = 0;
|
||||
m_fSampleLengthSeconds = -1;
|
||||
switch( m_MusicWheel.GetSelectedType() )
|
||||
{
|
||||
case TYPE_ROULETTE:
|
||||
|
||||
Reference in New Issue
Block a user