mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Fix music changes between areas
This commit is contained in:
parent
b8553107ff
commit
e16c1557fa
1 changed files with 11 additions and 2 deletions
|
@ -357,6 +357,7 @@ end:
|
|||
FAudioSourceVoice_FlushSourceBuffers(musicVoice);
|
||||
FAudioVoice_DestroyVoice(musicVoice);
|
||||
musicVoice = NULL;
|
||||
paused = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,14 +371,21 @@ end:
|
|||
if (!IsHalted())
|
||||
{
|
||||
FAudioSourceVoice_Stop(musicVoice, 0, FAUDIO_COMMIT_NOW);
|
||||
paused = true;
|
||||
}
|
||||
}
|
||||
|
||||
static bool IsPaused()
|
||||
{
|
||||
return paused || IsHalted();
|
||||
}
|
||||
|
||||
static void Resume()
|
||||
{
|
||||
if (!IsHalted())
|
||||
{
|
||||
FAudioSourceVoice_Start(musicVoice, 0, FAUDIO_COMMIT_NOW);
|
||||
paused = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,6 +414,7 @@ end:
|
|||
bool shouldloop;
|
||||
bool valid;
|
||||
|
||||
static bool paused;
|
||||
static FAudioSourceVoice* musicVoice;
|
||||
|
||||
static void refillReserve(FAudioVoiceCallback* callback, void* ctx)
|
||||
|
@ -560,7 +569,7 @@ end:
|
|||
return (result * 60 + val) * samplerate_hz;
|
||||
}
|
||||
};
|
||||
|
||||
bool MusicTrack::paused = false;
|
||||
FAudioSourceVoice* MusicTrack::musicVoice = NULL;
|
||||
|
||||
musicclass::musicclass(void)
|
||||
|
@ -1130,7 +1139,7 @@ void musicclass::resumeef(void)
|
|||
|
||||
bool musicclass::halted(void)
|
||||
{
|
||||
return MusicTrack::IsHalted();
|
||||
return MusicTrack::IsPaused();
|
||||
}
|
||||
|
||||
void musicclass::updatemutestate(void)
|
||||
|
|
Loading…
Reference in a new issue