Added option to start current song/enter current category

Added CSong.IsInCategory
This commit is contained in:
Flamefire committed 2013-02-27 01:03:33 +01:00
1 parent 30841c5758
commit dbb9c6355f
13 files changed
+134 -137

No files matched your search

+2
View File
@@ -32,3 +32,5 @@ Output/Songs
*.ipch *.ipch
*.log *.log
/Output/Playlists/*.xml
+1
View File
@@ -112,6 +112,7 @@
<string name="TR_SCREENSONG_BUTTON_SINGALL">Sing all songs</string> <string name="TR_SCREENSONG_BUTTON_SINGALL">Sing all songs</string>
<string name="TR_SCREENSONG_BUTTON_SINGALLVISIBLE">Sing all visible songs</string> <string name="TR_SCREENSONG_BUTTON_SINGALLVISIBLE">Sing all visible songs</string>
<string name="TR_SCREENSONG_BUTTON_OPENPLAYLIST">Open playlist</string> <string name="TR_SCREENSONG_BUTTON_OPENPLAYLIST">Open playlist</string>
<string name="TR_SCREENSONG_BUTTON_OPEN_SELECTED_ITEM">Select</string>
<string name="TR_SCREENSONG_BUTTON_RANDOMMEDLEY">Sing a random medley</string> <string name="TR_SCREENSONG_BUTTON_RANDOMMEDLEY">Sing a random medley</string>
<string name="TR_SCREENSONG_BUTTON_STARTMEDLEY">Sing medley-songs</string> <string name="TR_SCREENSONG_BUTTON_STARTMEDLEY">Sing medley-songs</string>
<string name="TR_SCREENSONG_NEWPLAYLIST">New Playlist</string> <string name="TR_SCREENSONG_NEWPLAYLIST">New Playlist</string>
+1
View File
@@ -112,6 +112,7 @@
<string name="TR_SCREENSONG_BUTTON_SINGALL">Alle Songs singen</string> <string name="TR_SCREENSONG_BUTTON_SINGALL">Alle Songs singen</string>
<string name="TR_SCREENSONG_BUTTON_SINGALLVISIBLE">Alle sichtbaren Songs singen</string> <string name="TR_SCREENSONG_BUTTON_SINGALLVISIBLE">Alle sichtbaren Songs singen</string>
<string name="TR_SCREENSONG_BUTTON_OPENPLAYLIST">Playlist öffnen</string> <string name="TR_SCREENSONG_BUTTON_OPENPLAYLIST">Playlist öffnen</string>
<string name="TR_SCREENSONG_BUTTON_OPEN_SELECTED_ITEM">Auswählen</string>
<string name="TR_SCREENSONG_BUTTON_RANDOMMEDLEY">Zufälliges Medley singen</string> <string name="TR_SCREENSONG_BUTTON_RANDOMMEDLEY">Zufälliges Medley singen</string>
<string name="TR_SCREENSONG_BUTTON_STARTMEDLEY">Medley-Songs singen</string> <string name="TR_SCREENSONG_BUTTON_STARTMEDLEY">Medley-Songs singen</string>
<string name="TR_SCREENSONG_NEWPLAYLIST">Neue Playlist</string> <string name="TR_SCREENSONG_NEWPLAYLIST">Neue Playlist</string>
+10 -10
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<ScreenSong> <ScreenSong>
<ScreenVersion>4</ScreenVersion> <ScreenVersion>5</ScreenVersion>
<Background1> <Background1>
<!--<Type>: Background type: None, Color, Texture, Video--> <!--<Type>: Background type: None, Color, Texture, Video-->
<Type>Video</Type> <Type>Video</Type>
@@ -954,7 +954,7 @@
<SkinSelected>Button</SkinSelected> <SkinSelected>Button</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height--> <!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>40</X> <X>40</X>
<Y>135</Y> <Y>225</Y>
<Z>-2,11</Z> <Z>-2,11</Z>
<W>360</W> <W>360</W>
<H>40</H> <H>40</H>
@@ -1003,7 +1003,7 @@
<SkinSelected>Button</SkinSelected> <SkinSelected>Button</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height--> <!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>40</X> <X>40</X>
<Y>180</Y> <Y>270</Y>
<Z>-2,11</Z> <Z>-2,11</Z>
<W>360</W> <W>360</W>
<H>40</H> <H>40</H>
@@ -1045,14 +1045,14 @@
<!-- <Space>: Reflection Space of selected button--> <!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button--> <!-- <Height>: Reflection Height of selected button-->
</ButtonOptionsSingAllVisible> </ButtonOptionsSingAllVisible>
<ButtonOptionsOpenPlaylist> <ButtonOptionsOpenSelectedItem>
<!--<Skin>: Texture name--> <!--<Skin>: Texture name-->
<Skin>Button</Skin> <Skin>Button</Skin>
<!--<SkinSelected>: Texture name for selected button--> <!--<SkinSelected>: Texture name for selected button-->
<SkinSelected>Button</SkinSelected> <SkinSelected>Button</SkinSelected>
<!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height--> <!--<X>, <Y>, <Z>, <W>, <H>: Button position, width and height-->
<X>40</X> <X>40</X>
<Y>270</Y> <Y>135</Y>
<Z>-2,11</Z> <Z>-2,11</Z>
<W>360</W> <W>360</W>
<H>40</H> <H>40</H>
@@ -1085,7 +1085,7 @@
<!--<Font>: Text font name--> <!--<Font>: Text font name-->
<Font>Outline</Font> <Font>Outline</Font>
<!--<Text>: Nothing or translation tag--> <!--<Text>: Nothing or translation tag-->
<Text>TR_SCREENSONG_BUTTON_OPENPLAYLIST</Text> <Text>TR_SCREENSONG_BUTTON_OPEN_SELECTED_ITEM</Text>
</Text> </Text>
<!--<Reflection> If exists:--> <!--<Reflection> If exists:-->
<!-- <Space>: Reflection Space--> <!-- <Space>: Reflection Space-->
@@ -1093,7 +1093,7 @@
<!--<SReflection> If exists:--> <!--<SReflection> If exists:-->
<!-- <Space>: Reflection Space of selected button--> <!-- <Space>: Reflection Space of selected button-->
<!-- <Height>: Reflection Height of selected button--> <!-- <Height>: Reflection Height of selected button-->
</ButtonOptionsOpenPlaylist> </ButtonOptionsOpenSelectedItem>
<ButtonOpenOptions> <ButtonOpenOptions>
<!--<Skin>: Texture name--> <!--<Skin>: Texture name-->
<Skin>Invisible</Skin> <Skin>Invisible</Skin>
@@ -1449,19 +1449,19 @@
<SkinHighlighted>SelectSlide</SkinHighlighted> <SkinHighlighted>SelectSlide</SkinHighlighted>
<!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height--> <!--<X>, <Y>, <Z>, <W>, <H>: SelectSlide position, width and height-->
<X>40</X> <X>40</X>
<Y>225</Y> <Y>180</Y>
<Z>-2,11</Z> <Z>-2,11</Z>
<W>360</W> <W>360</W>
<H>40</H> <H>40</H>
<!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height--> <!--<ArrowLeftX>, <ArrowLeftY>, <ArrowLeftZ>, <ArrowLeftW>, <ArrowLeftH>: Left arrow position, width and height-->
<ArrowLeftX>45</ArrowLeftX> <ArrowLeftX>45</ArrowLeftX>
<ArrowLeftY>235</ArrowLeftY> <ArrowLeftY>190</ArrowLeftY>
<ArrowLeftZ>-2,12</ArrowLeftZ> <ArrowLeftZ>-2,12</ArrowLeftZ>
<ArrowLeftW>30</ArrowLeftW> <ArrowLeftW>30</ArrowLeftW>
<ArrowLeftH>30</ArrowLeftH> <ArrowLeftH>30</ArrowLeftH>
<!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height--> <!--<ArrowRightX>, <ArrowRightY>, <ArrowRightZ>, <ArrowRightW>, <ArrowRightH>: Right arrow position, width and height-->
<ArrowRightX>365</ArrowRightX> <ArrowRightX>365</ArrowRightX>
<ArrowRightY>235</ArrowRightY> <ArrowRightY>190</ArrowRightY>
<ArrowRightZ>-2,12</ArrowRightZ> <ArrowRightZ>-2,12</ArrowRightZ>
<ArrowRightW>30</ArrowRightW> <ArrowRightW>30</ArrowRightW>
<ArrowRightH>30</ArrowRightH> <ArrowRightH>30</ArrowRightH>
+2 -2
View File
@@ -503,7 +503,7 @@ namespace Vocaluxe.Base
MouseEvent InputMouseEvent = new MouseEvent(); MouseEvent InputMouseEvent = new MouseEvent();
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing &&
(_CurrentScreen != EScreens.ScreenSong || (_CurrentScreen == EScreens.ScreenSong && CSongs.Category == -1 && CConfig.Tabs ==EOffOn.TR_CONFIG_ON)) (_CurrentScreen != EScreens.ScreenSong || (_CurrentScreen == EScreens.ScreenSong && !CSongs.IsInCategory && CConfig.Tabs ==EOffOn.TR_CONFIG_ON))
&& _CurrentScreen != EScreens.ScreenCredits && !CBackgroundMusic.Disabled; && _CurrentScreen != EScreens.ScreenCredits && !CBackgroundMusic.Disabled;
bool PopupVolumeControlAllowed = _CurrentScreen != EScreens.ScreenCredits && _CurrentScreen != EScreens.ScreenOptionsRecord; bool PopupVolumeControlAllowed = _CurrentScreen != EScreens.ScreenCredits && _CurrentScreen != EScreens.ScreenOptionsRecord;
@@ -555,7 +555,7 @@ namespace Vocaluxe.Base
switch (CGraphics.CurrentScreen) switch (CGraphics.CurrentScreen)
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
if (CSongs.Category != -1) if (CSongs.IsInCategory)
{ {
CConfig.PreviewMusicVolume += Diff; CConfig.PreviewMusicVolume += Diff;
_Screens[(int)_CurrentScreen].ApplyVolume(); _Screens[(int)_CurrentScreen].ApplyVolume();
+5
View File
@@ -139,6 +139,11 @@ namespace Vocaluxe.Base
} }
} }
public static bool IsInCategory
{
get { return _CatIndex >= 0; }
}
/// <summary> /// <summary>
/// Returns the number of song in the category specified with CatIndex /// Returns the number of song in the category specified with CatIndex
/// </summary> /// </summary>
@@ -110,7 +110,7 @@ namespace Vocaluxe.Screens
switch (CGraphics.CurrentScreen) switch (CGraphics.CurrentScreen)
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
if (CSongs.Category != -1) if (CSongs.IsInCategory)
CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5; CConfig.PreviewMusicVolume = SelectSlides[htSelectSlides(SelectSlideVolume)].Selection * 5;
else else
{ {
@@ -136,7 +136,7 @@ namespace Vocaluxe.Screens
switch (CGraphics.CurrentScreen) switch (CGraphics.CurrentScreen)
{ {
case EScreens.ScreenSong: case EScreens.ScreenSong:
if(CSongs.Category != -1) if(CSongs.IsInCategory)
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = (int)(CConfig.PreviewMusicVolume / 5); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = (int)(CConfig.PreviewMusicVolume / 5);
else else
SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5); SelectSlides[htSelectSlides(SelectSlideVolume)].Selection = ((int)CConfig.BackgroundMusicVolume / 5);
+86 -116
View File
@@ -26,7 +26,7 @@ namespace Vocaluxe.Screens
} }
// Version number for theme files. Increment it, if you've changed something on the theme files! // Version number for theme files. Increment it, if you've changed something on the theme files!
const int ScreenVersion = 4; const int ScreenVersion = 5;
private const string TextCategory = "TextCategory"; private const string TextCategory = "TextCategory";
private const string TextSelection = "TextSelection"; private const string TextSelection = "TextSelection";
@@ -42,7 +42,7 @@ namespace Vocaluxe.Screens
private const string ButtonOptionsRandomCategory = "ButtonOptionsRandomCategory"; private const string ButtonOptionsRandomCategory = "ButtonOptionsRandomCategory";
private const string ButtonOptionsSingAll = "ButtonOptionsSingAll"; private const string ButtonOptionsSingAll = "ButtonOptionsSingAll";
private const string ButtonOptionsSingAllVisible = "ButtonOptionsSingAllVisible"; private const string ButtonOptionsSingAllVisible = "ButtonOptionsSingAllVisible";
private const string ButtonOptionsOpenPlaylist = "ButtonOptionsOpenPlaylist"; private const string ButtonOptionsOpenSelectedItem = "ButtonOptionsOpenSelectedItem";
private const string ButtonOptionsRandomMedley = "ButtonOptionsRandomMedley"; private const string ButtonOptionsRandomMedley = "ButtonOptionsRandomMedley";
private const string ButtonOptionsStartMedley = "ButtonOptionsStartMedley"; private const string ButtonOptionsStartMedley = "ButtonOptionsStartMedley";
private const string ButtonStart = "ButtonStart"; private const string ButtonStart = "ButtonStart";
@@ -98,7 +98,7 @@ namespace Vocaluxe.Screens
blist.Add(ButtonOptionsRandomCategory); blist.Add(ButtonOptionsRandomCategory);
blist.Add(ButtonOptionsSingAll); blist.Add(ButtonOptionsSingAll);
blist.Add(ButtonOptionsSingAllVisible); blist.Add(ButtonOptionsSingAllVisible);
blist.Add(ButtonOptionsOpenPlaylist); blist.Add(ButtonOptionsOpenSelectedItem);
blist.Add(ButtonOpenOptions); blist.Add(ButtonOpenOptions);
blist.Add(ButtonStart); blist.Add(ButtonStart);
blist.Add(ButtonOptionsRandomMedley); blist.Add(ButtonOptionsRandomMedley);
@@ -130,22 +130,7 @@ namespace Vocaluxe.Screens
public override void LoadTheme(string XmlPath) public override void LoadTheme(string XmlPath)
{ {
base.LoadTheme(XmlPath); base.LoadTheme(XmlPath);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Visible = false; ToggleSongOptions(ESongOptionsView.None);
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistAdd)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = false;
Buttons[htButtons(ButtonOptionsClose)].Visible = false;
Buttons[htButtons(ButtonOptionsSing)].Visible = false;
Buttons[htButtons(ButtonOptionsPlaylist)].Visible = false;
Buttons[htButtons(ButtonOptionsRandom)].Visible = false;
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = false;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = false;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false;
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false;
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = false;
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = false;
Texts[htTexts(TextOptionsTitle)].Visible = false;
Statics[htStatics(StaticOptionsBG)].Visible = false;
Playlists[htPlaylists(Playlist)].Visible = false; Playlists[htPlaylists(Playlist)].Visible = false;
DragAndDropCover = GetNewStatic(); DragAndDropCover = GetNewStatic();
@@ -165,19 +150,7 @@ namespace Vocaluxe.Screens
if (_PlaylistActive) if (_PlaylistActive)
{ {
if (!KeyEvent.KeyPressed && KeyEvent.Key == Keys.Tab)
{
_PlaylistActive = !_PlaylistActive;
Playlists[htPlaylists(Playlist)].Selected = _PlaylistActive;
SongMenus[htSongMenus(SongMenu)].SetActive(!_PlaylistActive);
return true;
}
Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent); Playlists[htPlaylists(Playlist)].HandleInput(KeyEvent);
if (CPlaylists.NumPlaylists != SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues)
UpdatePlaylistNames();
return true; return true;
} }
@@ -330,7 +303,6 @@ namespace Vocaluxe.Screens
} }
} }
} }
else else
{ {
switch (KeyEvent.Key) switch (KeyEvent.Key)
@@ -352,7 +324,7 @@ namespace Vocaluxe.Screens
} }
else if (Buttons[htButtons(ButtonOptionsRandom)].Selected) else if (Buttons[htButtons(ButtonOptionsRandom)].Selected)
{ {
if (CSongs.Category != -1) if (CSongs.IsInCategory)
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
else else
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
@@ -365,9 +337,12 @@ namespace Vocaluxe.Screens
{ {
StartRandomVisibleSongs(); StartRandomVisibleSongs();
} }
else if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected) else if (Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Selected)
{
_HandleSelectButton();
}
else if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None);
OpenPlaylistAction(); OpenPlaylistAction();
} }
else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected) else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected)
@@ -377,7 +352,7 @@ namespace Vocaluxe.Screens
else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected) else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, CSongs.Category == -1); StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, !CSongs.IsInCategory);
} }
break; break;
@@ -440,8 +415,6 @@ namespace Vocaluxe.Screens
{ {
if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent)) if (Playlists[htPlaylists(Playlist)].HandleMouse(MouseEvent))
{ {
if (CPlaylists.NumPlaylists != SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues)
UpdatePlaylistNames();
return true; return true;
} }
} }
@@ -477,6 +450,8 @@ namespace Vocaluxe.Screens
if (MouseEvent.LD && !_sso.Selection.PartyMode) if (MouseEvent.LD && !_sso.Selection.PartyMode)
{ {
//TODO: Causes Bug if you select a song (e.g. with Select random song) and double click a normal button.
//E.g. clicking to fast on Select random song starts the next random song. is this OK?
if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1) if (CSongs.NumVisibleSongs > 0 && SongMenus[htSongMenus(SongMenu)].GetActualSelection() != -1)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
@@ -499,81 +474,72 @@ namespace Vocaluxe.Screens
{ {
ToggleSongOptions(ESongOptionsView.General); ToggleSongOptions(ESongOptionsView.General);
return true; return true;
} } else if (Buttons[htButtons(ButtonOptionsClose)].Selected)
if (Buttons[htButtons(ButtonOptionsClose)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
return true; return true;
} } else if (Buttons[htButtons(ButtonOptionsSing)].Selected)
if (Buttons[htButtons(ButtonOptionsSing)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong()); StartSong(SongMenus[htSongMenus(SongMenu)].GetSelectedSong());
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected)
if (Buttons[htButtons(ButtonOptionsPlaylist)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
OpenAndAddPlaylistAction(); OpenAndAddPlaylistAction();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsRandom)].Selected)
if (Buttons[htButtons(ButtonOptionsRandom)].Selected)
{ {
if (CSongs.Category != -1) if (CSongs.IsInCategory)
{ {
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
return true; return true;
} }
} }
else if (Buttons[htButtons(ButtonOptionsRandomCategory)].Selected)
if (Buttons[htButtons(ButtonOptionsRandomCategory)].Selected)
{ {
if (CSongs.Category == -1) if (!CSongs.IsInCategory)
{ {
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
return true; return true;
} }
} }
else if (Buttons[htButtons(ButtonOptionsSingAll)].Selected)
if (Buttons[htButtons(ButtonOptionsSingAll)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomAllSongs(); StartRandomAllSongs();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected)
if (Buttons[htButtons(ButtonOptionsSingAllVisible)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomVisibleSongs(); StartRandomVisibleSongs();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Selected)
if (Buttons[htButtons(ButtonOptionsOpenPlaylist)].Selected) {
_HandleSelectButton();
return true;
}
else if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].ValueSelected)
{ {
ToggleSongOptions(ESongOptionsView.None);
OpenPlaylistAction(); OpenPlaylistAction();
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected)
if (Buttons[htButtons(ButtonOptionsRandomMedley)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.Medley); ToggleSongOptions(ESongOptionsView.Medley);
return true; return true;
} }
else if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected)
if (Buttons[htButtons(ButtonOptionsStartMedley)].Selected)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, CSongs.Category == -1); StartRandomMedley(SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Selection + 1, !CSongs.IsInCategory);
return true; return true;
} }
else if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
if (_sso.Selection.RandomOnly && _sso.Selection.NumJokers != null)
{ {
if (Buttons[htButtons(ButtonStart)].Selected) if (Buttons[htButtons(ButtonStart)].Selected)
{ {
@@ -599,9 +565,7 @@ namespace Vocaluxe.Screens
{ {
if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive) if (SongMenus[htSongMenus(SongMenu)].GetSelectedSong() != -1 && !_SongOptionsActive)
{ {
if (!_sso.Selection.PartyMode) ToggleSongOptions(ESongOptionsView.Song);
ToggleSongOptions(ESongOptionsView.Song);
return true; return true;
} }
else else
@@ -635,6 +599,19 @@ namespace Vocaluxe.Screens
return true; return true;
} }
private void _HandleSelectButton()
{
if (CSongs.IsInCategory) {
if(!_sso.Selection.PartyMode)
ToggleSongOptions(ESongOptionsView.Song);
}
else if(_sso.Selection.CategoryChangeAllowed)
{
ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].EnterCurrentCategory();
}
}
public override void OnShow() public override void OnShow()
{ {
base.OnShow(); base.OnShow();
@@ -661,7 +638,6 @@ namespace Vocaluxe.Screens
if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1) if (Playlists[htPlaylists(Playlist)].ActivePlaylistID != -1)
Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID); Playlists[htPlaylists(Playlist)].LoadPlaylist(Playlists[htPlaylists(Playlist)].ActivePlaylistID);
UpdatePlaylistNames();
DragAndDropActive = false; DragAndDropActive = false;
Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1; Playlists[htPlaylists(Playlist)].DragAndDropSongID = -1;
@@ -686,7 +662,7 @@ namespace Vocaluxe.Screens
{ {
Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title; Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
} }
else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length) else if (!CSongs.IsInCategory && song >= 0 && song < CSongs.Categories.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name;
} }
@@ -750,7 +726,7 @@ namespace Vocaluxe.Screens
private void UpdatePartyModeOptions() private void UpdatePartyModeOptions()
{ {
if (CSongs.Category == -1) if (!CSongs.IsInCategory)
SelectedSongID = -1; SelectedSongID = -1;
if (SelectedCategoryIndex != CSongs.Category) if (SelectedCategoryIndex != CSongs.Category)
@@ -1022,7 +998,7 @@ namespace Vocaluxe.Screens
private bool SelectNextRandomSong() private bool SelectNextRandomSong()
{ {
if (CSongs.Category != -1) if (CSongs.IsInCategory)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong()); SongMenus[htSongMenus(SongMenu)].SetSelectedSong(CSongs.GetRandomSong());
@@ -1033,7 +1009,7 @@ namespace Vocaluxe.Screens
private bool SelectNextRandomCategory() private bool SelectNextRandomCategory()
{ {
if (CSongs.Category == -1) if (!CSongs.IsInCategory)
{ {
ToggleSongOptions(ESongOptionsView.None); ToggleSongOptions(ESongOptionsView.None);
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory()); SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(CSongs.GetRandomCategory());
@@ -1045,23 +1021,10 @@ namespace Vocaluxe.Screens
private void JumpTo(char Letter) private void JumpTo(char Letter)
{ {
int start = 0; int start = 0;
if (CSongs.Category < 0) int curSelected = SongMenus[htSongMenus(SongMenu)].GetActualSelection();
{ if (CSongs.IsInCategory)
int curSelected = SongMenus[htSongMenus(SongMenu)].GetSelectedCategory();
CCategory[] Categories = CSongs.Categories;
int ct = Categories.Length;
if (curSelected >= 0 && curSelected < ct - 1 && Categories[curSelected].Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase))
start = curSelected + 1;
int visibleID = Array.FindIndex<CCategory>(Categories, start, ct - start, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CCategory>(Categories, 0, start - 1, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(visibleID);
}
else
{ {
//TODO: Check and use sorting method //TODO: Check and use sorting method
int curSelected = SongMenus[htSongMenus(SongMenu)].GetSelectedSong();
CSong[] Songs = CSongs.VisibleSongs; CSong[] Songs = CSongs.VisibleSongs;
int ct = Songs.Length; int ct = Songs.Length;
if (curSelected >= 0 && curSelected < ct - 1) if (curSelected >= 0 && curSelected < ct - 1)
@@ -1071,12 +1034,24 @@ namespace Vocaluxe.Screens
start = curSelected + 1; start = curSelected + 1;
} }
int visibleID = Array.FindIndex<CSong>(Songs, start, ct - start, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); int visibleID = Array.FindIndex<CSong>(Songs, start, ct - start, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if(visibleID < 0 && start > 1) if (visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CSong>(Songs, 0, start - 1, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); visibleID = Array.FindIndex<CSong>(Songs, 0, start - 1, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1) if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedSong(visibleID); SongMenus[htSongMenus(SongMenu)].SetSelectedSong(visibleID);
} }
else
{
CCategory[] Categories = CSongs.Categories;
int ct = Categories.Length;
if (curSelected >= 0 && curSelected < ct - 1 && Categories[curSelected].Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase))
start = curSelected + 1;
int visibleID = Array.FindIndex<CCategory>(Categories, start, ct - start, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID < 0 && start > 1)
visibleID = Array.FindIndex<CCategory>(Categories, 0, start - 1, element => element.Name.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase));
if (visibleID > -1)
SongMenus[htSongMenus(SongMenu)].SetSelectedCategory(visibleID);
}
} }
private void ApplyNewSearchFilter(string NewFilterString) private void ApplyNewSearchFilter(string NewFilterString)
@@ -1130,7 +1105,7 @@ namespace Vocaluxe.Screens
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = false; Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = false;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = false; Buttons[htButtons(ButtonOptionsSingAll)].Visible = false;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false; Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = false;
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Visible = false;
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = false; Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = false;
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = false; Buttons[htButtons(ButtonOptionsStartMedley)].Visible = false;
Texts[htTexts(TextOptionsTitle)].Visible = false; Texts[htTexts(TextOptionsTitle)].Visible = false;
@@ -1141,6 +1116,9 @@ namespace Vocaluxe.Screens
if (_SongOptionsActive) if (_SongOptionsActive)
{ {
//Has to be done here otherwhise changed playlist names will not appear until OnShow is called!
UpdatePlaylistNames();
Texts[htTexts(TextOptionsTitle)].Visible = true; Texts[htTexts(TextOptionsTitle)].Visible = true;
Buttons[htButtons(ButtonOptionsClose)].Visible = true; Buttons[htButtons(ButtonOptionsClose)].Visible = true;
Statics[htStatics(StaticOptionsBG)].Visible = true; Statics[htStatics(StaticOptionsBG)].Visible = true;
@@ -1162,18 +1140,18 @@ namespace Vocaluxe.Screens
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]); SetInteractionToButton(Buttons[htButtons(ButtonOptionsSing)]);
_AvailableGameModes.Clear(); _AvailableGameModes.Clear();
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear(); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].Clear();
if (!CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet) if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET);
}
else
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL)); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_NORMAL));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL); _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_NORMAL);
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG)); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_SHORTSONG));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG); _AvailableGameModes.Add(EGameMode.TR_GAMEMODE_SHORTSONG);
} }
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].IsDuet)
{
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_DUET));
_AvailableGameModes.Add(EGameMode.TR_GAMEMODE_DUET);
}
if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None) if (CSongs.VisibleSongs[SongMenus[htSongMenus(SongMenu)].GetSelectedSong()].Medley.Source != EMedleySource.None)
{ {
SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY)); SelectSlides[htSelectSlides(SelectSlideOptionsMode)].AddValue(Enum.GetName(typeof(EGameMode), EGameMode.TR_GAMEMODE_MEDLEY));
@@ -1194,28 +1172,20 @@ namespace Vocaluxe.Screens
private void _ShowSongOptionsGeneral() private void _ShowSongOptionsGeneral()
{ {
Buttons[htButtons(ButtonOptionsRandom)].Visible = CSongs.Category != -1; if (CSongs.IsInCategory)
Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = CSongs.Category == -1;
Buttons[htButtons(ButtonOptionsSingAll)].Visible = true;
Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = CSongs.Category != -1;
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0)
{ {
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = true; Buttons[htButtons(ButtonOptionsRandom)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true; Buttons[htButtons(ButtonOptionsSingAllVisible)].Visible = true;
SetInteractionToButton(Buttons[htButtons(ButtonOptionsOpenPlaylist)]);
} }
else else
{ Buttons[htButtons(ButtonOptionsRandomCategory)].Visible = true;
Buttons[htButtons(ButtonOptionsOpenPlaylist)].Visible = false; Buttons[htButtons(ButtonOptionsSingAll)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = false;
if (Buttons[htButtons(ButtonOptionsRandom)].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]);
else
SetInteractionToButton(Buttons[htButtons(ButtonOptionsSingAll)]);
}
Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = true; Buttons[htButtons(ButtonOptionsRandomMedley)].Visible = true;
Buttons[htButtons(ButtonOptionsOpenSelectedItem)].Visible = true;
if (SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].NumValues > 0)
SelectSlides[htSelectSlides(SelectSlideOptionsPlaylistOpen)].Visible = true;
if (Buttons[htButtons(ButtonOptionsRandom)].Visible) if (Buttons[htButtons(ButtonOptionsRandom)].Visible)
SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]); SetInteractionToButton(Buttons[htButtons(ButtonOptionsRandom)]);
else else
@@ -1227,7 +1197,7 @@ namespace Vocaluxe.Screens
Buttons[htButtons(ButtonOptionsStartMedley)].Visible = true; Buttons[htButtons(ButtonOptionsStartMedley)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = true; SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Visible = true;
SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Clear(); SelectSlides[htSelectSlides(SelectSlideOptionsNumMedleySongs)].Clear();
if (CSongs.Category != -1) if (CSongs.IsInCategory)
{ {
for (int i = 1; i <= CSongs.VisibleSongs.Length; i++) for (int i = 1; i <= CSongs.VisibleSongs.Length; i++)
{ {
+5
View File
@@ -79,6 +79,11 @@ namespace Vocaluxe.Menu
} }
} }
} }
public bool ValueSelected
{
get { return _Selected && !_ArrowLeftSelected && !_ArrowRightSelected; }
}
public bool Visible = true; public bool Visible = true;
public bool Highlighted = false; public bool Highlighted = false;
+5
View File
@@ -115,6 +115,11 @@ namespace Vocaluxe.Menu.SongMenu
_SongMenu.SetSelectedCategory(CategoryNr); _SongMenu.SetSelectedCategory(CategoryNr);
} }
public bool EnterCurrentCategory()
{
return _SongMenu.EnterCurrentCategory();
}
public int GetActualSelection() public int GetActualSelection()
{ {
return _SongMenu.GetActualSelection(); return _SongMenu.GetActualSelection();
@@ -588,6 +588,16 @@ namespace Vocaluxe.Menu.SongMenu
LoadTextures(); LoadTextures();
} }
public bool EnterCurrentCategory()
{
if (!_Initialized)
return false;
if (CBase.Songs.GetCurrentCategoryIndex() >= 0 || _PreviewSelected < 0 || _PreviewSelected >= CBase.Songs.GetNumCategories())
return false;
EnterCategory(_PreviewSelected);
return true;
}
protected virtual void EnterCategory(int Category) protected virtual void EnterCategory(int Category)
{ {
if (!_Initialized) if (!_Initialized)
@@ -605,8 +615,8 @@ namespace Vocaluxe.Menu.SongMenu
if (!_Initialized) if (!_Initialized)
return; return;
if (CBase.Songs.GetCurrentCategoryIndex() != -1) if (CBase.Songs.GetCurrentCategoryIndex() == -1)
Reset(); return;
Reset(); Reset();
CBase.Songs.SetCategory(-1); CBase.Songs.SetCategory(-1);
@@ -163,11 +163,7 @@ namespace Vocaluxe.Menu.SongMenu
{ {
base.HandleInput(ref KeyEvent, SongOptions); base.HandleInput(ref KeyEvent, SongOptions);
if (KeyEvent.KeyPressed) if (!KeyEvent.KeyPressed)
{
//
}
else
{ {
if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down || if (!(KeyEvent.Key == Keys.Left || KeyEvent.Key == Keys.Right || KeyEvent.Key == Keys.Up || KeyEvent.Key == Keys.Down ||
KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter || KeyEvent.Key == Keys.Escape || KeyEvent.Key == Keys.Back || KeyEvent.Key == Keys.Enter ||
+2
View File
@@ -29,6 +29,8 @@ namespace Vocaluxe.Menu.SongMenu
void SetSelectedCategory(int CategoryNr); void SetSelectedCategory(int CategoryNr);
int GetActualSelection(); int GetActualSelection();
bool EnterCurrentCategory();
bool IsSelected(); bool IsSelected();
void SetSelected(bool Selected); void SetSelected(bool Selected);