From 0d79abcda83f49e8c3279174e0fa632b7a0308d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Fri, 22 Feb 2013 23:56:33 +0100 Subject: [PATCH] Fix some errors with volume-control, closes #10 --- Vocaluxe/Base/CGraphics.cs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Vocaluxe/Base/CGraphics.cs b/Vocaluxe/Base/CGraphics.cs index 929a71ee..00eaedf1 100644 --- a/Vocaluxe/Base/CGraphics.cs +++ b/Vocaluxe/Base/CGraphics.cs @@ -507,6 +507,11 @@ namespace Vocaluxe.Base && _CurrentScreen != EScreens.ScreenCredits && !CBackgroundMusic.Disabled; bool PopupVolumeControlAllowed = _CurrentScreen != EScreens.ScreenCredits && _CurrentScreen != EScreens.ScreenOptionsRecord; + //Hide volume control for bg-music if bg-music is disabled + if (PopupVolumeControlAllowed && (_CurrentScreen != EScreens.ScreenSong || (_CurrentScreen == EScreens.ScreenSong && CSongs.Category == -1)) + && _CurrentScreen != EScreens.ScreenSing && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_OFF) + PopupVolumeControlAllowed = false; + bool Resume = true; bool EventsAvailable = false; @@ -531,14 +536,9 @@ namespace Vocaluxe.Base HidePopup(EPopupScreens.PopupPlayerControl); } - if (PopupVolumeControlAllowed && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) + if (PopupPlayerControlAllowed && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) { - int Diff = 0; - if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Add)) - Diff = 5; - else if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Subtract)) - Diff = -5; - else if (KeyEvent.Key == Keys.MediaNextTrack) + if (KeyEvent.Key == Keys.MediaNextTrack) CMain.BackgroundMusic.Next(); else if (KeyEvent.Key == Keys.MediaPreviousTrack) CMain.BackgroundMusic.Previous(); @@ -549,6 +549,15 @@ namespace Vocaluxe.Base else CMain.BackgroundMusic.Play(); } + } + + if (PopupVolumeControlAllowed) + { + int Diff = 0; + if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Add)) + Diff = 5; + else if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Subtract)) + Diff = -5; if (Diff != 0) {