Merge remote-tracking branch 'xDarcice/jukebox' into popup-control

This commit is contained in:
Alexander Eckart committed 2012-03-02 18:05:49 +01:00
commit e66e010f60
18 files changed
+295 -17

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,16 +18,16 @@
<!-- <Space>: Reflection Space--> <!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height--> <!-- <Height>: Reflection Height-->
</StaticBG> </StaticBG>
<ButtonNext> <ButtonPrevious>
<!--<Skin>: Texture name--> <!--<Skin>: Texture name-->
<Skin>Button</Skin> <Skin>PreviousIcon</Skin>
<!--<SkinSelected>: Texture name for selected button--> <!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>Button</SkinSelected> <SkinSelected>PreviousIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height--> <!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>145</X> <X>50</X>
<Y>2</Y> <Y>0</Y>
<Z>0,00</Z> <Z>0,00</Z>
<W>150</W> <W>50</W>
<H>50</H> <H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)--> <!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)--> <!--or <R>, <G>, <B>, <A> (lower priority)-->
@@ -56,7 +56,148 @@
<!--<Font>: Text font name--> <!--<Font>: Text font name-->
<Font>Normal</Font> <Font>Normal</Font>
<!--<Text>: Text or translation tag--> <!--<Text>: Text or translation tag-->
<Text>TR_SCREENMAIN_BUTTON_SING</Text> <Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonPrevious>
<ButtonPlay>
<!--<Skin>: Texture name-->
<Skin>PlayIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>PlayIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>125</X>
<Y>5</Y>
<Z>0,00</Z>
<W>40</W>
<H>40</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>2</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonPlay>
<ButtonPause>
<!--<Skin>: Texture name-->
<Skin>PauseIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>PauseIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>125</X>
<Y>5</Y>
<Z>0,00</Z>
<W>40</W>
<H>40</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>75</X>
<Y>2</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonPause>
<ButtonNext>
<!--<Skin>: Texture name-->
<Skin>NextIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>NextIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>190</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>190</X>
<Y>25</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text> </Text>
<!--<Reflection> If exists:--> <!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space--> <!-- <Space>: Reflection Space-->
@@ -65,5 +206,52 @@
<!-- <Space>: Reflection Space of selected button--> <!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button--> <!-- <Height>: Reflection Height of selected button-->
</ButtonNext> </ButtonNext>
<ButtonRepeat>
<!--<Skin>: Texture name-->
<Skin>RepeatIcon</Skin>
<!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>RepeatIcon</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>265</X>
<Y>0</Y>
<Z>0,00</Z>
<W>50</W>
<H>50</H>
<!--<Color>: Button color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonColor</Color>
<!--<SColor>: Selected button color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonSColor</SColor>
<Text>
<!--<X>, <Y>: Text position-->
<X>265</X>
<Y>25</Y>
<!--<H>: Text height-->
<H>32</H>
<!--<MaxW>: Maximum text width (if exists)-->
<MaxW>142</MaxW>
<!--<Color>: Text color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>ButtonTextColor</Color>
<!--<SColor>: Selected Text color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>ButtonTextSColor</SColor>
<!--<Align>: Text align: Left, Center, Right-->
<Align>Center</Align>
<!--<Style>: Text style: Normal, Italic, Bold, BoldItalic-->
<Style>Bold</Style>
<!--<Font>: Text font name-->
<Font>Normal</Font>
<!--<Text>: Text or translation tag-->
<Text></Text>
</Text>
<!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space-->
<!-- <Height>: Reflection Height-->
<!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button-->
</ButtonRepeat>
</PopupScreenPlayerControl> </PopupScreenPlayerControl>
</root> </root>
+5
View File
@@ -216,6 +216,11 @@
<DuetIcon>DuetIcon.png</DuetIcon> <DuetIcon>DuetIcon.png</DuetIcon>
<VideoIcon>VideoIcon.png</VideoIcon> <VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible> <Invisible>Invisible.png</Invisible>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins> </Skins>
<Videos> <Videos>
<BG_Video>[Blue]BG_Video.mp4</BG_Video> <BG_Video>[Blue]BG_Video.mp4</BG_Video>
+5
View File
@@ -216,6 +216,11 @@
<DuetIcon>DuetIcon.png</DuetIcon> <DuetIcon>DuetIcon.png</DuetIcon>
<VideoIcon>VideoIcon.png</VideoIcon> <VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible> <Invisible>Invisible.png</Invisible>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins> </Skins>
<Videos> <Videos>
<BG_Video>[Green]BG_Video.mp4</BG_Video> <BG_Video>[Green]BG_Video.mp4</BG_Video>
+5
View File
@@ -216,6 +216,11 @@
<DuetIcon>DuetIcon.png</DuetIcon> <DuetIcon>DuetIcon.png</DuetIcon>
<VideoIcon>VideoIcon.png</VideoIcon> <VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible> <Invisible>Invisible.png</Invisible>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins> </Skins>
<Videos> <Videos>
<BG_Video>[Red]BG_Video.mp4</BG_Video> <BG_Video>[Red]BG_Video.mp4</BG_Video>
+5
View File
@@ -216,6 +216,11 @@
<DuetIcon>DuetIcon.png</DuetIcon> <DuetIcon>DuetIcon.png</DuetIcon>
<VideoIcon>VideoIcon.png</VideoIcon> <VideoIcon>VideoIcon.png</VideoIcon>
<Invisible>Invisible.png</Invisible> <Invisible>Invisible.png</Invisible>
<PreviousIcon>PreviousIcon.png</PreviousIcon>
<NextIcon>NextIcon.png</NextIcon>
<PlayIcon>PlayIcon.png</PlayIcon>
<PauseIcon>PauseIcon.png</PauseIcon>
<RepeatIcon>RepeatIcon.png</RepeatIcon>
</Skins> </Skins>
<Videos> <Videos>
<BG_Video>[Yellow]BG_Video.mp4</BG_Video> <BG_Video>[Yellow]BG_Video.mp4</BG_Video>
+46 -5
View File
@@ -13,11 +13,13 @@ namespace Vocaluxe.Base
{ {
private static CHelper Helper = new CHelper(); private static CHelper Helper = new CHelper();
private static int _CurrentMusicStream = -1; private static int _CurrentMusicStream = -1;
private static int _PreviousMusicIndex = 0;
private static string _CurrentMusicFilePath = String.Empty; private static string _CurrentMusicFilePath = String.Empty;
private static List<string> _AllFileNames = new List<string>(); private static List<string> _AllFileNames = new List<string>();
private static List<string> _NotPlayedFileNames = new List<string>(); private static List<string> _NotPlayedFileNames = new List<string>();
private static List<string> _BGMusicFileNames = new List<string>(); private static List<string> _BGMusicFileNames = new List<string>();
private static List<string> _PreviousFileNames = new List<string>();
private static bool _OwnMusicAdded; private static bool _OwnMusicAdded;
private static bool _BackgroundMusicAdded; private static bool _BackgroundMusicAdded;
@@ -83,13 +85,25 @@ namespace Vocaluxe.Base
{ {
if (_AllFileNames.Count > 0) if (_AllFileNames.Count > 0)
{ {
Stop(); if (_PreviousMusicIndex == _PreviousFileNames.Count - 1 || _PreviousFileNames.Count == 0) //We are not currently in the previous list
{
Stop();
if (_NotPlayedFileNames.Count == 0)
_NotPlayedFileNames.AddRange(_AllFileNames);
if (_NotPlayedFileNames.Count == 0) _CurrentMusicFilePath = _NotPlayedFileNames[CGame.Rand.Next(_NotPlayedFileNames.Count)];
_NotPlayedFileNames.AddRange(_AllFileNames); _NotPlayedFileNames.Remove(_CurrentMusicFilePath);
_CurrentMusicFilePath = _NotPlayedFileNames[CGame.Rand.Next(_NotPlayedFileNames.Count)]; _PreviousFileNames.Add(_CurrentMusicFilePath);
_NotPlayedFileNames.Remove(_CurrentMusicFilePath); _PreviousMusicIndex = _PreviousFileNames.Count - 1;
}
else if(_PreviousFileNames.Count > 0) //We are in the previous list
{
Stop();
_PreviousMusicIndex++;
_CurrentMusicFilePath = _PreviousFileNames[_PreviousMusicIndex];
}
_CurrentMusicStream = CSound.Load(_CurrentMusicFilePath); _CurrentMusicStream = CSound.Load(_CurrentMusicFilePath);
CSound.SetStreamVolume(_CurrentMusicStream, 0f); CSound.SetStreamVolume(_CurrentMusicStream, 0f);
@@ -99,6 +113,33 @@ namespace Vocaluxe.Base
Stop(); Stop();
} }
public static void Previous()
{
if (_PreviousFileNames.Count > 0 || _PreviousMusicIndex >= 0)
{
Stop();
_PreviousMusicIndex--;
if (_PreviousMusicIndex < 0)
_PreviousMusicIndex = 0; //No previous songs left, so play the first
_CurrentMusicFilePath = _PreviousFileNames[_PreviousMusicIndex];
_CurrentMusicStream = CSound.Load(_CurrentMusicFilePath);
CSound.SetStreamVolume(_CurrentMusicStream, 0f);
Play();
}
}
public static void Repeat()
{
if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1)
{
CSound.SetPosition(_CurrentMusicStream, 0);
}
}
public static void ApplyVolume() public static void ApplyVolume()
{ {
CSound.SetStreamVolume(_CurrentMusicStream, CConfig.BackgroundMusicVolume); CSound.SetStreamVolume(_CurrentMusicStream, CConfig.BackgroundMusicVolume);
+4 -2
View File
@@ -481,7 +481,7 @@ namespace Vocaluxe.Menu
{ {
bool handled = false; bool handled = false;
if (_CurrentPopupScreen != EPopupScreens.NoPopup) if (_CurrentPopupScreen != EPopupScreens.NoPopup)
handled = !_PopupScreens[(int)_CurrentPopupScreen].HandleInput(KeyEvent); handled = _PopupScreens[(int)_CurrentPopupScreen].HandleInput(KeyEvent);
if (!handled) if (!handled)
Resume &= _Screens[(int)_CurrentScreen].HandleInput(KeyEvent); Resume &= _Screens[(int)_CurrentScreen].HandleInput(KeyEvent);
@@ -511,7 +511,7 @@ namespace Vocaluxe.Menu
bool handled = false; bool handled = false;
if (_CurrentPopupScreen != EPopupScreens.NoPopup) if (_CurrentPopupScreen != EPopupScreens.NoPopup)
handled = !_PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent); handled = _PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
if (!handled && !_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB)) if (!handled && !_Fading && (_Cursor.IsActive || MouseEvent.LB || MouseEvent.RB))
Resume &= _Screens[(int)_CurrentScreen].HandleMouse(MouseEvent); Resume &= _Screens[(int)_CurrentScreen].HandleMouse(MouseEvent);
@@ -563,6 +563,8 @@ namespace Vocaluxe.Menu
private static bool Update() private static bool Update()
{ {
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
_PopupScreens[(int)_CurrentPopupScreen].UpdateGame();
return _Screens[(int)_CurrentScreen].UpdateGame(); return _Screens[(int)_CurrentScreen].UpdateGame();
} }
+30 -3
View File
@@ -16,8 +16,13 @@ namespace Vocaluxe.Screens
const int ScreenVersion = 1; const int ScreenVersion = 1;
private const string StaticBG = "StaticBG"; private const string StaticBG = "StaticBG";
private const string Cover = "Cover";
private const string ButtonPrevious = "ButtonPrevious";
private const string ButtonPlay = "ButtonPlay";
private const string ButtonPause = "ButtonPause";
private const string ButtonNext = "ButtonNext"; private const string ButtonNext = "ButtonNext";
private const string ButtonRepeat = "ButtonRepeat";
public CPopupScreenPlayerControl() public CPopupScreenPlayerControl()
{ {
@@ -31,10 +36,14 @@ namespace Vocaluxe.Screens
_ThemeName = "PopupScreenPlayerControl"; _ThemeName = "PopupScreenPlayerControl";
_ScreenVersion = ScreenVersion; _ScreenVersion = ScreenVersion;
_ThemeStatics = new string[] { StaticBG }; _ThemeStatics = new string[] { StaticBG, Cover };
List<string> buttons = new List<string>(); List<string> buttons = new List<string>();
buttons.Add(ButtonPlay);
buttons.Add(ButtonPause);
buttons.Add(ButtonPrevious);
buttons.Add(ButtonNext); buttons.Add(ButtonNext);
buttons.Add(ButtonRepeat);
_ThemeButtons = buttons.ToArray(); _ThemeButtons = buttons.ToArray();
} }
@@ -47,6 +56,7 @@ namespace Vocaluxe.Screens
public override bool HandleInput(KeyEvent KeyEvent) public override bool HandleInput(KeyEvent KeyEvent)
{ {
base.HandleInput(KeyEvent);
if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode)) if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))
{ {
@@ -63,6 +73,14 @@ namespace Vocaluxe.Screens
case Keys.Enter: case Keys.Enter:
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[htButtons(ButtonNext)].Selected)
CBackgroundMusic.Next(); CBackgroundMusic.Next();
if (Buttons[htButtons(ButtonPrevious)].Selected)
CBackgroundMusic.Previous();
if (Buttons[htButtons(ButtonPlay)].Selected)
CBackgroundMusic.Play();
if (Buttons[htButtons(ButtonPause)].Selected)
CBackgroundMusic.Pause();
if (Buttons[htButtons(ButtonRepeat)].Selected)
CBackgroundMusic.Repeat();
break; break;
} }
} }
@@ -72,11 +90,19 @@ namespace Vocaluxe.Screens
public override bool HandleMouse(MouseEvent MouseEvent) public override bool HandleMouse(MouseEvent MouseEvent)
{ {
base.HandleMouse(MouseEvent);
if (MouseEvent.LB && IsMouseOver(MouseEvent)) if (MouseEvent.LB && IsMouseOver(MouseEvent))
{ {
if (Buttons[htButtons(ButtonNext)].Selected) if (Buttons[htButtons(ButtonNext)].Selected)
CBackgroundMusic.Next(); CBackgroundMusic.Next();
if (Buttons[htButtons(ButtonPrevious)].Selected)
CBackgroundMusic.Previous();
if (Buttons[htButtons(ButtonPlay)].Selected)
CBackgroundMusic.Play();
if (Buttons[htButtons(ButtonPause)].Selected)
CBackgroundMusic.Pause();
if (Buttons[htButtons(ButtonRepeat)].Selected)
CBackgroundMusic.Repeat();
} else if (MouseEvent.LB) } else if (MouseEvent.LB)
{ {
CGraphics.HidePopup(EPopupScreens.PopupPlayerControl); CGraphics.HidePopup(EPopupScreens.PopupPlayerControl);
@@ -91,7 +117,8 @@ namespace Vocaluxe.Screens
public override bool UpdateGame() public override bool UpdateGame()
{ {
Buttons[htButtons(ButtonPause)].Visible = CBackgroundMusic.IsPlaying();
Buttons[htButtons(ButtonPlay)].Visible = !CBackgroundMusic.IsPlaying();
return true; return true;
} }