Finished volume-control.

This commit is contained in:
Florian Kuepper committed 2012-12-07 21:45:17 +01:00
1 parent 2b943305a1
commit 256762305a
16 files changed
+544 -11

No files matched your search

+4
View File
@@ -190,6 +190,8 @@
<TR_SCREENOSOUND_BACKGROUNDMUSIC>Hintergrundmusik</TR_SCREENOSOUND_BACKGROUNDMUSIC>
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>Hintergrundmusiklautstärke</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>Hintergrundmusikquelle</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
<TR_SCREENOSOUND_PREVIEWMUSICVOLUME>Vorschaulautstärke</TR_SCREENOSOUND_PREVIEWMUSICVOLUME>
<TR_SCREENOSOUND_GAMEMUSICVOLUME>Spiellautstärke</TR_SCREENOSOUND_GAMEMUSICVOLUME>
<!--ScreenOptionsTheme-->
<TR_SCREENOTHEME_OPTIONS>Designeinstellungen</TR_SCREENOTHEME_OPTIONS>
<TR_SCREENOTHEME_THEME>Design</TR_SCREENOTHEME_THEME>
@@ -210,5 +212,7 @@
<TR_SCREENOVIDEO_VIDEOPREVIEW>Video-Vorschau</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Videos während des Singens</TR_SCREENOVIDEO_VIDEOINSONGS>
<TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>Videos der Hintergrundmusik</TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>
<!--ScreenPopupVolumeControl-->
<TR_SCREENPVOLUMECONTROL_VOLUME>Lautstärke</TR_SCREENPVOLUMECONTROL_VOLUME>
</Texts>
</root>
+4
View File
@@ -190,6 +190,8 @@
<TR_SCREENOSOUND_BACKGROUNDMUSIC>Background Music</TR_SCREENOSOUND_BACKGROUNDMUSIC>
<TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>Background Music Volume</TR_SCREENOSOUND_BACKGROUNDMUSICVOLUME>
<TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>Background Music Source</TR_SCREENOSOUND_BACKGROUNDMUSICSOURCE>
<TR_SCREENOSOUND_PREVIEWMUSICVOLUME>Preview Music Volume</TR_SCREENOSOUND_PREVIEWMUSICVOLUME>
<TR_SCREENOSOUND_GAMEMUSICVOLUME>Game Music Volume</TR_SCREENOSOUND_GAMEMUSICVOLUME>
<!--ScreenOptionsTheme-->
<TR_SCREENOTHEME_OPTIONS>Theme Options</TR_SCREENOTHEME_OPTIONS>
<TR_SCREENOTHEME_THEME>Theme</TR_SCREENOTHEME_THEME>
@@ -210,5 +212,7 @@
<TR_SCREENOVIDEO_VIDEOPREVIEW>Video Preview</TR_SCREENOVIDEO_VIDEOPREVIEW>
<TR_SCREENOVIDEO_VIDEOINSONGS>Videos while singing</TR_SCREENOVIDEO_VIDEOINSONGS>
<TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>Display current backgroundmusic video</TR_SCREENO_VIDEO_VIDEOSTOBACKGROUND>
<!--ScreenPopupVolumeControl-->
<TR_SCREENPVOLUMECONTROL_VOLUME>Volume</TR_SCREENPVOLUMECONTROL_VOLUME>
</Texts>
</root>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<ScreenOptionsSound>
<ScreenVersion>2</ScreenVersion>
<ScreenVersion>3</ScreenVersion>
<Background1>
<!--<Type>: Background type: None, Color, Texture, Video-->
<Type>Video</Type>
@@ -145,6 +145,64 @@
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text4>
<Text5>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>285</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Left</Align>
<!--<HAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
<HAlign>Center</HAlign>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Outline</Font>
<!--<Text>: Nothing or translation tag-->
<Text>TR_SCREENOSOUND_PREVIEWMUSICVOLUME</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text5>
<Text6>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>345</Y>
<!--<Z>: Text position-->
<Z>0,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Left</Align>
<!--<HAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
<HAlign>Center</HAlign>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Outline</Font>
<!--<Text>: Nothing or translation tag-->
<Text>TR_SCREENOSOUND_GAMEMUSICVOLUME</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text6>
<ButtonExit>
<!--<Skin>: Texture name-->
<Skin>Button</Skin>
@@ -397,5 +455,135 @@
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>1</NumVisible>
</SelectSlideBackgroundMusicSource>
<SelectSlidePreviewMusicVolume>
<!--<Skin>: Texture name-->
<Skin>Invisible</Skin>
<!--<SkinArrowLeft>: Texture name of left arrow-->
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<!--<SkinArrowRight>: Texture name of right arrow-->
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<!--<SkinSelected>: Texture name for selected SelectSlide-->
<SkinSelected>SelectSlide</SkinSelected>
<!--<SkinArrowLeftSelected>: Texture name of selected left arrow-->
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<!--<SkinArrowRightSelected>: Texture name of selected right arrow-->
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<!--<SkinHighlighted>: Texture name for highlighted SelectSlide-->
<SkinHighlighted>SelectSlide</SkinHighlighted>
<!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height-->
<X>500</X>
<Y>280</Y>
<Z>0,00</Z>
<W>700</W>
<H>50</H>
<!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height-->
<ArrowLeftX>505</ArrowLeftX>
<ArrowLeftY>285</ArrowLeftY>
<ArrowLeftZ>0,00</ArrowLeftZ>
<ArrowLeftW>40</ArrowLeftW>
<ArrowLeftH>40</ArrowLeftH>
<!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height-->
<ArrowRightX>1170</ArrowRightX>
<ArrowRightY>285</ArrowRightY>
<ArrowRightZ>0,00</ArrowRightZ>
<ArrowRightW>40</ArrowRightW>
<ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor>
<!--<ArrowSColor>: Selected arrow color from ColorScheme (high priority)-->
<!--or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)-->
<ArrowSColor>ArrowSColor</ArrowSColor>
<!--<TextColor>: Text color from ColorScheme (high priority)-->
<!--or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)-->
<TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor>
<!--<TextH>: Text height-->
<TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)-->
<TextMaxW>500,00</TextMaxW>
<!--<TextFont>: Text font name-->
<TextFont>Outline</TextFont>
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
<TextStyle>Bold</TextStyle>
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>3</NumVisible>
</SelectSlidePreviewMusicVolume>
<SelectSlideGameMusicVolume>
<!--<Skin>: Texture name-->
<Skin>Invisible</Skin>
<!--<SkinArrowLeft>: Texture name of left arrow-->
<SkinArrowLeft>SelectSlideArrowLeft</SkinArrowLeft>
<!--<SkinArrowRight>: Texture name of right arrow-->
<SkinArrowRight>SelectSlideArrowRight</SkinArrowRight>
<!--<SkinSelected>: Texture name for selected SelectSlide-->
<SkinSelected>SelectSlide</SkinSelected>
<!--<SkinArrowLeftSelected>: Texture name of selected left arrow-->
<SkinArrowLeftSelected>SelectSlideArrowLeft</SkinArrowLeftSelected>
<!--<SkinArrowRightSelected>: Texture name of selected right arrow-->
<SkinArrowRightSelected>SelectSlideArrowRight</SkinArrowRightSelected>
<!--<SkinHighlighted>: Texture name for highlighted SelectSlide-->
<SkinHighlighted>SelectSlide</SkinHighlighted>
<!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height-->
<X>500</X>
<Y>340</Y>
<Z>0,00</Z>
<W>700</W>
<H>50</H>
<!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height-->
<ArrowLeftX>505</ArrowLeftX>
<ArrowLeftY>345</ArrowLeftY>
<ArrowLeftZ>0,00</ArrowLeftZ>
<ArrowLeftW>40</ArrowLeftW>
<ArrowLeftH>40</ArrowLeftH>
<!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height-->
<ArrowRightX>1170</ArrowRightX>
<ArrowRightY>345</ArrowRightY>
<ArrowRightZ>0,00</ArrowRightZ>
<ArrowRightW>40</ArrowRightW>
<ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor>
<!--<ArrowSColor>: Selected arrow color from ColorScheme (high priority)-->
<!--or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)-->
<ArrowSColor>ArrowSColor</ArrowSColor>
<!--<TextColor>: Text color from ColorScheme (high priority)-->
<!--or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)-->
<TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor>
<!--<TextH>: Text height-->
<TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)-->
<TextMaxW>500,00</TextMaxW>
<!--<TextFont>: Text font name-->
<TextFont>Outline</TextFont>
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
<TextStyle>Bold</TextStyle>
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>3</NumVisible>
</SelectSlideGameMusicVolume>
</ScreenOptionsSound>
</root>
</root>
+4 -1
View File
@@ -333,6 +333,9 @@
<DeleteIcon>Delete.png</DeleteIcon>
<SaveIcon>Save.png</SaveIcon>
<SingIcon>Sing.png</SingIcon>
<Minus>Minus.png</Minus>
<Plus>Plus.png</Plus>
<VolumeBG>VolumeBG.png</VolumeBG>
</Skins>
<Videos>
<BG_Video>[Blue]BG_Video.mp4</BG_Video>
@@ -340,4 +343,4 @@
<IntroMid>[Blue]IntroMid.mp4</IntroMid>
<IntroOut>[Blue]IntroOut.mp4</IntroOut>
</Videos>
</root>
</root>
+4 -1
View File
@@ -327,6 +327,9 @@
<DeleteIcon>Delete.png</DeleteIcon>
<SaveIcon>Save.png</SaveIcon>
<SingIcon>Sing.png</SingIcon>
<Minus>Minus.png</Minus>
<Plus>Plus.png</Plus>
<VolumeBG>VolumeBG.png</VolumeBG>
</Skins>
<Videos>
<BG_Video>[Green]BG_Video.mp4</BG_Video>
@@ -334,4 +337,4 @@
<IntroMid>[Green]IntroMid.mp4</IntroMid>
<IntroOut>[Green]IntroOut.mp4</IntroOut>
</Videos>
</root>
</root>
+4 -1
View File
@@ -327,6 +327,9 @@
<DeleteIcon>Delete.png</DeleteIcon>
<SaveIcon>Save.png</SaveIcon>
<SingIcon>Sing.png</SingIcon>
<Minus>Minus.png</Minus>
<Plus>Plus.png</Plus>
<VolumeBG>VolumeBG.png</VolumeBG>
</Skins>
<Videos>
<BG_Video>[Red]BG_Video.mp4</BG_Video>
@@ -334,4 +337,4 @@
<IntroMid>[Red]IntroMid.mp4</IntroMid>
<IntroOut>[Red]IntroOut.mp4</IntroOut>
</Videos>
</root>
</root>
+4 -1
View File
@@ -327,6 +327,9 @@
<DeleteIcon>Delete.png</DeleteIcon>
<SaveIcon>Save.png</SaveIcon>
<SingIcon>Sing.png</SingIcon>
<Minus>Minus.png</Minus>
<Plus>Plus.png</Plus>
<VolumeBG>VolumeBG.png</VolumeBG>
</Skins>
<Videos>
<BG_Video>[Yellow]BG_Video.mp4</BG_Video>
@@ -334,4 +337,4 @@
<IntroMid>[Yellow]IntroMid.mp4</IntroMid>
<IntroOut>[Yellow]IntroOut.mp4</IntroOut>
</Videos>
</root>
</root>
@@ -1,5 +1,17 @@
ScreenOptionsSound
++++++++++
Version 3:
Add:
<SelectSlidePreviewMusicVolume>
<SelectSlideGameMusicVolume>
and some texts for description (Text5, Text6)
"TR_SCRsEENOSOUND_PREVIEWMUSICVOLUME"
"TR_SCREENOSOUND_GAMEMUSICVOLUEM"
++++++++++
Version 2:
+22
View File
@@ -40,6 +40,7 @@ namespace Vocaluxe.Menu
enum EPopupScreens
{
PopupPlayerControl = 0,
PopupVolumeControl = 1,
NoPopup = -1
}
@@ -210,6 +211,11 @@ namespace Vocaluxe.Menu
get { return _ZOffset; }
}
public static EScreens CurrentScreen
{
get { return _CurrentScreen; }
}
#region public methods
public static void InitGraphics()
{
@@ -235,6 +241,7 @@ namespace Vocaluxe.Menu
_Screens.Add(new CScreenCredits());
_PopupScreens.Add(new CPopupScreenPlayerControl());
_PopupScreens.Add(new CPopupScreenVolumeControl());
CLog.StopBenchmark(1, "Build Screen List");
@@ -454,6 +461,8 @@ namespace Vocaluxe.Menu
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing &&
_CurrentScreen != EScreens.ScreenSong && _CurrentScreen != EScreens.ScreenCredits;
bool PopupVolumeControlAllowed = _CurrentScreen != EScreens.ScreenCredits;
bool Resume = true;
while (keys.PollEvent(ref KeyEvent))
{
@@ -517,9 +526,22 @@ namespace Vocaluxe.Menu
if (!isOverPopupPlayerControl && _CurrentPopupScreen == EPopupScreens.PopupPlayerControl)
HidePopup(EPopupScreens.PopupPlayerControl);
bool isOverPopupVolumeControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupVolumeControl].ScreenArea, MouseEvent);
if (PopupVolumeControlAllowed && isOverPopupVolumeControl)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
ShowPopup(EPopupScreens.PopupVolumeControl);
}
if (!isOverPopupVolumeControl && _CurrentPopupScreen == EPopupScreens.PopupVolumeControl)
HidePopup(EPopupScreens.PopupVolumeControl);
bool handled = false;
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
handled = _PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
if (handled && _CurrentPopupScreen == EPopupScreens.PopupVolumeControl)
_Screens[(int)_CurrentScreen].ApplyVolume();
if (!handled && !_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB || MouseEvent.MB))
Resume &= _Screens[(int)_CurrentScreen].HandleMouse(MouseEvent);
+4
View File
@@ -1078,6 +1078,10 @@ namespace Vocaluxe.Menu
public abstract bool UpdateGame();
public virtual void ApplyVolume()
{
}
public virtual void OnShow()
{
ResumeBG();
@@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.GameModes;
using Vocaluxe.Lib.Draw;
using Vocaluxe.Menu;
using Vocaluxe.Lib.Song;
namespace Vocaluxe.Screens
{
class CPopupScreenVolumeControl : CMenu
{
// Version number for theme files. Increment it, if you've changed something on the theme files!
const int ScreenVersion = 1;
private const string StaticBG = "StaticBG";
private const string SelectSlideVolume = "SelectSlideVolume";
public CPopupScreenVolumeControl()
{
Init();
}
protected override void Init()
{
base.Init();
_ThemeName = "PopupScreenVolumeControl";
_ScreenVersion = ScreenVersion;
_ThemeStatics = new string[] { StaticBG };
_ThemeSelectSlides = new string[] { SelectSlideVolume };
}
public override void LoadTheme()
{
base.LoadTheme();
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
SelectSlides[htSelectSlides(SelectSlideVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
}
public override bool HandleInput(KeyEvent KeyEvent)
{
base.HandleInput(KeyEvent);
if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
{
}
else
{
switch (KeyEvent.Key)
{
case Keys.Escape:
case Keys.Back:
CGraphics.HidePopup(EPopupScreens.PopupVolumeControl);
return false;
}
}
return true;
}
public override bool HandleMouse(MouseEvent MouseEvent)
{
base.HandleMouse(MouseEvent);
if (MouseEvent.LB)
{
SaveConfig();
return true;
}
else if (MouseEvent.RB)
{
//CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
return false;
}
return true;
}
public override void OnShow()
{
base.OnShow();
switch (CGraphics.CurrentScreen)
{
case EScreens.ScreenSong:
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex((int)CConfig.PreviewMusicVolume / 5);
break;
case EScreens.ScreenSing:
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex((int)CConfig.GameMusicVolume / 5);
break;
default:
SelectSlides[htSelectSlides(SelectSlideVolume)].SetSelectionByValueIndex((int)CConfig.BackgroundMusicVolume / 5);
break;
}
}
public override bool UpdateGame()
{
return true;
}
public override bool Draw()
{
if (!_Active)
return false;
return base.Draw();
}
private void SaveConfig()
{
switch (CGraphics.CurrentScreen)
{
case EScreens.ScreenSong:
CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5;
break;
case EScreens.ScreenSing:
CConfig.GameMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5;
break;
default:
CConfig.BackgroundMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5;
CBackgroundMusic.ApplyVolume();
break;
}
CConfig.SaveConfig();
}
}
}
+13 -2
View File
@@ -12,11 +12,13 @@ namespace Vocaluxe.Screens
class CScreenOptionsSound : CMenu
{
// Version number for theme files. Increment it, if you've changed something on the theme files!
const int ScreenVersion = 2;
const int ScreenVersion = 3;
private const string SelectSlideBackgroundMusic = "SelectSlideBackgroundMusic";
private const string SelectSlideBackgroundMusicVolume = "SelectSlideBackgroundMusicVolume";
private const string SelectSlideBackgroundMusicSource = "SelectSlideBackgroundMusicSource";
private const string SelectSlidePreviewMusicVolume = "SelectSlidePreviewMusicVolume";
private const string SelectSlideGameMusicVolume = "SelectSlideGameMusicVolume";
private const string ButtonExit = "ButtonExit";
@@ -36,7 +38,7 @@ namespace Vocaluxe.Screens
_ScreenVersion = ScreenVersion;
_ThemeButtons = new string[] { ButtonExit };
_ThemeSelectSlides = new string[] { SelectSlideBackgroundMusic, SelectSlideBackgroundMusicVolume, SelectSlideBackgroundMusicSource };
_ThemeSelectSlides = new string[] { SelectSlideBackgroundMusic, SelectSlideBackgroundMusicVolume, SelectSlideBackgroundMusicSource, SelectSlidePreviewMusicVolume, SelectSlideGameMusicVolume };
}
public override void LoadTheme()
@@ -47,6 +49,11 @@ namespace Vocaluxe.Screens
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection = CConfig.BackgroundMusicVolume / 5;
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].SetValues<EBackgroundMusicSource>((int)CConfig.BackgroundMusicSource);
SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection = (int)CConfig.BackgroundMusicSource;
SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection = CConfig.PreviewMusicVolume / 5;
SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].AddValues(new string[] { "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" });
SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection = CConfig.GameMusicVolume / 5;
}
public override bool HandleInput(KeyEvent KeyEvent)
@@ -130,6 +137,10 @@ namespace Vocaluxe.Screens
}
private void SaveConfig()
{
CConfig.GameMusicVolume = SelectSlides[htSelectSlides(SelectSlideGameMusicVolume)].Selection * 5;
CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlidePreviewMusicVolume)].Selection * 5;
CConfig.SaveConfig();
EOffOn NewOffOn = (EOffOn)SelectSlides[htSelectSlides(SelectSlideBackgroundMusic)].Selection;
EBackgroundMusicSource NewSource = (EBackgroundMusicSource)SelectSlides[htSelectSlides(SelectSlideBackgroundMusicSource)].Selection;
float NewVolume = SelectSlides[htSelectSlides(SelectSlideBackgroundMusicVolume)].Selection * 5;
+8 -3
View File
@@ -236,7 +236,7 @@ namespace Vocaluxe.Screens
if (CConfig.GameMusicVolume > 100)
CConfig.GameMusicVolume = 100;
CConfig.SaveConfig();
CSound.SetStreamVolume(_CurrentStream, CConfig.GameMusicVolume);
ApplyVolume();
}
break;
@@ -248,7 +248,7 @@ namespace Vocaluxe.Screens
if (CConfig.GameMusicVolume < 0)
CConfig.GameMusicVolume = 0;
CConfig.SaveConfig();
CSound.SetStreamVolume(_CurrentStream, CConfig.GameMusicVolume);
ApplyVolume();
}
break;
}
@@ -515,6 +515,11 @@ namespace Vocaluxe.Screens
CloseSong();
}
public override void ApplyVolume()
{
CSound.SetStreamVolumeMax(_CurrentStream, CConfig.GameMusicVolume);
}
private void CloseSong()
{
CSound.FadeAndStop(_CurrentStream, 0f, 0.5f);
@@ -569,7 +574,7 @@ namespace Vocaluxe.Screens
Texts[htTexts(TextSongName)].Text = songname;
_CurrentStream = CSound.Load(song.GetMP3(), true);
CSound.SetStreamVolumeMax(_CurrentStream, 100f); //TODO: Add volume control var
CSound.SetStreamVolumeMax(_CurrentStream, CConfig.GameMusicVolume);
CSound.SetStreamVolume(_CurrentStream, _Volume);
CSound.SetPosition(_CurrentStream, song.Start);
_CurrentTime = song.Start;
+11
View File
@@ -317,6 +317,7 @@ namespace Vocaluxe.Screens
if (CConfig.PreviewMusicVolume > 100)
CConfig.PreviewMusicVolume = 100;
CConfig.SaveConfig();
ApplyVolume();
}
else if (KeyEvent.ModSHIFT && (KeyEvent.Key == Keys.Subtract || KeyEvent.Key == Keys.PageDown))
{
@@ -324,11 +325,16 @@ namespace Vocaluxe.Screens
if (CConfig.PreviewMusicVolume < 0)
CConfig.PreviewMusicVolume = 0;
CConfig.SaveConfig();
ApplyVolume();
}
return true;
}
public void Apply()
{
}
public override bool HandleMouse(MouseEvent MouseEvent)
{
base.HandleMouse(MouseEvent);
@@ -590,6 +596,11 @@ namespace Vocaluxe.Screens
SongMenus[htSongMenus(SongMenu)].OnHide();
}
public override void ApplyVolume()
{
SongMenus[htSongMenus(SongMenu)].ApplyVolume(CConfig.PreviewMusicVolume);
}
private void StartSong(int SongNr)
{
if ((CSongs.Category >= 0) && (SongNr >= 0))
+1
View File
@@ -235,6 +235,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Screens\CPopupScreenPlayerControl.cs" />
<Compile Include="Screens\CPopupScreenVolumeControl.cs" />
<Compile Include="Screens\CScreenCredits.cs" />
<Compile Include="Screens\CScreenHighscore.cs" />
<Compile Include="Screens\CScreenLoad.cs" />
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<PopupScreenVolumeControl>
<ScreenVersion>1</ScreenVersion>
<StaticBG>
<!--<Skin>: Texture name-->
<Skin>Menu</Skin>
<!--<X>, <Y>, <Z>, <W>, <H>: Static position, width and height-->
<X>1065</X>
<Y>672</Y>
<Z>-2,00</Z>
<W>225</W>
<H>48</H>
<!--<Color>: Static color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</StaticBG>
<Text1>
<!--<X>, <Y>: Text position-->
<X>1067</X>
<Y>680</Y>
<!--<Z>: Text position-->
<Z>-2,00</Z>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>80</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>StaticColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>TextSColor</SColor>
<!--<Align>: Text align horizontal: Left, Center, Right-->
<Align>Left</Align>
<!--<HAlign>: Text align vertical (on downsizing): Top, Center, Bottom-->
<HAlign>Center</HAlign>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Outline</Font>
<!--<Text>: Nothing or translation tag-->
<Text>TR_SCREENPVOLUMECONTROL_VOLUME</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
</Text1>
<SelectSlideVolume>
<!--<Skin>: Texture name-->
<Skin>Invisible</Skin>
<!--<SkinArrowLeft>: Texture name of left arrow-->
<SkinArrowLeft>Minus</SkinArrowLeft>
<!--<SkinArrowRight>: Texture name of right arrow-->
<SkinArrowRight>Plus</SkinArrowRight>
<!--<SkinSelected>: Texture name for selected SelectSlide-->
<SkinSelected>Invisible</SkinSelected>
<!--<SkinArrowLeftSelected>: Texture name of selected left arrow-->
<SkinArrowLeftSelected>Minus</SkinArrowLeftSelected>
<!--<SkinArrowRightSelected>: Texture name of selected right arrow-->
<SkinArrowRightSelected>Plus</SkinArrowRightSelected>
<!--<SkinHighlighted>: Texture name for highlighted SelectSlide-->
<SkinHighlighted>Invisible</SkinHighlighted>
<!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height-->
<X>1090</X>
<Y>680</Y>
<Z>-2,00</Z>
<W>200</W>
<H>50</H>
<!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height-->
<ArrowLeftX>1195</ArrowLeftX>
<ArrowLeftY>682</ArrowLeftY>
<ArrowLeftZ>-2,00</ArrowLeftZ>
<ArrowLeftW>30</ArrowLeftW>
<ArrowLeftH>30</ArrowLeftH>
<!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height-->
<ArrowRightX>1240</ArrowRightX>
<ArrowRightY>682</ArrowRightY>
<ArrowRightZ>-2,00</ArrowRightZ>
<ArrowRightW>30</ArrowRightW>
<ArrowRightH>30</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor>
<!--<ArrowSColor>: Selected arrow color from ColorScheme (high priority)-->
<!--or <ArrowSR>, <ArrowSG>, <ArrowSB>, <ArrowSA> (lower priority)-->
<ArrowSColor>ArrowSColor</ArrowSColor>
<!--<TextColor>: Text color from ColorScheme (high priority)-->
<!--or <TextR>, <TextG>, <TextB>, <TextA> (lower priority)-->
<TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor>
<!--<TextH>: Text height-->
<TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)-->
<TextMaxW>500,00</TextMaxW>
<!--<TextFont>: Text font name-->
<TextFont>Outline</TextFont>
<!--<TextStyle>: Text style: Normal, Italic, Bold, BoldItalic-->
<TextStyle>Bold</TextStyle>
<TextRelativeX>-15,0</TextRelativeX>
<TextRelativeY>-8,0</TextRelativeY>
<!--<NumVisible>: Number of visible elements in the slide-->
<NumVisible>1</NumVisible>
</SelectSlideVolume>
</PopupScreenVolumeControl>
</root>