From a2bf447c70ac7ea7b27e7edcd31db323d4bcbe0d Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Wed, 2 May 2012 15:00:54 +0200 Subject: [PATCH] Hide sing button in load screen Hide sing button if backgroundmusic is played --- Vocaluxe/Base/CBackgroundMusic.cs | 19 +++++++++++++++++++ Vocaluxe/Screens/CPopupScreenPlayerControl.cs | 2 ++ Vocaluxe/Screens/CScreenLoad.cs | 3 +++ 3 files changed, 24 insertions(+) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 6ee94ea4..6b49ec98 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -33,6 +33,7 @@ namespace Vocaluxe.Base private static bool _BackgroundMusicAdded; private static bool _Playing; private static bool _Disabled; + private static bool _CanSing; public static bool VideoEnabled { @@ -54,6 +55,19 @@ namespace Vocaluxe.Base } } + public static bool CanSing + { + get + { + return _CanSing; + } + + set + { + _CanSing = value; + } + } + public static bool Disabled { get @@ -156,6 +170,11 @@ namespace Vocaluxe.Base } else Next(); + + if (!IsBackgroundFile(_CurrentPlaylistElement)) + _CanSing = true; + else + _CanSing = false; } } } diff --git a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs index 3e383be6..85e1467d 100644 --- a/Vocaluxe/Screens/CPopupScreenPlayerControl.cs +++ b/Vocaluxe/Screens/CPopupScreenPlayerControl.cs @@ -46,6 +46,7 @@ namespace Vocaluxe.Screens CBackgroundMusic.VideoEnabled = true; } } + private bool VideoBackground { get @@ -185,6 +186,7 @@ namespace Vocaluxe.Screens Statics[htStatics(StaticCover)].Visible = !_VideoPreview || !CBackgroundMusic.SongHasVideo; Buttons[htButtons(ButtonToBackgroundVideo)].Pressed = VideoBackground; Buttons[htButtons(ButtonShowVideo)].Pressed = _VideoPreview; + Buttons[htButtons(ButtonSing)].Visible = CBackgroundMusic.CanSing; return true; } diff --git a/Vocaluxe/Screens/CScreenLoad.cs b/Vocaluxe/Screens/CScreenLoad.cs index 3a1a3c96..5e74e834 100644 --- a/Vocaluxe/Screens/CScreenLoad.cs +++ b/Vocaluxe/Screens/CScreenLoad.cs @@ -179,6 +179,7 @@ namespace Vocaluxe.Screens //if (!CBackgroundMusic.Playing) // CBackgroundMusic.Next(); } + CBackgroundMusic.CanSing = false; return true; } @@ -207,6 +208,8 @@ namespace Vocaluxe.Screens _Intros[i].Close(); } + CBackgroundMusic.CanSing = true; + CLog.StopBenchmark(3, "Load Cover"); }