From 016565df9025841c7fdae460b5d2eaee277fc89d Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Wed, 22 Feb 2012 16:34:09 +0100 Subject: [PATCH] stop bg music if there are no more files to play (after option change) --- Vocaluxe/Base/CBackgroundMusic.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 94810162..77163853 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -51,16 +51,14 @@ namespace Vocaluxe.Base public static void Stop() { - if (_AllFileNames.Count > 0) - CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); + CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); _CurrentMusicFilePath = String.Empty; } public static void Pause() { - if (_AllFileNames.Count > 0) - CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); + CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime); } public static void Update() @@ -113,7 +111,7 @@ namespace Vocaluxe.Base if (_BackgroundMusicAdded) _AllFileNames.AddRange(_BGMusicFileNames); - if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath)) + if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0) Next(); _OwnMusicAdded = false; @@ -137,7 +135,7 @@ namespace Vocaluxe.Base AddOwnMusic(); _BackgroundMusicAdded = false; - if (IsPlaying() && IsBackgroundFile(_CurrentMusicFilePath)) + if (IsPlaying() && IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0) Next(); } }