Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 19 additions & 32 deletions src/Supervisor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,15 +789,11 @@ i32 Supervisor::PlayMidiFile(i32 midiFileIdx)
ZunResult Supervisor::SetupMidiPlayback(char *path)
{
if (g_Supervisor.cfg.musicMode == MIDI)
{
}
;
else if (g_Supervisor.cfg.musicMode == WAV)
{
}
;
else
{
return ZUN_ERROR;
}
return ZUN_SUCCESS;
}

Expand Down Expand Up @@ -855,16 +851,13 @@ ZunResult Supervisor::StopAudio()
g_Supervisor.midiOutput->StopPlayback();
}
}
else if (g_Supervisor.cfg.musicMode == WAV)
{
g_SoundPlayer.StopBGM();
}
else
{
if (g_Supervisor.cfg.musicMode == WAV)
{
g_SoundPlayer.StopBGM();
}
else
{
return ZUN_ERROR;
}
return ZUN_ERROR;
}

return ZUN_SUCCESS;
Expand All @@ -879,31 +872,25 @@ ZunResult Supervisor::FadeOutMusic(f32 fadeOutSeconds)
g_Supervisor.midiOutput->SetFadeOut(1000.0f * fadeOutSeconds);
}
}
else
else if (g_Supervisor.cfg.musicMode == WAV)
{
if (g_Supervisor.cfg.musicMode == WAV)
if (this->effectiveFramerateMultiplier == 0.0f)
{
if (this->effectiveFramerateMultiplier == 0.0f)
{
g_SoundPlayer.FadeOut(fadeOutSeconds);
}
else
{
if (this->effectiveFramerateMultiplier > 1.0f)
{
g_SoundPlayer.FadeOut(fadeOutSeconds);
}
else
{
g_SoundPlayer.FadeOut(fadeOutSeconds / this->effectiveFramerateMultiplier);
}
}
g_SoundPlayer.FadeOut(fadeOutSeconds);
}
else if (this->effectiveFramerateMultiplier > 1.0f)
{
g_SoundPlayer.FadeOut(fadeOutSeconds);
}
else
{
return ZUN_ERROR;
g_SoundPlayer.FadeOut(fadeOutSeconds / this->effectiveFramerateMultiplier);
}
}
else
{
return ZUN_ERROR;
}

return ZUN_SUCCESS;
}
Expand Down
Loading