diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 6b49ec98..31acd203 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -156,6 +156,9 @@ namespace Vocaluxe.Base public static void Play() { + if (_Playing) + return; + if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) { if (_AllFileNames.Count > 0) @@ -181,6 +184,9 @@ namespace Vocaluxe.Base public static void Stop() { + if (!_Playing) + return; + if (_VideoEnabled && _Video != -1) { CVideo.VdClose(_Video); @@ -195,6 +201,9 @@ namespace Vocaluxe.Base public static void Pause() { + if (!_Playing) + return; + if (_VideoEnabled && _Video != -1) { CVideo.VdPause(_Video); diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs index 5e74e834..91ecbba1 100644 --- a/Vocaluxe/Screens/CScreenLoad.cs +++ b/Vocaluxe/Screens/CScreenLoad.cs @@ -30,6 +30,8 @@ namespace Vocaluxe.Screens private int _CurrentIntroVideoNr; private bool _IntroOutPlayed; private VideoPlayer[] _Intros; + + private bool _BGMusicStartet; public CScreenLoad() @@ -121,8 +123,7 @@ namespace Vocaluxe.Screens } } - if (!CBackgroundMusic.Playing) - CBackgroundMusic.Next(); + _BGMusicStartet = false; } public override void OnShowFinish() @@ -141,9 +142,6 @@ namespace Vocaluxe.Screens _SongLoaderThread.IsBackground = true; _SongLoaderThread.Start(); _timer.Start(); - - if (!CBackgroundMusic.Playing) - CBackgroundMusic.Next(); } public override bool UpdateGame() @@ -172,12 +170,14 @@ namespace Vocaluxe.Screens CLanguage.Translate("TR_SCREENLOAD_LOADED") + ")"; if (CSongs.SongsLoaded && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON && - CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC) + CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_NO_OWN_MUSIC && !_BGMusicStartet) { CBackgroundMusic.AddOwnMusic(); - //if (!CBackgroundMusic.Playing) - // CBackgroundMusic.Next(); + if (!CBackgroundMusic.Playing) + CBackgroundMusic.Next(); + + _BGMusicStartet = true; } CBackgroundMusic.CanSing = false; diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index df176860..2dd4b177 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -183,16 +183,19 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].Update(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); + if (CSongs.Category > 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) + CBackgroundMusic.Disabled = true; + else + CBackgroundMusic.Disabled = false; + int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection(); if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length) { - Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title; - CBackgroundMusic.Disabled = true; + Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title; } else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length) { - Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; - CBackgroundMusic.Disabled = false; + Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; } else Texts[htTexts(TextSelection)].Text = String.Empty;