stop bg music if there are no more files to play (after option change)
This commit is contained in:
1 parent
3416122b73
commit
016565df90
1 file changed
+4
-6
@@ -51,16 +51,14 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void Stop()
|
public static void Stop()
|
||||||
{
|
{
|
||||||
if (_AllFileNames.Count > 0)
|
CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||||
CSound.FadeAndStop(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
|
||||||
|
|
||||||
_CurrentMusicFilePath = String.Empty;
|
_CurrentMusicFilePath = String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Pause()
|
public static void Pause()
|
||||||
{
|
{
|
||||||
if (_AllFileNames.Count > 0)
|
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
||||||
CSound.FadeAndPause(_CurrentMusicStream, 0f, CSettings.BackgroundMusicFadeTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Update()
|
public static void Update()
|
||||||
@@ -113,7 +111,7 @@ namespace Vocaluxe.Base
|
|||||||
if (_BackgroundMusicAdded)
|
if (_BackgroundMusicAdded)
|
||||||
_AllFileNames.AddRange(_BGMusicFileNames);
|
_AllFileNames.AddRange(_BGMusicFileNames);
|
||||||
|
|
||||||
if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath))
|
if (IsPlaying() && !IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0)
|
||||||
Next();
|
Next();
|
||||||
|
|
||||||
_OwnMusicAdded = false;
|
_OwnMusicAdded = false;
|
||||||
@@ -137,7 +135,7 @@ namespace Vocaluxe.Base
|
|||||||
AddOwnMusic();
|
AddOwnMusic();
|
||||||
_BackgroundMusicAdded = false;
|
_BackgroundMusicAdded = false;
|
||||||
|
|
||||||
if (IsPlaying() && IsBackgroundFile(_CurrentMusicFilePath))
|
if (IsPlaying() && IsBackgroundFile(_CurrentMusicFilePath) || _AllFileNames.Count == 0)
|
||||||
Next();
|
Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user