Fixed volume-control.

This commit is contained in:
Florian Küpper committed 2013-01-10 17:48:24 +01:00
1 parent 0ff2bb654f
commit 115afef0f1
2 files changed
+14 -9

No files matched your search

+6 -2
View File
@@ -533,9 +533,9 @@ namespace Vocaluxe.Base
if (PopupVolumeControlAllowed && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON) if (PopupVolumeControlAllowed && CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
{ {
int Diff = 0; int Diff = 0;
if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp) || KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Add) if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Add || KeyEvent.Key == Keys.PageUp)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Add))
Diff = 5; Diff = 5;
else if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown) || KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Subtract) else if ((KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown)) || (KeyEvent.Sender == ESender.WiiMote && KeyEvent.Key == Keys.Subtract))
Diff = -5; Diff = -5;
else if (KeyEvent.Key == Keys.MediaNextTrack) else if (KeyEvent.Key == Keys.MediaNextTrack)
CMain.BackgroundMusic.Next(); CMain.BackgroundMusic.Next();
@@ -555,13 +555,17 @@ namespace Vocaluxe.Base
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
if (CSongs.Category != -1) if (CSongs.Category != -1)
{
CConfig.PreviewMusicVolume += Diff; CConfig.PreviewMusicVolume += Diff;
_Screens[(int)_CurrentScreen].ApplyVolume();
}
else else
CConfig.BackgroundMusicVolume += Diff; CConfig.BackgroundMusicVolume += Diff;
break; break;
case EScreens.ScreenSing: case EScreens.ScreenSing:
CConfig.GameMusicVolume += Diff; CConfig.GameMusicVolume += Diff;
_Screens[(int)_CurrentScreen].ApplyVolume();
break; break;
default: default:
@@ -63,18 +63,18 @@ namespace Vocaluxe.Screens
else if (MouseEvent.Wheel > 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent)) else if (MouseEvent.Wheel > 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent))
{ {
if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= 0) if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= 0)
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel;
else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < 0) else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < 0)
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(0); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = 0;
SaveConfig(); SaveConfig();
return true; return true;
} }
else if (MouseEvent.Wheel < 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent)) else if (MouseEvent.Wheel < 0 && CHelper.IsInBounds(_ScreenArea, MouseEvent))
{ {
if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues) if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel < SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues)
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel;
else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues) else if (SelectSlides[htSelectSlides(SelectSlideVolume)].Selection - MouseEvent.Wheel >= SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues)
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex(SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues - 1); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = SelectSlides[htSelectSlides(SelectSlideVolume)].NumValues - 1;
SaveConfig(); SaveConfig();
return true; return true;
} }
@@ -93,6 +93,7 @@ namespace Vocaluxe.Screens
public override bool UpdateGame() public override bool UpdateGame()
{ {
UpdateSlides();
return true; return true;
} }
@@ -132,15 +133,15 @@ namespace Vocaluxe.Screens
switch (CGraphics.CurrentScreen) switch (CGraphics.CurrentScreen)
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex((int)CConfig.PreviewMusicVolume / 5); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = (int)(CConfig.PreviewMusicVolume / 5);
break; break;
case EScreens.ScreenSing: case EScreens.ScreenSing:
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex((int)CConfig.GameMusicVolume / 5); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.GameMusicVolume / 5);
break; break;
default: default:
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex((int)CConfig.BackgroundMusicVolume / 5); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5);
break; break;
} }
} }