From 134d0b5ab2e934f580263fbd31402168d04c0449 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 26 Jan 2020 11:06:41 +0100 Subject: [PATCH 1/6] Change sort options on the song screen (key shortcuts) CTRL+# (0-9) to switch sorting. CTRL+T to enable/disable category view. --- Vocaluxe/Screens/CScreenSong.cs | 82 ++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index cf0e1183..ec94a340 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; +using System.Timers; using System.Windows.Forms; using Vocaluxe.Base; using VocaluxeLib; @@ -42,7 +43,7 @@ namespace Vocaluxe.Screens // Version number for theme files. Increment it, if you've changed something on the theme files! protected override int _ScreenVersion { - get { return 7; } + get { return 8; } } private const string _TextCategory = "TextCategory"; @@ -53,6 +54,7 @@ namespace Vocaluxe.Screens private const string _TextHelpBarSearch = "TextHelpBarSearch"; private const string _TextHelpBarParty = "TextHelpBarParty"; private const string _TextOptionsTitle = "TextOptionsTitle"; + private const string _TextShortInfoTop = "TextShortInfoTop"; private const string _ButtonOpenOptions = "ButtonOpenOptions"; private const string _ButtonOptionsSing = "ButtonOptionsSing"; @@ -74,6 +76,7 @@ namespace Vocaluxe.Screens private const string _StaticSearchBar = "StaticSearchBar"; private const string _StaticOptionsBG = "StaticOptionsBG"; + private const string _StaticShortInfoTop = "StaticShortInfoTop"; private const string _SongMenuName = "SongMenu"; private const string _PlaylistName = "Playlist"; @@ -99,6 +102,8 @@ namespace Vocaluxe.Screens private ISongMenu _SongMenu; private CPlaylist _Playlist; + private System.Timers.Timer _TimerShortInfoText; + public override EMusicType CurrentMusicType { get { return CSongs.IsInCategory ? EMusicType.Preview : EMusicType.Background; } @@ -144,8 +149,9 @@ namespace Vocaluxe.Screens tlist.Add(_TextHelpBarSearch); tlist.Add(_TextHelpBarParty); tlist.Add(_TextOptionsTitle); + tlist.Add(_TextShortInfoTop); - _ThemeStatics = new string[] {_StaticSearchBar, _StaticOptionsBG}; + _ThemeStatics = new string[] {_StaticSearchBar, _StaticOptionsBG, _StaticShortInfoTop}; _ThemeTexts = tlist.ToArray(); _ThemeButtons = blist.ToArray(); _ThemeSelectSlides = new string[] {_SelectSlideOptionsMode, _SelectSlideOptionsPlaylistAdd, _SelectSlideOptionsPlaylistOpen, _SelectSlideOptionsNumMedleySongs}; @@ -153,6 +159,10 @@ namespace Vocaluxe.Screens _ThemePlaylists = new string[] {_PlaylistName}; _DragAndDropCover = GetNewStatic(); + + _TimerShortInfoText = new System.Timers.Timer(5000); + _TimerShortInfoText.AutoReset = false; + _TimerShortInfoText.Elapsed += OnTimedEventShortInfoText; } protected override void _OnSongMenuChanged() @@ -303,6 +313,35 @@ namespace Vocaluxe.Screens if (keyEvent.Mod == EModifier.Ctrl && CSongs.NumSongsVisible > 0 && !_Sso.Selection.PartyMode) _StartMedleySong(_SongMenu.GetPreviewSongNr()); break; + + case Keys.T: + if (keyEvent.Mod == EModifier.Ctrl && !_Sso.Selection.PartyMode) + { + _ToggleTabs(); + } + break; + + case Keys.D0: + case Keys.D1: + case Keys.D2: + case Keys.D3: + case Keys.D4: + case Keys.D5: + case Keys.D6: + case Keys.D7: + case Keys.D8: + case Keys.D9: + if (keyEvent.Mod == EModifier.Ctrl && !_Sso.Selection.PartyMode) + { + int tempSortNr = -1; + int.TryParse(keyEvent.Key.ToString().Substring(1), out tempSortNr); + + if (tempSortNr == 0) + tempSortNr = 10; + + _ToggleSort(tempSortNr); + } + break; } if (!_SearchActive) { @@ -689,6 +728,9 @@ namespace Vocaluxe.Screens _DragAndDropCover.Visible = false; _Playlist.DragAndDropSongID = -1; + _Statics[_StaticShortInfoTop].Visible = false; + _Texts[_TextShortInfoTop].Visible = false; + UpdateGame(); } @@ -864,6 +906,42 @@ namespace Vocaluxe.Screens } } + private void _ToggleSort(int sortNr) + { + CSongs.Sorter.SongSorting = (ESongSorting)sortNr; + CConfig.Config.Game.SongSorting = CSongs.Sorter.SongSorting; + _Sso.Sorting.SongSorting = CSongs.Sorter.SongSorting; + _SongMenu.Update(_Sso); + _SongMenu.OnShow(); + + _Texts[_TextShortInfoTop].Text = CBase.Language.Translate("TR_SCREENSONG_SORTING").Replace("%s", CBase.Language.Translate(_Sso.Sorting.SongSorting.ToString())); + _Statics[_StaticShortInfoTop].Visible = true; + _Texts[_TextShortInfoTop].Visible = true; + _TimerShortInfoText.Stop(); + _TimerShortInfoText.Enabled = true; + } + + private void OnTimedEventShortInfoText(Object source, ElapsedEventArgs e) + { + _Statics[_StaticShortInfoTop].Visible = false; + _Texts[_TextShortInfoTop].Visible = false; + } + + private void _ToggleTabs() + { + EOffOn tmpStatus = CSongs.Categorizer.Tabs; + + if (tmpStatus == EOffOn.TR_CONFIG_ON) + CSongs.Categorizer.Tabs = EOffOn.TR_CONFIG_OFF; + else + CSongs.Categorizer.Tabs = EOffOn.TR_CONFIG_ON; + + CConfig.Config.Game.Tabs = CSongs.Categorizer.Tabs; + _Sso.Sorting.Tabs = CSongs.Categorizer.Tabs; + _SongMenu.Update(_Sso); + _SongMenu.OnShow(); + } + private void _StartSong(int songNr) { if (CSongs.IsInCategory && (songNr >= 0)) From b28614f58bcf4c57455593ea420d11d5b3a93b9e Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 26 Jan 2020 11:08:37 +0100 Subject: [PATCH 2/6] Change song sorting on song screen --- Output/Themes/Genius/Screens/ScreenSong.xml | 27 ++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Output/Themes/Genius/Screens/ScreenSong.xml b/Output/Themes/Genius/Screens/ScreenSong.xml index f7d55aaf..e8c5ed6f 100644 --- a/Output/Themes/Genius/Screens/ScreenSong.xml +++ b/Output/Themes/Genius/Screens/ScreenSong.xml @@ -2,7 +2,7 @@ ScreenSong - 7 + 8 @@ -70,8 +70,33 @@ -2.1 + + + + + 490 + 0 + 300 + 30 + -0.75 + + + + 640 + 2 + -1 + 25 + 280 + + + Center + Center + + Outline + TR_SCREENSONG_SORTING + 950 65 From 2019dd64e630ca158e8dc6b26c475125aaecaf99 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 26 Jan 2020 11:09:46 +0100 Subject: [PATCH 3/6] Add text for song sorting on song screen --- Output/Languages/English.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index a67b1462..c9c92bf7 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -152,9 +152,10 @@ (%v songs) (%v song) %a - %t - A-Z = Jump to the letter • F3 = Search • CTRL+R = Random selection • CTRL+S = Start medley • CTRL+A = Start all random • CTRL+V = Start visible random • Space = Open song options • ESC = Back to main menu + A-Z = Jump to the letter • F3 = Search • CTRL+R = Random selection • CTRL+S = Start medley • CTRL+# = Change song sorting • CTRL+T = Enable/Disable categories • Space = Open song options • ESC = Back to main menu A-Z = Search artist and title, prefixes for the search → a: = artist • t: = title • c: = creator • e: = edition • g: = genre • y: = year (e.g. 1999 or 1980-1989) • l: = language • al: = album • fi: = file name • fo: = folder name 1-6 = Press your team number to use a random song joker + Sorting: %s Pause Stop singing Continue From 51784a1a37b497c3d034d49b5a820696b0a1e6af Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 26 Jan 2020 11:10:55 +0100 Subject: [PATCH 4/6] Add text for song sorting on song screen --- Output/Languages/German.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Output/Languages/German.xml b/Output/Languages/German.xml index c630ba1b..dc0fc2d1 100644 --- a/Output/Languages/German.xml +++ b/Output/Languages/German.xml @@ -147,9 +147,10 @@ (%v Lieder) (%v Lied) %a -%t - A-Z = Zum Buchstaben springen • F3 = Suchen • STRG+R = Zufällige Auswahl • STRG+S = Starte Medley • STRG+A = Alle zufällig starten • STRG+V = Sichtbare zufällig starten • Leertaste = Lied-Optionen öffnen • ESC = Zurück zum Hauptmenü + A-Z = Zum Buchstaben springen • F3 = Suchen • STRG+R = Zufällige Auswahl • STRG+S = Starte Medley • STRG+# = Song Sortierung ändern • STRG+T = Kategorieansicht ein-/ausschalten • Leertaste = Lied-Optionen öffnen • ESC = Zurück zum Hauptmenü A-Z = Interpreten und Titel durchsuchen, Präfixe für die Suche → a: = Interpret • t: = Titel • c: = Ersteller • e: = Edition • g: = Genre • y: = Jahr (z.B. 1999 oder 1980-1989) • l: = Sprache • al: = Album • fi: = Dateiname • fo: = Ordnername 1-6 = Drücke die Teamnummer um einen Zufallssong Joker zu verwenden + Sortierung: %s Pause Lied beenden Fortfahren From 5dda7ce6c67082d89c5f5b9219f53aa10ba82405 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 26 Jan 2020 11:13:43 +0100 Subject: [PATCH 5/6] Add text for song sorting on song screen --- Output/Languages/English.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index c9c92bf7..fc7a4ca2 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -152,7 +152,7 @@ (%v songs) (%v song) %a - %t - A-Z = Jump to the letter • F3 = Search • CTRL+R = Random selection • CTRL+S = Start medley • CTRL+# = Change song sorting • CTRL+T = Enable/Disable categories • Space = Open song options • ESC = Back to main menu + A-Z = Jump to the letter • F3 = Search • CTRL+R = Random selection • CTRL+S = Start medley • CTRL+# = Change song sorting • CTRL+T = Enable/Disable category view • Space = Open song options • ESC = Back to main menu A-Z = Search artist and title, prefixes for the search → a: = artist • t: = title • c: = creator • e: = edition • g: = genre • y: = year (e.g. 1999 or 1980-1989) • l: = language • al: = album • fi: = file name • fo: = folder name 1-6 = Press your team number to use a random song joker Sorting: %s From 08daa959c17c1ba401e32e9f70ea08ec3c4d961b Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 26 Jan 2020 18:19:55 +0100 Subject: [PATCH 6/6] Leave category on changing sort order using hotkeys --- Vocaluxe/Screens/CScreenSong.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 518f61bb..730f52f8 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -937,9 +937,15 @@ namespace Vocaluxe.Screens private void _ToggleSort(int sortNr) { + if (CBase.Songs.IsInCategory() && _Sso.Selection.CategoryChangeAllowed) + { + CBase.Songs.SetCategory(-1); + } + CSongs.Sorter.SongSorting = (ESongSorting)sortNr; CConfig.Config.Game.SongSorting = CSongs.Sorter.SongSorting; _Sso.Sorting.SongSorting = CSongs.Sorter.SongSorting; + _SongMenu.Update(_Sso); _SongMenu.OnShow();