From 8b5bb563e61926ea16bfac4316fb3b597eba4a8b Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Thu, 12 Jul 2018 21:55:10 +0200 Subject: [PATCH 01/49] Horrible duet fix --- Vocaluxe/Screens/CScreenSing.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index e36dfbfd..b5eb65ed 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -994,7 +994,20 @@ namespace Vocaluxe.Screens _CloseSong(); CGame.NextRound(); - CGame.ResetPlayer(); + var voiceAssignments = new int[CGame.NumPlayers]; + if (CGame.GetSong() != null && CGame.GetSong().IsDuet) + { + //Save duet-assignment before resetting + for (int i = 0; i < voiceAssignments.Length; i++) + voiceAssignments[i] = CGame.Players[i].VoiceNr; + CGame.ResetPlayer(); + for (int i = 0; i < voiceAssignments.Length; i++) + CGame.Players[i].VoiceNr = voiceAssignments[i]; + } else + { + CGame.ResetPlayer(); + } + _LoadCurrentSong(); From b17b42a5d90511605775903ea0453cfce6811dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Mon, 17 Sep 2018 10:45:23 +0200 Subject: [PATCH 02/49] Fix #397 --- Vocaluxe.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/Vocaluxe.sln b/Vocaluxe.sln index 27cbd7c1..423e9884 100644 --- a/Vocaluxe.sln +++ b/Vocaluxe.sln @@ -152,6 +152,7 @@ Global {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.ActiveCfg = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x64.Build.0 = Release|x64 {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.ActiveCfg = Release|Win32 + {54A48AF7-515C-4EDD-B395-2BFFA096050A}.ReleaseWin|x86.Build.0 = Release|Win32 {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.ActiveCfg = Debug|x64 {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x64.Build.0 = Debug|x64 {8EDF4429-251A-416D-BB68-93F227191BCF}.DebugLinux|x86.ActiveCfg = Debug|x86 From ff6a0823adbe4499d002bf5fb510f1cf17d7f43c Mon Sep 17 00:00:00 2001 From: Jiiniasu Date: Sun, 30 Sep 2018 09:50:49 +0200 Subject: [PATCH 03/49] Fix wrong Z-index --- Output/Themes/Genius/Screens/ScreenScore.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Output/Themes/Genius/Screens/ScreenScore.xml b/Output/Themes/Genius/Screens/ScreenScore.xml index 6ebbf94a..8432d887 100644 --- a/Output/Themes/Genius/Screens/ScreenScore.xml +++ b/Output/Themes/Genius/Screens/ScreenScore.xml @@ -261,7 +261,7 @@ 60 50 - 0 + -1 27 0 @@ -275,7 +275,7 @@ 640 50 - 0 + -1 27 0 From 70be8f4d94acd0edca9cdd6802339a50204f75c8 Mon Sep 17 00:00:00 2001 From: Stefan Wurzinger Date: Mon, 22 Oct 2018 02:25:45 +0200 Subject: [PATCH 04/49] improve song enumeration performance --- Vocaluxe/Base/CSongs.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index d3670c80..555fe93e 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -339,18 +339,17 @@ namespace Vocaluxe.Base SongsLoaded = false; _Songs.Clear(); - var files = new List(); + var files = Enumerable.Empty(); using (CBenchmark.Time("List Songs")) { - foreach (string p in CConfig.SongFolders) + foreach (string path in CConfig.SongFolders) { - if (Directory.Exists(p)) + if (Directory.Exists(path)) { - string path = p; - files.AddRange(CHelper.ListFiles(path, "*.txt", true, true)); - files.AddRange(CHelper.ListFiles(path, "*.txd", true, true)); + files = files.Union(Directory.EnumerateFiles(path, "*.txt", SearchOption.AllDirectories)); + files = files.Union(Directory.EnumerateFiles(path, "*.txd", SearchOption.AllDirectories)); } } } From e70cb2a44a1a16035f61ed8cffff307f840c37e7 Mon Sep 17 00:00:00 2001 From: Stefan Wurzinger Date: Wed, 24 Oct 2018 00:19:22 +0200 Subject: [PATCH 05/49] fix log message formatter --- VocaluxeLib/Log/CLog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VocaluxeLib/Log/CLog.cs b/VocaluxeLib/Log/CLog.cs index e2719273..2b78b8cb 100644 --- a/VocaluxeLib/Log/CLog.cs +++ b/VocaluxeLib/Log/CLog.cs @@ -196,10 +196,10 @@ namespace VocaluxeLib.Log int i = 0; return theRegex.Replace(template, delegate(Match match) { - if (propertyValues.Length >= i) + if (i >= propertyValues.Length) return match.Value; return propertyValues[i++].ToString(); - }); + }); } } From b5185d56b2741074f30ac331ef026d04e5ebf316 Mon Sep 17 00:00:00 2001 From: Stefan Wurzinger Date: Wed, 24 Oct 2018 01:07:22 +0200 Subject: [PATCH 06/49] ListFiles: enumerate files lazily --- Vocaluxe/Base/CBackgroundMusic.cs | 2 +- Vocaluxe/Base/CCover.cs | 4 ++-- Vocaluxe/Base/CSongs.cs | 4 ++-- Vocaluxe/Base/ThemeSystem/CTheme.cs | 2 +- Vocaluxe/Base/ThemeSystem/CThemes.cs | 2 +- VocaluxeLib/CHelper.cs | 32 +++++++++++----------------- VocaluxeLib/Songs/CSong.cs | 4 ++-- 7 files changed, 21 insertions(+), 29 deletions(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 19c47c19..5050b408 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -157,7 +157,7 @@ namespace Vocaluxe.Base if (_Initialized) return; - List soundFiles = CHelper.ListSoundFiles(CSettings.FolderNameBackgroundMusic, true, true); + IEnumerable soundFiles = CHelper.ListSoundFiles(CSettings.FolderNameBackgroundMusic, true, true); foreach (string path in soundFiles) _BGMusicFiles.Add(new CPlaylistElement(path)); diff --git a/Vocaluxe/Base/CCover.cs b/Vocaluxe/Base/CCover.cs index 6dea5e2f..3ac5a87b 100644 --- a/Vocaluxe/Base/CCover.cs +++ b/Vocaluxe/Base/CCover.cs @@ -174,7 +174,7 @@ namespace Vocaluxe.Base _CoverThemes.Clear(); string folderPath = Path.Combine(CSettings.ProgramFolder, CSettings.FolderNameCover); - List files = CHelper.ListFiles(folderPath, "*.xml"); + IEnumerable files = CHelper.ListFiles(folderPath, "*.xml"); var xml = new CXmlDeserializer(); foreach (string file in files) @@ -207,7 +207,7 @@ namespace Vocaluxe.Base Debug.Assert(!String.IsNullOrEmpty(coverTheme.Info.Name)); - List files = CHelper.ListImageFiles(coverTheme.FolderPath, true, true); + IEnumerable files = CHelper.ListImageFiles(coverTheme.FolderPath, true, true); lock (_Covers) { diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index 555fe93e..3a442fea 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -348,8 +348,8 @@ namespace Vocaluxe.Base { if (Directory.Exists(path)) { - files = files.Union(Directory.EnumerateFiles(path, "*.txt", SearchOption.AllDirectories)); - files = files.Union(Directory.EnumerateFiles(path, "*.txd", SearchOption.AllDirectories)); + files = files.Union(CHelper.ListFiles(path, "*.txt", true, true)); + files = files.Union(CHelper.ListFiles(path, "*.txd", true, true)); } } } diff --git a/Vocaluxe/Base/ThemeSystem/CTheme.cs b/Vocaluxe/Base/ThemeSystem/CTheme.cs index 12ea5eaf..404517c0 100644 --- a/Vocaluxe/Base/ThemeSystem/CTheme.cs +++ b/Vocaluxe/Base/ThemeSystem/CTheme.cs @@ -86,7 +86,7 @@ namespace Vocaluxe.Base.ThemeSystem } string path = Path.Combine(_Folder, Name); - List files = CHelper.ListFiles(path, "*.xml"); + IEnumerable files = CHelper.ListFiles(path, "*.xml"); // Load skins, succeed if at least 1 skin was loaded bool ok = false; diff --git a/Vocaluxe/Base/ThemeSystem/CThemes.cs b/Vocaluxe/Base/ThemeSystem/CThemes.cs index 8ca65c47..1262c473 100644 --- a/Vocaluxe/Base/ThemeSystem/CThemes.cs +++ b/Vocaluxe/Base/ThemeSystem/CThemes.cs @@ -135,7 +135,7 @@ namespace Vocaluxe.Base.ThemeSystem public static bool ReadThemesFromFolder(string path, int partyModeID) { - List files = CHelper.ListFiles(path, "*.xml", false, true); + IEnumerable files = CHelper.ListFiles(path, "*.xml", false, true); List newThemes = new List(); foreach (string file in files) diff --git a/VocaluxeLib/CHelper.cs b/VocaluxeLib/CHelper.cs index 6c04fee7..20efe943 100644 --- a/VocaluxeLib/CHelper.cs +++ b/VocaluxeLib/CHelper.cs @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.IO; +using System.Linq; using VocaluxeLib.Log; namespace VocaluxeLib @@ -165,25 +166,20 @@ namespace VocaluxeLib /// Search directories recursively /// False for just file names, True for full path /// List of file names - public static List ListFiles(string path, string searchPattern, bool recursive = false, bool fullpath = false) + public static IEnumerable ListFiles(string path, string searchPattern, bool recursive = false, bool fullpath = false) { - var files = new List(); + IEnumerable files = Enumerable.Empty(); var dir = new DirectoryInfo(path); if (!dir.Exists) return files; + if (recursive && !fullpath) + throw new NotSupportedException("recursive file listing with relative path names is not supported"); + try { - // ReSharper disable LoopCanBeConvertedToQuery - foreach (FileInfo file in dir.GetFiles(searchPattern)) - // ReSharper restore LoopCanBeConvertedToQuery - files.Add(!fullpath ? file.Name : file.FullName); - - if (recursive) - { - foreach (DirectoryInfo di in dir.GetDirectories()) - files.AddRange(ListFiles(di.FullName, searchPattern, true, fullpath)); - } + files = Directory.EnumerateFiles(dir.FullName, searchPattern, recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly); + files = files.Select(fullpath ? (Func)Path.GetFullPath : Path.GetFileName); } catch (Exception) {} @@ -198,13 +194,9 @@ namespace VocaluxeLib /// Search directories recursively /// False for just file names, True for full path /// List of file names - public static List ListFiles(string path, IEnumerable searchPatterns, bool recursive = false, bool fullpath = false) + public static IEnumerable ListFiles(string path, IEnumerable searchPatterns, bool recursive = false, bool fullpath = false) { - var files = new List(); - foreach (string pattern in searchPatterns) - files.AddRange(ListFiles(path, pattern, recursive, fullpath)); - - return files; + return searchPatterns.SelectMany(pattern => ListFiles(path, pattern, recursive, fullpath)); } /// @@ -214,7 +206,7 @@ namespace VocaluxeLib /// Search directories recursively /// False for just file names, True for full path /// List of image file names - public static List ListImageFiles(string path, bool recursive = false, bool fullpath = false) + public static IEnumerable ListImageFiles(string path, bool recursive = false, bool fullpath = false) { return ListFiles(path, _ImageFileTypes, recursive, fullpath); } @@ -226,7 +218,7 @@ namespace VocaluxeLib /// Search directories recursively /// False for just file names, True for full path /// List of image file names - public static List ListSoundFiles(string path, bool recursive = false, bool fullpath = false) + public static IEnumerable ListSoundFiles(string path, bool recursive = false, bool fullpath = false) { return ListFiles(path, _SoundFileTypes, recursive, fullpath); } diff --git a/VocaluxeLib/Songs/CSong.cs b/VocaluxeLib/Songs/CSong.cs index fb9c033e..e6ddaf4d 100644 --- a/VocaluxeLib/Songs/CSong.cs +++ b/VocaluxeLib/Songs/CSong.cs @@ -325,7 +325,7 @@ namespace VocaluxeLib.Songs { if (CoverFileName == "") { - List files = CHelper.ListImageFiles(Folder); + IEnumerable files = CHelper.ListImageFiles(Folder); foreach (String file in files) { if (file.ContainsIgnoreCase("[CO]") && @@ -336,7 +336,7 @@ namespace VocaluxeLib.Songs if (BackgroundFileNames.Count == 0) { - List files = CHelper.ListImageFiles(Folder); + IEnumerable files = CHelper.ListImageFiles(Folder); foreach (String file in files) { if (file.ContainsIgnoreCase("[BG]") && From 60ff5d008d8b4f2873faffe99a9e2999d70a5179 Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 8 Jan 2020 21:48:28 +0100 Subject: [PATCH 07/49] Extended search functions on song list screen (develop) On the song list screen you can activate the search function by pressing F3 or CTRL+F, even in older Vocaluxe versions. In this commit I added special keywords for this search function to allow searching just for the artist or other items, like language or genre, which can't be searched in older Vocaluxe versions. (changed file CSongFilter.cs) Use following keywords to search for a special item: a: = artists t: = title g: = genre y: = year, you can also do y:1980-1989 to find songs from the 80s l: = language c: = creator e: = edition al: = album fi: = file name fo: = folder name **Examples:** a:abba y:1980-1989 y:1999 g:rock l:german **Additional notes:** - If using this keywords, the maximum search results are limited to 200 songs. - Changed the behavior if searching without keywords: Only title and artists will be searched, removed folder and file names. --- Vocaluxe/Base/CSongFilter.cs | 165 ++++++++++++++++++++++++++++++++++- 1 file changed, 162 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Base/CSongFilter.cs b/Vocaluxe/Base/CSongFilter.cs index 20596803..acc67d2f 100644 --- a/Vocaluxe/Base/CSongFilter.cs +++ b/Vocaluxe/Base/CSongFilter.cs @@ -1,4 +1,4 @@ -#region license +#region license // This file is part of Vocaluxe. // // Vocaluxe is free software: you can redistribute it and/or modify @@ -93,6 +93,89 @@ namespace Vocaluxe.Base if (_SearchString != "") searchStrings = _SearchString.ToUpper().Split(new char[] {' '}); + String searchForArtist = null; // a: + String searchForTitle = null; // t: + String searchForGenre = null; // g: + String searchForYear = null; // y: + String searchForLanguage = null; // l: + String searchForCreator = null; // c: + String searchForEdition = null; // e: + String searchForAlbum = null; // al: + String searchForFileName = null; // fi: + String searchForFolderName = null; // fo: + bool expertSearch = false; + + if (searchStrings != null) + { + foreach (String searchToken in searchStrings) + { + if (searchToken.Length < 3) + continue; + + String temp = searchToken.Substring(0, 2); + bool foundIt = true; + + switch (temp) + { + case "A:": + searchForArtist = searchToken.Substring(2); + break; + case "T:": + searchForTitle = searchToken.Substring(2); + break; + case "G:": + searchForGenre = searchToken.Substring(2); + break; + case "Y:": + searchForYear = searchToken.Substring(2); + break; + case "L:": + searchForLanguage = searchToken.Substring(2); + break; + case "C:": + searchForCreator = searchToken.Substring(2); + break; + case "E:": + searchForEdition = searchToken.Substring(2); + break; + default: + foundIt = false; + break; + } + + if (foundIt) + { + if (!expertSearch) expertSearch = true; + continue; + } + + if (searchToken.Length < 4) + continue; + + foundIt = true; + temp = searchToken.Substring(0, 3); + + switch (temp) + { + case "AL:": + searchForAlbum = searchToken.Substring(3); + break; + case "FI:": + searchForFileName = searchToken.Substring(3); + break; + case "FO:": + searchForFolderName = searchToken.Substring(3); + break; + default: + foundIt = false; + break; + } + + if (foundIt) + if (!expertSearch) expertSearch = true; + } + } + foreach (CSong song in CSongs.Songs) { if (_PlaylistID != -1 && !CBase.Playlist.ContainsSong(_PlaylistID, song.ID)) @@ -102,9 +185,85 @@ namespace Vocaluxe.Base { if (searchStrings == null) _FilteredSongs.Add(song); + else if (expertSearch) + { + // Stefan1200: Stop at a maximum of 200 search result to prevent performance issues + if (_FilteredSongs.Count >= 200) + break; + + if (searchForAlbum != null && song.Album.ToUpper().Contains(searchForAlbum)) + _FilteredSongs.Add(song); + if (searchForArtist != null && song.Artist.ToUpper().Contains(searchForArtist)) + _FilteredSongs.Add(song); + if (searchForTitle != null && song.Title.ToUpper().Contains(searchForTitle)) + _FilteredSongs.Add(song); + if (searchForCreator != null && song.Creator.ToUpper().Contains(searchForCreator)) + _FilteredSongs.Add(song); + if (searchForFileName != null && song.FileName.ToUpper().Contains(searchForFileName)) + _FilteredSongs.Add(song); + if (searchForFolderName != null && song.FolderName.ToUpper().Contains(searchForFolderName)) + _FilteredSongs.Add(song); + + if (searchForGenre != null) + { + foreach (String genre in song.Genres) + { + if (genre.ToUpper().Contains(searchForGenre)) + _FilteredSongs.Add(song); + } + } + + if (searchForLanguage != null) + { + foreach (String language in song.Languages) + { + if (language.ToUpper().Contains(searchForLanguage)) + _FilteredSongs.Add(song); + } + } + + if (searchForEdition != null) + { + foreach (String edition in song.Editions) + { + if (edition.ToUpper().Contains(searchForEdition)) + _FilteredSongs.Add(song); + } + } + + if (searchForYear != null) + { + int pos = searchForYear.IndexOf("-"); + if (pos == -1) + { + if (song.Year.Contains(searchForYear)) + _FilteredSongs.Add(song); + } + else if (searchForYear.Length == 9) + { + int yearStart = -1; + int yearEnd = -1; + if (!Int32.TryParse(searchForYear.Substring(0, pos), out yearStart)) + continue; + if (!Int32.TryParse(searchForYear.Substring(pos + 1), out yearEnd)) + continue; + + // Stefan1200: Prevent searches like 0000-9999, limit for a max distance of 100 years + if (yearEnd - yearStart > 100) + continue; + + int yearSearch = -1; + if (!Int32.TryParse(song.Year, out yearSearch)) + continue; + + if (yearSearch >= yearStart && yearSearch <= yearEnd) + _FilteredSongs.Add(song); + } + } + } else { - string search = song.Title.ToUpper() + " " + song.Artist.ToUpper() + " " + song.FolderName.ToUpper() + " " + song.FileName.ToUpper(); + string search = song.Title.ToUpper() + " " + song.Artist.ToUpper(); if (searchStrings.All(search.Contains)) _FilteredSongs.Add(song); @@ -114,4 +273,4 @@ namespace Vocaluxe.Base _Changed = false; } } -} \ No newline at end of file +} From fcf212df1282f0f9fba6054333b47847eaf4e3a9 Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 8 Jan 2020 22:06:20 +0100 Subject: [PATCH 08/49] Allow selection with more letters by key press While in a song list in Vocaluxe, you can press a letter key to select the first entry starting with this letter. I prefer to be able to press multiple letters, maybe ABB to get the first ABBA entry selected. I did the change on my end. --- Vocaluxe/Screens/CScreenSong.cs | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 60031c4d..d3b4ef13 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -1,4 +1,4 @@ -#region license +#region license // This file is part of Vocaluxe. // // Vocaluxe is free software: you can redistribute it and/or modify @@ -77,6 +77,9 @@ namespace Vocaluxe.Screens private string _SearchText = String.Empty; private bool _SearchActive; + private int _JumpTo_lastCharTime = 0; + private String _JumpTo_lastSearchString = ""; + private readonly List _ButtonsJoker = new List(); private readonly List _TextsPlayer = new List(); private ESongOptionsView _CurSongOptionsView; @@ -1042,6 +1045,13 @@ namespace Vocaluxe.Screens private void _JumpTo(char letter) { + // Stefan1200: Add all letters from a key press within one second to a search string. Clear search string, if last key press is older than one second. + String searchString; + if (Environment.TickCount - _JumpTo_lastCharTime < 1000) + searchString = _JumpTo_lastSearchString + letter.ToString(); + else + searchString = letter.ToString(); + int start = 0; int curSelected = CSongs.IsInCategory ? _SongMenu.GetSelectedSongNr() : _SongMenu.GetSelectedCategory(); bool firstLevel = CConfig.Config.Game.Tabs == EOffOn.TR_CONFIG_OFF && CSongs.IsInCategory; @@ -1061,28 +1071,20 @@ namespace Vocaluxe.Screens { case ESongSorting.TR_CONFIG_ARTIST: case ESongSorting.TR_CONFIG_ARTIST_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_YEAR: case ESongSorting.TR_CONFIG_DECADE: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_TITLE_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_FOLDER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; } if (visibleID > -1) @@ -1097,16 +1099,12 @@ namespace Vocaluxe.Screens { case ESongSorting.TR_CONFIG_FOLDER: case ESongSorting.TR_CONFIG_TITLE_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_ARTIST: case ESongSorting.TR_CONFIG_ARTIST_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; } if (visibleID > -1) @@ -1116,12 +1114,14 @@ namespace Vocaluxe.Screens { ReadOnlyCollection categories = CSongs.Categories; int ct = categories.Count; - if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - int visibleID = _FindIndex(categories, start, element => element.Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + int visibleID = _FindIndex(categories, start, element => element.Name.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); if (visibleID > -1) _SongMenu.SetSelectedCategory(visibleID); } + + // Stefan1200: Remember search string and current TickCount in class variables. + _JumpTo_lastCharTime = Environment.TickCount; + _JumpTo_lastSearchString = searchString; } private void _ApplyNewSearchFilter(string newFilterString) @@ -1395,4 +1395,4 @@ namespace Vocaluxe.Screens } #endregion Playlist Actions } -} \ No newline at end of file +} From f3df791a82217b0486f352c6a3889b3436c5cec8 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 14:41:00 +0100 Subject: [PATCH 09/49] Temporary fix for the song list reset Temporary fix for the song list reset described in issue #390. --- VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index 02cfac02..1a173393 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -288,7 +288,9 @@ namespace VocaluxeLib.Menu.SongMenu public void LeaveSelectedCategory() { - _LeaveCategory(); + // Stefan1200: This was implemented with the pull request #359 and is the reason for the bug described in issue #390. + // Currently disabled until we know if this is still needed or we find a better solution! + // _LeaveCategory(); } public virtual void UnloadSkin() {} @@ -425,4 +427,4 @@ namespace VocaluxeLib.Menu.SongMenu } #endregion ThemeEdit } -} \ No newline at end of file +} From de258bebb553eb7ed862e662d831489505b61934 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 10 Jan 2020 17:16:14 +0100 Subject: [PATCH 10/49] Fix: x64 build is failing as the sonarcloud plugin has a problem with d:sonar.organization --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8fdf1640..4774c28d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -63,7 +63,7 @@ before_build: choco install "msbuild-sonarqube-runner" -y SonarScanner.MSBuild.exe begin ` /k:"Vocaluxe" ` - /d:sonar.organization="vocaluxe" ` + /o:"vocaluxe" ` /d:sonar.host.url="https://sonarcloud.io" ` /d:sonar.login="$Env:SonarQubeToken" ` /d:"sonar.pullrequest.key=$env:APPVEYOR_PULL_REQUEST_NUMBER" ` @@ -74,7 +74,7 @@ before_build: choco install "msbuild-sonarqube-runner" -y SonarScanner.MSBuild.exe begin ` /k:"Vocaluxe" ` - /d:sonar.organization="vocaluxe" ` + /o:"vocaluxe" ` /d:sonar.host.url="https://sonarcloud.io" ` /v:"$Env:GIT_VERSION_TAG" ` /d:sonar.login="$Env:SonarQubeToken" ` From eef1ea5c55acf554ca5b541971c9de685af51110 Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 10 Jan 2020 18:07:03 +0100 Subject: [PATCH 11/49] Fix: CLogTest use uninterpolated string as expected value --- Tests/VocaluxeLib/Log/CLogTest.cs | 20 ++++++++++---------- Tests/VocaluxeLib/Log/CLogTest.tt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tests/VocaluxeLib/Log/CLogTest.cs b/Tests/VocaluxeLib/Log/CLogTest.cs index 56ddf159..48eb5b84 100644 --- a/Tests/VocaluxeLib/Log/CLogTest.cs +++ b/Tests/VocaluxeLib/Log/CLogTest.cs @@ -76,7 +76,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Verbose] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -129,7 +129,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Verbose] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -287,7 +287,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Debug] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -340,7 +340,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Debug] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -498,7 +498,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Information] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -551,7 +551,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Information] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -709,7 +709,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Warning] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -762,7 +762,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Warning] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -920,7 +920,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Error] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); @@ -973,7 +973,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[Error] " + _TestMessageWithResolvedData, log, "Main log entry wrong"); - StringAssert.Contains(_TestMessageWithData, error, "Error message wrong"); + StringAssert.Contains(_TestMessageWithResolvedData, error, "Error message wrong"); }, ELogLevel.Verbose); diff --git a/Tests/VocaluxeLib/Log/CLogTest.tt b/Tests/VocaluxeLib/Log/CLogTest.tt index fac62cfb..1ca560dd 100644 --- a/Tests/VocaluxeLib/Log/CLogTest.tt +++ b/Tests/VocaluxeLib/Log/CLogTest.tt @@ -101,7 +101,7 @@ namespace Tests.VocaluxeLib.Log StringAssert.Contains("Version = " + versionTag, log, "Main log version tag entry wrong"); StringAssert.Contains("[<#= LogLevel #>] " + <#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, log, "Main log entry wrong"); - StringAssert.Contains(<#= WithData?"_TestMessageWithData":"_TestMessage" #>, error, "Error message wrong"); + StringAssert.Contains(<#= WithData?"_TestMessageWithResolvedData":"_TestMessage" #>, error, "Error message wrong"); }, ELogLevel.Verbose); From 22699e05cc8345124ef669fc2446ad4f01e7938a Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Fri, 10 Jan 2020 18:08:54 +0100 Subject: [PATCH 12/49] Fix: CLog._FormatMessageTemplate does not wrap values in double quotes as all the other functions do --- VocaluxeLib/Log/CLog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VocaluxeLib/Log/CLog.cs b/VocaluxeLib/Log/CLog.cs index 2b78b8cb..6d1d3535 100644 --- a/VocaluxeLib/Log/CLog.cs +++ b/VocaluxeLib/Log/CLog.cs @@ -198,7 +198,7 @@ namespace VocaluxeLib.Log { if (i >= propertyValues.Length) return match.Value; - return propertyValues[i++].ToString(); + return "\"" + propertyValues[i++] + "\""; }); } From 4ee7a6fe2b3cb5a37fa280d2cd3ddbde78de236b Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 23:02:32 +0100 Subject: [PATCH 13/49] Add small text line with key shortcuts to Song Screen Add a small text line with key shortcuts to Song Screen, toggled if the search bar is active with help to the extended search keywords added by another commit. --- Vocaluxe/Screens/CScreenSong.cs | 56 +++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 60031c4d..184e0dd8 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -1,4 +1,4 @@ -#region license +#region license // This file is part of Vocaluxe. // // Vocaluxe is free software: you can redistribute it and/or modify @@ -42,13 +42,15 @@ 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 6; } + get { return 7; } } private const string _TextCategory = "TextCategory"; private const string _TextSelection = "TextSelection"; private const string _TextSearchBarTitle = "TextSearchBarTitle"; private const string _TextSearchBar = "TextSearchBar"; + private const string _TextHelpBar = "TextHelpBar"; + private const string _TextHelpBarSearch = "TextHelpBarSearch"; private const string _TextOptionsTitle = "TextOptionsTitle"; private const string _ButtonOpenOptions = "ButtonOpenOptions"; @@ -77,6 +79,9 @@ namespace Vocaluxe.Screens private string _SearchText = String.Empty; private bool _SearchActive; + private int _JumpTo_lastCharTime = 0; + private String _JumpTo_lastSearchString = ""; + private readonly List _ButtonsJoker = new List(); private readonly List _TextsPlayer = new List(); private ESongOptionsView _CurSongOptionsView; @@ -134,6 +139,8 @@ namespace Vocaluxe.Screens tlist.Add(_TextSelection); tlist.Add(_TextSearchBarTitle); tlist.Add(_TextSearchBar); + tlist.Add(_TextHelpBar); + tlist.Add(_TextHelpBarSearch); tlist.Add(_TextOptionsTitle); _ThemeStatics = new string[] {_StaticSearchBar, _StaticOptionsBG}; @@ -727,12 +734,16 @@ namespace Vocaluxe.Screens _Texts[_TextSearchBar].Visible = true; _Texts[_TextSearchBarTitle].Visible = true; + _Texts[_TextHelpBar].Visible = false; + _Texts[_TextHelpBarSearch].Visible = true; _Statics[_StaticSearchBar].Visible = true; } else { _Texts[_TextSearchBar].Visible = false; _Texts[_TextSearchBarTitle].Visible = false; + _Texts[_TextHelpBar].Visible = true; + _Texts[_TextHelpBarSearch].Visible = false; _Statics[_StaticSearchBar].Visible = false; } @@ -1042,6 +1053,13 @@ namespace Vocaluxe.Screens private void _JumpTo(char letter) { + // Stefan1200: Add all letters from a key press within one second to a search string. Clear search string, if last key press is older than one second. + String searchString; + if (Environment.TickCount - _JumpTo_lastCharTime < 1000) + searchString = _JumpTo_lastSearchString + letter.ToString(); + else + searchString = letter.ToString(); + int start = 0; int curSelected = CSongs.IsInCategory ? _SongMenu.GetSelectedSongNr() : _SongMenu.GetSelectedCategory(); bool firstLevel = CConfig.Config.Game.Tabs == EOffOn.TR_CONFIG_OFF && CSongs.IsInCategory; @@ -1061,28 +1079,20 @@ namespace Vocaluxe.Screens { case ESongSorting.TR_CONFIG_ARTIST: case ESongSorting.TR_CONFIG_ARTIST_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_YEAR: case ESongSorting.TR_CONFIG_DECADE: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_TITLE_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_FOLDER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; } if (visibleID > -1) @@ -1097,16 +1107,12 @@ namespace Vocaluxe.Screens { case ESongSorting.TR_CONFIG_FOLDER: case ESongSorting.TR_CONFIG_TITLE_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_ARTIST: case ESongSorting.TR_CONFIG_ARTIST_LETTER: - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); break; } if (visibleID > -1) @@ -1116,12 +1122,14 @@ namespace Vocaluxe.Screens { ReadOnlyCollection categories = CSongs.Categories; int ct = categories.Count; - if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - int visibleID = _FindIndex(categories, start, element => element.Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + int visibleID = _FindIndex(categories, start, element => element.Name.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); if (visibleID > -1) _SongMenu.SetSelectedCategory(visibleID); } + + // Stefan1200: Remember search string and current TickCount in class variables. + _JumpTo_lastCharTime = Environment.TickCount; + _JumpTo_lastSearchString = searchString; } private void _ApplyNewSearchFilter(string newFilterString) @@ -1395,4 +1403,4 @@ namespace Vocaluxe.Screens } #endregion Playlist Actions } -} \ No newline at end of file +} From c536cc8ee35413f336c2d7b310170d10f5a47bdd Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 23:07:16 +0100 Subject: [PATCH 14/49] Add small text line with key shortcuts to Song Screen Add a small text line with key shortcuts to Song Screen, toggled if the search bar is active with help to the extended search keywords added by another commit. --- Vocaluxe/Screens/CScreenSong.cs | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 184e0dd8..7b69b0c2 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -42,7 +42,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 6; } } private const string _TextCategory = "TextCategory"; @@ -79,9 +79,6 @@ namespace Vocaluxe.Screens private string _SearchText = String.Empty; private bool _SearchActive; - private int _JumpTo_lastCharTime = 0; - private String _JumpTo_lastSearchString = ""; - private readonly List _ButtonsJoker = new List(); private readonly List _TextsPlayer = new List(); private ESongOptionsView _CurSongOptionsView; @@ -1053,13 +1050,6 @@ namespace Vocaluxe.Screens private void _JumpTo(char letter) { - // Stefan1200: Add all letters from a key press within one second to a search string. Clear search string, if last key press is older than one second. - String searchString; - if (Environment.TickCount - _JumpTo_lastCharTime < 1000) - searchString = _JumpTo_lastSearchString + letter.ToString(); - else - searchString = letter.ToString(); - int start = 0; int curSelected = CSongs.IsInCategory ? _SongMenu.GetSelectedSongNr() : _SongMenu.GetSelectedCategory(); bool firstLevel = CConfig.Config.Game.Tabs == EOffOn.TR_CONFIG_OFF && CSongs.IsInCategory; @@ -1079,20 +1069,28 @@ namespace Vocaluxe.Screens { case ESongSorting.TR_CONFIG_ARTIST: case ESongSorting.TR_CONFIG_ARTIST_LETTER: - visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_YEAR: case ESongSorting.TR_CONFIG_DECADE: - visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + visibleID = _FindIndex(songs, start, element => element.Year.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_TITLE_LETTER: - visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_FOLDER: - visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + visibleID = _FindIndex(songs, start, element => element.Folder.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); break; } if (visibleID > -1) @@ -1107,12 +1105,16 @@ namespace Vocaluxe.Screens { case ESongSorting.TR_CONFIG_FOLDER: case ESongSorting.TR_CONFIG_TITLE_LETTER: - visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); break; case ESongSorting.TR_CONFIG_ARTIST: case ESongSorting.TR_CONFIG_ARTIST_LETTER: - visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + visibleID = _FindIndex(songs, start, element => element.Title.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); break; } if (visibleID > -1) @@ -1122,14 +1124,12 @@ namespace Vocaluxe.Screens { ReadOnlyCollection categories = CSongs.Categories; int ct = categories.Count; - int visibleID = _FindIndex(categories, start, element => element.Name.StartsWith(searchString, StringComparison.OrdinalIgnoreCase)); + if (curSelected >= 0 && curSelected < ct - 1 && categories[curSelected].Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) + start = curSelected + 1; + int visibleID = _FindIndex(categories, start, element => element.Name.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); if (visibleID > -1) _SongMenu.SetSelectedCategory(visibleID); } - - // Stefan1200: Remember search string and current TickCount in class variables. - _JumpTo_lastCharTime = Environment.TickCount; - _JumpTo_lastSearchString = searchString; } private void _ApplyNewSearchFilter(string newFilterString) From d82dc7abc8020c7db00b17c3d77945e48ba83c22 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 23:09:05 +0100 Subject: [PATCH 15/49] Add small text line with key shortcuts to Song Screen Add a small text line with key shortcuts to Song Screen, toggled if the search bar is active with help to the extended search keywords added by another commit. --- Vocaluxe/Screens/CScreenSong.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 7b69b0c2..cfb92605 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -42,7 +42,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 6; } + get { return 7; } } private const string _TextCategory = "TextCategory"; From 039171d2a24951e9538f9626bad28b730001bd6b Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 23:11:43 +0100 Subject: [PATCH 16/49] English text line with key shortcuts to Song Screen Add a small text line with key shortcuts to Song Screen, toggled if the search bar is active with help to the extended search keywords added by another commit. --- Output/Languages/English.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index 63a4bad3..fcdfb63c 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -152,6 +152,8 @@ (%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, 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 Pause Stop singing Continue From 53d13ec7c81366a9071fa6dcf3a14856cb6f669f Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 23:12:24 +0100 Subject: [PATCH 17/49] German text line with key shortcuts to Song Screen Add a small text line with key shortcuts to Song Screen, toggled if the search bar is active with help to the extended search keywords added by another commit. --- Output/Languages/German.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Output/Languages/German.xml b/Output/Languages/German.xml index 1de7ea61..4aa84269 100644 --- a/Output/Languages/German.xml +++ b/Output/Languages/German.xml @@ -147,6 +147,8 @@ (%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, 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 Pause Lied beenden Fortfahren From 4aaef8ef578be991436bcb0e150142507ec7bf19 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 10 Jan 2020 23:13:17 +0100 Subject: [PATCH 18/49] Add small text line with key shortcuts to Song Screen Add a small text line with key shortcuts to Song Screen, toggled if the search bar is active with help to the extended search keywords added by another commit. --- Output/Themes/Genius/Screens/ScreenSong.xml | 30 ++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Output/Themes/Genius/Screens/ScreenSong.xml b/Output/Themes/Genius/Screens/ScreenSong.xml index 1b74ad72..4d162ef8 100644 --- a/Output/Themes/Genius/Screens/ScreenSong.xml +++ b/Output/Themes/Genius/Screens/ScreenSong.xml @@ -2,7 +2,7 @@ ScreenSong - 6 + 7 @@ -238,6 +238,34 @@ Outline TR_SCREENSONG_SONGOPTIONS + + 40 + 700 + 0 + 16 + 1200 + + + Left + Bottom + + Outline + TR_SCREENSONG_HELPMESSAGE + + + 40 + 700 + 0 + 16 + 1200 + + + Left + Bottom + + Outline + TR_SCREENSONG_HELPMESSAGESEARCH +