From 6c70c52a1fe496b9843bec17fa1f12a300c2edef Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Wed, 30 May 2012 14:47:14 +0200 Subject: [PATCH 1/8] Added option to config.xml to ignore articles of title and artist on sorting. Do we need a entry on options screen? --- Vocaluxe/Base/CConfig.cs | 5 ++ Vocaluxe/Base/CSongs.cs | 189 ++++++++++++++++++++++++++++++++------- 2 files changed, 161 insertions(+), 33 deletions(-) diff --git a/Vocaluxe/Base/CConfig.cs b/Vocaluxe/Base/CConfig.cs index 0fb18b31..051e1fa7 100644 --- a/Vocaluxe/Base/CConfig.cs +++ b/Vocaluxe/Base/CConfig.cs @@ -210,6 +210,7 @@ namespace Vocaluxe.Base public static List SongFolder = new List(); public static ESongMenu SongMenu = ESongMenu.TR_CONFIG_TILE_BOARD; public static ESongSorting SongSorting = ESongSorting.TR_CONFIG_ARTIST; + public static EOffOn IgnoreArticles = EOffOn.TR_CONFIG_ON; public static float ScoreAnimationTime = 10; public static ETimerMode TimerMode = ETimerMode.TR_CONFIG_TIMERMODE_REMAINING; public static int NumPlayer = 2; @@ -347,6 +348,7 @@ namespace Vocaluxe.Base CHelper.TryGetEnumValueFromXML("//root/Game/SongMenu", navigator, ref SongMenu); CHelper.TryGetEnumValueFromXML("//root/Game/SongSorting", navigator, ref SongSorting); + CHelper.TryGetEnumValueFromXML("//root/Game/IgnoreArticles", navigator, ref IgnoreArticles); CHelper.TryGetFloatValueFromXML("//root/Game/ScoreAnimationTime", navigator, ref ScoreAnimationTime); CHelper.TryGetEnumValueFromXML("//root/Game/TimerMode", navigator, ref TimerMode); CHelper.TryGetIntValueFromXML("//root/Game/NumPlayer", navigator, ref NumPlayer); @@ -578,6 +580,9 @@ namespace Vocaluxe.Base writer.WriteComment("SongSorting: " + ListStrings(Enum.GetNames(typeof(ESongSorting)))); writer.WriteElementString("SongSorting", Enum.GetName(typeof(ESongSorting), SongSorting)); + writer.WriteComment("Ignore articles on song-sorting: " + ListStrings(Enum.GetNames(typeof(EOffOn)))); + writer.WriteElementString("IgnoreArticles", Enum.GetName(typeof(EOffOn), IgnoreArticles)); + writer.WriteComment("ScoreAnimationTime: Values >= 1 or 0 for no animation. Time is in seconds."); writer.WriteElementString("ScoreAnimationTime", ScoreAnimationTime.ToString()); diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index 8473cf25..973c3a2f 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -353,12 +353,28 @@ namespace Vocaluxe.Base int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); if (res == 0) { - res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); - if (res == 0) + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); + string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); + res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; } return res; }); @@ -407,12 +423,28 @@ namespace Vocaluxe.Base int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); if (res == 0) { - res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); - if (res == 0) + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); + string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); + res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; } return res; }); @@ -480,12 +512,28 @@ namespace Vocaluxe.Base int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); if (res == 0) { - res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); - if (res == 0) + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); + string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); + res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; } return res; }); @@ -506,17 +554,33 @@ namespace Vocaluxe.Base case ESongSorting.TR_CONFIG_ARTIST: foreach (CSong song in _SongList) { - _SortList.Add(new SongPointer(song.ID, song.Artist)); + _SortList.Add(new SongPointer(song.ID, song.Artist)); } _SortList.Sort(delegate(SongPointer s1, SongPointer s2) - { - int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); - if (res == 0) + { + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(s1.SortString.ToUpper()); + string string2 = IgnoreArticle(s2.SortString.ToUpper()); + int res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; }); _SongsSortList = _SortList.ToArray(); @@ -535,7 +599,10 @@ namespace Vocaluxe.Base case ESongSorting.TR_CONFIG_ARTIST_LETTER: foreach (CSong song in _SongList) { - _SortList.Add(new SongPointer(song.ID, song.Artist)); + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) + _SortList.Add(new SongPointer(song.ID, IgnoreArticle(song.Artist))); + else + _SortList.Add(new SongPointer(song.ID, song.Artist)); } _SortList.Sort(delegate(SongPointer s1, SongPointer s2) @@ -583,7 +650,10 @@ namespace Vocaluxe.Base case ESongSorting.TR_CONFIG_TITLE_LETTER: foreach (CSong song in _SongList) { - _SortList.Add(new SongPointer(song.ID, song.Title)); + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) + _SortList.Add(new SongPointer(song.ID, IgnoreArticle(song.Title))); + else + _SortList.Add(new SongPointer(song.ID, song.Title)); } _SortList.Sort(delegate(SongPointer s1, SongPointer s2) @@ -591,7 +661,7 @@ namespace Vocaluxe.Base int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); if (res == 0) { - return _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); } return res; }); @@ -639,12 +709,28 @@ namespace Vocaluxe.Base int res = s1.SortString.CompareTo(s2.SortString); if (res == 0) { - res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); - if (res == 0) + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); + string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); + res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; } return res; }); @@ -686,12 +772,28 @@ namespace Vocaluxe.Base int res = s1.SortString.CompareTo(s2.SortString); if (res == 0) { - res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); - if (res == 0) + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); + string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); + res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; } return res; }); @@ -740,12 +842,28 @@ namespace Vocaluxe.Base int res = s1.SortString.CompareTo(s2.SortString); if (res == 0) { - res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); - if (res == 0) + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); + string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); + res = string1.CompareTo(string2); + if (res == 0) + { + string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); + string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); + return string1.CompareTo(string2); + } + return res; + } + else + { + res = _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (res == 0) + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } + return res; } - return res; } return res; }); @@ -920,5 +1038,10 @@ namespace Vocaluxe.Base _CoverLoaded = true; CDataBase.CommitCovers(); } + + private static string IgnoreArticle(string _string) + { + return Regex.Replace(_string, @"^\s*(de|het|de|der|die|das|des|dem|den|the|el|la|lo|los|las|le|la|les|il|lo|la|i|gli|a|az)\s+", string.Empty, RegexOptions.IgnoreCase); + } } } From 249b91d3277beddfe78c1983e046b51b6f128ce3 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 2 Jun 2012 11:50:20 +0200 Subject: [PATCH 2/8] Changed ignore-articles function to tag-based. --- Vocaluxe/Base/CSongs.cs | 78 ++++++++++++++++---------------------- Vocaluxe/Lib/Song/CSong.cs | 26 +++++++++++++ 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index 973c3a2f..7af52f36 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -355,14 +355,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); - string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); - res = string1.CompareTo(string2); + res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } @@ -425,14 +421,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); - string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); - res = string1.CompareTo(string2); + res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } @@ -514,14 +506,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); - string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); - res = string1.CompareTo(string2); + res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } @@ -561,14 +549,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(s1.SortString.ToUpper()); - string string2 = IgnoreArticle(s2.SortString.ToUpper()); - int res = string1.CompareTo(string2); + int res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } @@ -600,7 +584,7 @@ namespace Vocaluxe.Base foreach (CSong song in _SongList) { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) - _SortList.Add(new SongPointer(song.ID, IgnoreArticle(song.Artist))); + _SortList.Add(new SongPointer(song.ID, song.ArtistSorting)); else _SortList.Add(new SongPointer(song.ID, song.Artist)); } @@ -610,7 +594,14 @@ namespace Vocaluxe.Base int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); if (res == 0) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) + { + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); + } + else + { + return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Title.ToUpper()); + } } return res; }); @@ -651,7 +642,7 @@ namespace Vocaluxe.Base foreach (CSong song in _SongList) { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) - _SortList.Add(new SongPointer(song.ID, IgnoreArticle(song.Title))); + _SortList.Add(new SongPointer(song.ID, song.TitleSorting)); else _SortList.Add(new SongPointer(song.ID, song.Title)); } @@ -661,7 +652,14 @@ namespace Vocaluxe.Base int res = s1.SortString.ToUpper().CompareTo(s2.SortString.ToUpper()); if (res == 0) { - return _Songs[s1.SongID].Title.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) + { + return _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); + } + else + { + return _Songs[s1.SongID].Artist.ToUpper().CompareTo(_Songs[s2.SongID].Artist.ToUpper()); + } } return res; }); @@ -711,14 +709,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); - string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); - res = string1.CompareTo(string2); + res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } @@ -774,14 +768,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); - string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); - res = string1.CompareTo(string2); + res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } @@ -844,14 +834,10 @@ namespace Vocaluxe.Base { if (CConfig.IgnoreArticles == EOffOn.TR_CONFIG_ON) { - string string1 = IgnoreArticle(_Songs[s1.SongID].Artist.ToUpper()); - string string2 = IgnoreArticle(_Songs[s2.SongID].Artist.ToUpper()); - res = string1.CompareTo(string2); + res = _Songs[s1.SongID].ArtistSorting.ToUpper().CompareTo(_Songs[s2.SongID].ArtistSorting.ToUpper()); if (res == 0) { - string1 = IgnoreArticle(_Songs[s1.SongID].Title.ToUpper()); - string2 = IgnoreArticle(_Songs[s2.SongID].Title.ToUpper()); - return string1.CompareTo(string2); + return _Songs[s1.SongID].TitleSorting.ToUpper().CompareTo(_Songs[s2.SongID].TitleSorting.ToUpper()); } return res; } diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 03d69a0f..fee895b1 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -89,6 +89,9 @@ namespace Vocaluxe.Lib.Song public string Title = String.Empty; public string Artist = String.Empty; + public string TitleSorting = String.Empty; + public string ArtistSorting = String.Empty; + public float Start = 0f; public float Finish = 0f; @@ -239,6 +242,18 @@ namespace Vocaluxe.Lib.Song HeaderFlags |= EHeaderFlags.Artist; } break; + case "TITLE-ON-SORTING": + if (Value != String.Empty) + { + this.TitleSorting = Value; + } + break; + case "ARTIST-ON-SORTING": + if (Value != String.Empty) + { + this.ArtistSorting = Value; + } + break; case "MP3": if (File.Exists(Path.Combine(this.Folder, Value))) { @@ -340,6 +355,17 @@ namespace Vocaluxe.Lib.Song CheckFiles(); + //Before saving this tags to .txt: Check, if ArtistSorting and Artist are equal, then don't save this tag. + if (this.ArtistSorting == "") + { + this.ArtistSorting = this.Artist; + } + + if (this.TitleSorting == "") + { + this.TitleSorting = this.Title; + } + return true; } From efb16a9885ad09fbd289169733a739be2a40e05a Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 2 Jun 2012 11:51:24 +0200 Subject: [PATCH 3/8] Delete IgnoreArticles()-Method. --- Vocaluxe/Base/CSongs.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index 7af52f36..ca09584d 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -1024,10 +1024,5 @@ namespace Vocaluxe.Base _CoverLoaded = true; CDataBase.CommitCovers(); } - - private static string IgnoreArticle(string _string) - { - return Regex.Replace(_string, @"^\s*(de|het|de|der|die|das|des|dem|den|the|el|la|lo|los|las|le|la|les|il|lo|la|i|gli|a|az)\s+", string.Empty, RegexOptions.IgnoreCase); - } } } From 111194f272199c10f8c2fd27b53bc9caef8ced12 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 2 Jun 2012 12:48:33 +0200 Subject: [PATCH 4/8] Fix adding german umlaute to categories. --- Vocaluxe/Base/CSongs.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Vocaluxe/Base/CSongs.cs b/Vocaluxe/Base/CSongs.cs index ca09584d..eeaf0d1a 100644 --- a/Vocaluxe/Base/CSongs.cs +++ b/Vocaluxe/Base/CSongs.cs @@ -613,6 +613,20 @@ namespace Vocaluxe.Base for (int i=0; i < _SongsSortList.Length; i++) { Char firstLetter = Char.ToUpper(_SongsSortList[i].SortString[0]); + + //Fix for german Umlaute + switch (firstLetter) + { + case 'Ä': + firstLetter = 'A'; + break; + case 'Ö': + firstLetter = 'O'; + break; + case 'Ü': + firstLetter = 'U'; + break; + } if (!Char.IsLetter(firstLetter)) { @@ -671,6 +685,20 @@ namespace Vocaluxe.Base for (int i=0; i < _SongsSortList.Length; i++) { Char firstLetter = Char.ToUpper(_SongsSortList[i].SortString[0]); + + //Fix for german Umlaute + switch (firstLetter) + { + case 'Ä': + firstLetter = 'A'; + break; + case 'Ö': + firstLetter = 'O'; + break; + case 'Ü': + firstLetter = 'U'; + break; + } if (!Char.IsLetter(firstLetter)) { From 8d6f46b93ecd4eb0e6281ea517b3aa8e839e7c97 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 2 Jun 2012 15:10:58 +0200 Subject: [PATCH 5/8] Nicer lyrics-animation for "jump". --- Vocaluxe/Menu/CLyric.cs | 82 ++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 18 deletions(-) diff --git a/Vocaluxe/Menu/CLyric.cs b/Vocaluxe/Menu/CLyric.cs index de71cb05..bc4bbbab 100644 --- a/Vocaluxe/Menu/CLyric.cs +++ b/Vocaluxe/Menu/CLyric.cs @@ -444,37 +444,49 @@ namespace Vocaluxe.Menu { float x = _X - _width / 2; // most left position - foreach (SNote note in _Notes) + //find last active note + int last_note = -1; + for (int i = 0; i < _Notes.Count; i++) + { + if (CurrentBeat >= _Notes[i].StartBeat) + last_note = i; + } + + int jump_note = -1; + int end_beat = -1; + float jumpx = 0f; + + for (int note = 0; note < _Notes.Count; note++) { _Text.X = x; _Text.Style = EStyle.Bold; - _Text.Text = note.Text; + _Text.Text = _Notes[note].Text; RectangleF rect = CDraw.GetTextBounds(_Text); - if (note.Type == ENoteType.Freestyle) + if (_Notes[note].Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; - if (CurrentBeat >= note.StartBeat) + if (CurrentBeat >= _Notes[note].StartBeat) { - if (CurrentBeat <= note.EndBeat) + bool last = note == _Notes.Count - 1; + int endbeat = _Notes[note].EndBeat; + if (note < _Notes.Count - 1) + endbeat = _Notes[note + 1].StartBeat - 1; + + if (CurrentBeat <= _Notes[note].EndBeat) { - _Text.Color = ColorProcessed; - - float diff = note.EndBeat - note.StartBeat; - if (diff == 0) - _Text.Draw(); - else - { - float y = _Text.Y; - _Text.Y -= _Text.Height * 0.1f; - _Text.Draw(); - _Text.Y = y; - } + jump_note = note; + end_beat = endbeat; + jumpx = _Text.X; } else { // already passed - _Text.Color = Color; + if (note == last_note) + _Text.Color = ColorProcessed; + else + _Text.Color = Color; + _Text.Draw(); } @@ -488,6 +500,40 @@ namespace Vocaluxe.Menu x += rect.Width; } + + if (jump_note > 0) + { + if (_Notes[jump_note].Duration == 0) + return; + + _Text.X = jumpx; + _Text.Text = _Notes[jump_note].Text; + _Text.Color = ColorProcessed; + _Text.Style = EStyle.Bold; + + if (_Notes[jump_note].Type == ENoteType.Freestyle) + _Text.Style = EStyle.BoldItalic; + + float diff = _Notes[jump_note].EndBeat - _Notes[jump_note].StartBeat; + if (diff <= 0f) + diff = 1f; + + float p = (CurrentBeat - _Notes[jump_note].StartBeat) / diff; + if (p > 1f) + p = 1f; + + p = 1f - p; + + if (diff == 1) + _Text.Draw(); + else + { + float y = _Text.Y; + _Text.Y -= _Text.Height * 0.1f * p; + _Text.Draw(); + _Text.Y = y; + } + } } #endregion draw From 37cef42151747db380c831cbbc465ca653b7269a Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 12 Jun 2012 18:21:07 +0200 Subject: [PATCH 6/8] some theme-fixes & change colors of skins (yellow skin is really yellow now and so on...) --- Output/Themes/Ambient.xml | 7 +- .../Ambient/Screens/ScreenOptionsSound.xml | 12 +- Output/Themes/Ambient/Screens/ScreenSing.xml | 15 +-- Output/Themes/Ambient/Skin Blue.xml | 6 + Output/Themes/Ambient/Skin Green.xml | 102 +++++++++-------- Output/Themes/Ambient/Skin Red.xml | 104 +++++++++-------- Output/Themes/Ambient/Skin Yellow.xml | 108 +++++++++--------- 7 files changed, 180 insertions(+), 174 deletions(-) diff --git a/Output/Themes/Ambient.xml b/Output/Themes/Ambient.xml index 25940dca..a1ed18a6 100644 --- a/Output/Themes/Ambient.xml +++ b/Output/Themes/Ambient.xml @@ -12,9 +12,6 @@ Cursor 40,000 40,000 - 0,675 - 0,890 - 0,969 - 1,000 + StaticColor - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml index 35751819..756d6a5c 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsSound.xml @@ -40,16 +40,10 @@ - 0,68 - 0,89 - 0,97 - 1,00 + StaticColor - 0,68 - 0,89 - 0,97 - 1,00 + TextSColor Center @@ -394,4 +388,4 @@ 1 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenSing.xml b/Output/Themes/Ambient/Screens/ScreenSing.xml index 5a9c9359..19ad9bea 100644 --- a/Output/Themes/Ambient/Screens/ScreenSing.xml +++ b/Output/Themes/Ambient/Screens/ScreenSing.xml @@ -170,10 +170,7 @@ 45 - 0,00 - 0,00 - 1,00 - 0,50 + LyricHelper @@ -189,10 +186,7 @@ 45 - 0,00 - 0,00 - 1,00 - 0,50 + LyricHelper @@ -208,10 +202,7 @@ 45 - 0,00 - 0,00 - 1,00 - 0,50 + LyricHelper diff --git a/Output/Themes/Ambient/Skin Blue.xml b/Output/Themes/Ambient/Skin Blue.xml index cdf16630..35193f64 100644 --- a/Output/Themes/Ambient/Skin Blue.xml +++ b/Output/Themes/Ambient/Skin Blue.xml @@ -250,6 +250,12 @@ 0,300 1,000 + + 0,00 + 0,00 + 1,00 + 0,50 + 0,800 0,950 diff --git a/Output/Themes/Ambient/Skin Green.xml b/Output/Themes/Ambient/Skin Green.xml index 1d3893fe..3534c3f8 100644 --- a/Output/Themes/Ambient/Skin Green.xml +++ b/Output/Themes/Ambient/Skin Green.xml @@ -120,86 +120,86 @@ 0,000 - 0,000 - 0,750 + 0,750 + 0,000 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 0,300 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 0,300 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,709 + 0,968 + 0,674 1,000 @@ -234,8 +234,8 @@ 0,000 - 0,000 - 1,000 + 1,000 + 0,000 1,000 @@ -250,17 +250,23 @@ 0,300 1,000 + + 0,00 + 1,00 + 0,00 + 0,50 + 0,800 - 0,950 - 1,000 + 1,000 + 0,811 0,500 0,800 - 0,950 - 1,000 - 0,850 + 1,000 + 0,811 + 0,811 diff --git a/Output/Themes/Ambient/Skin Red.xml b/Output/Themes/Ambient/Skin Red.xml index 828c675f..80d8a302 100644 --- a/Output/Themes/Ambient/Skin Red.xml +++ b/Output/Themes/Ambient/Skin Red.xml @@ -119,87 +119,87 @@ 0,400 - 0,000 + 0,750 0,000 - 0,750 + 0,000 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 0,300 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 0,300 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,968 + 0,674 + 0,674 1,000 @@ -233,9 +233,9 @@ 0,000 - 0,000 + 1,000 0,000 - 1,000 + 0,000 1,000 @@ -250,16 +250,22 @@ 0,300 1,000 + + 1,00 + 0,00 + 0,00 + 0,50 + - 0,800 - 0,950 - 1,000 + 1,000 + 0,800 + 0,800 0,500 - 0,800 - 0,950 - 1,000 + 1,000 + 0,800 + 0,800 0,850 diff --git a/Output/Themes/Ambient/Skin Yellow.xml b/Output/Themes/Ambient/Skin Yellow.xml index 7cbee310..5035f58b 100644 --- a/Output/Themes/Ambient/Skin Yellow.xml +++ b/Output/Themes/Ambient/Skin Yellow.xml @@ -119,87 +119,87 @@ 0,400 - 0,000 - 0,000 - 0,750 + 0,750 + 0,750 + 0,000 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 0,300 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 0,300 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 0,500 - 0,675 - 0,890 - 0,969 + 0,968 + 0,956 + 0,674 1,000 @@ -233,9 +233,9 @@ 0,000 - 0,000 - 0,000 - 1,000 + 1,000 + 1,000 + 0,000 1,000 @@ -250,16 +250,22 @@ 0,300 1,000 + + 1,00 + 1,00 + 0,00 + 0,50 + - 0,800 - 0,950 - 1,000 + 0,949 + 1,000 + 0,800 0,500 - 0,800 - 0,950 - 1,000 + 0,949 + 1,000 + 0,800 0,850 From 114dbe6965b4d916cd4ebeabedc3ce47fa2ab3cb Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Tue, 12 Jun 2012 18:22:08 +0200 Subject: [PATCH 7/8] Reload (hopefully) all colors now on skin-change. --- Vocaluxe/Menu/CGraphics.cs | 10 ++++++ Vocaluxe/Menu/CNameSelection.cs | 35 ++++++++++++++------ Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs | 1 + 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Vocaluxe/Menu/CGraphics.cs b/Vocaluxe/Menu/CGraphics.cs index ac7fa531..092a777d 100644 --- a/Vocaluxe/Menu/CGraphics.cs +++ b/Vocaluxe/Menu/CGraphics.cs @@ -690,6 +690,16 @@ namespace Vocaluxe.Menu { _Cursor.UnloadTextures(); + if (CTheme.Cursor.color != string.Empty) + { + SColorF color; + color = CTheme.GetColor(CTheme.Cursor.color); + CTheme.Cursor.r = color.R; + CTheme.Cursor.g = color.G; + CTheme.Cursor.b = color.B; + CTheme.Cursor.a = color.A; + } + _Cursor = new CCursor( CTheme.Cursor.SkinName, new SColorF(CTheme.Cursor.r, CTheme.Cursor.g, CTheme.Cursor.b, CTheme.Cursor.a), diff --git a/Vocaluxe/Menu/CNameSelection.cs b/Vocaluxe/Menu/CNameSelection.cs index b11d65c4..5a539c7c 100644 --- a/Vocaluxe/Menu/CNameSelection.cs +++ b/Vocaluxe/Menu/CNameSelection.cs @@ -90,17 +90,7 @@ namespace Vocaluxe.Menu public void Init() { - _Tiles.Clear(); - for (int i = 0; i < _NumH; i++) - { - for (int j = 0; j < _NumW; j++) - { - SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z); - CStatic tileStatic = new CStatic(_TextureEmptyTile, ColorEmptyTile, rect); - CText tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle, _Theme.NameFont, _Theme.NameColor, ""); - _Tiles.Add(new CTile(tileStatic, tileText, -1)); - } - } + PrepareTiles(); PlayerSelector = new CStatic(); PlayerSelector.Texture = _TextureTileSelected; @@ -482,12 +472,35 @@ namespace Vocaluxe.Menu { _TextureEmptyTile = CTheme.GetSkinTexture(_Theme.TextureEmptyTileName); _TextureTileSelected = CTheme.GetSkinTexture(_Theme.TextureTileSelectedName); + + if (_Theme.ColorEmptyTileName != String.Empty) + ColorEmptyTile = CTheme.GetColor(_Theme.ColorEmptyTileName); + + if (_Theme.NameColorName != String.Empty) + _Theme.NameColor = CTheme.GetColor(_Theme.NameColorName); } public void ReloadTextures() { UnloadTextures(); LoadTextures(); + + PrepareTiles(); + } + + private void PrepareTiles() + { + _Tiles.Clear(); + for (int i = 0; i < _NumH; i++) + { + for (int j = 0; j < _NumW; j++) + { + SRectF rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z); + CStatic tileStatic = new CStatic(_TextureEmptyTile, ColorEmptyTile, rect); + CText tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle, _Theme.NameFont, _Theme.NameColor, ""); + _Tiles.Add(new CTile(tileStatic, tileText, -1)); + } + } } private void UpdateVisibleProfiles() diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 558cb093..48868a32 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -654,6 +654,7 @@ namespace Vocaluxe.Menu.SongMenu _Theme.songMenuTileBoard.TextArtist.ReloadTextures(); _Theme.songMenuTileBoard.TextTitle.ReloadTextures(); + _Theme.songMenuTileBoard.TextSongLength.ReloadTextures(); } } } From d6557de01c3a0c194b5a61d6d4e72cd3005d03de Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Sat, 16 Jun 2012 17:17:45 +0200 Subject: [PATCH 8/8] Added lyrics-options to new screen. TODO: Update languages (spanish + frensh) --- Output/Languages/Deutsch.xml | 5 + Output/Languages/English.xml | 5 + .../Themes/Ambient/Screens/ScreenOptions.xml | 67 +++- .../Ambient/Screens/ScreenOptionsLyrics.xml | 299 ++++++++++++++++++ .../Changelog_ScreenOptionsLyrics.txt | 17 + Vocaluxe/Menu/CGraphics.cs | 8 +- Vocaluxe/Screens/CScreenOptions.cs | 9 +- Vocaluxe/Screens/CScreenOptionsLyrics.cs | 124 ++++++++ Vocaluxe/Vocaluxe.csproj | 1 + 9 files changed, 525 insertions(+), 10 deletions(-) create mode 100644 Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml create mode 100644 Output/Themes/Changelog/Changelog_ScreenOptionsLyrics.txt create mode 100644 Vocaluxe/Screens/CScreenOptionsLyrics.cs diff --git a/Output/Languages/Deutsch.xml b/Output/Languages/Deutsch.xml index ecb1c632..b286b0ad 100644 --- a/Output/Languages/Deutsch.xml +++ b/Output/Languages/Deutsch.xml @@ -152,6 +152,7 @@ Sound Aufnahme Video + Songtext Design Spieleinstellungen @@ -186,6 +187,10 @@ Aussehen des Timers Spieler-Infos ein/ausblenden Cover Ladeverhalten + + Songtexteinstellungen + Stil + Oben anzeigen Videoeinstellungen Video-Hintergründe diff --git a/Output/Languages/English.xml b/Output/Languages/English.xml index e40c62d2..6037e02e 100644 --- a/Output/Languages/English.xml +++ b/Output/Languages/English.xml @@ -152,6 +152,7 @@ Sound Record Video + Lyrics Theme Game Options @@ -186,6 +187,10 @@ Timer-Look Fade player-info Cover Loading Behavior + + Lyrics Options + Style + Lyrics on top Video Options Video Backgrounds diff --git a/Output/Themes/Ambient/Screens/ScreenOptions.xml b/Output/Themes/Ambient/Screens/ScreenOptions.xml index 9bf1033a..03cf6f05 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptions.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptions.xml @@ -62,7 +62,7 @@ Button - 145 + 54,7 600 0,00 150 @@ -117,7 +117,7 @@ Button - 355 + 259,4 600 0,00 150 @@ -172,7 +172,7 @@ Button - 565 + 464,1 600 0,00 150 @@ -227,7 +227,7 @@ Button - 775 + 668,8 600 0,00 150 @@ -276,13 +276,68 @@ 26 + + + Button + + Button + + 873,5 + 600 + 0,00 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + TR_SCREENO_BUTTON_LYRICS + + + + + + 10 + 26 + + + + + + 10 + 26 + + Button Button - 985 + 1078,2 600 0,00 150 @@ -332,4 +387,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml new file mode 100644 index 00000000..bf79c927 --- /dev/null +++ b/Output/Themes/Ambient/Screens/ScreenOptionsLyrics.xml @@ -0,0 +1,299 @@ + + + + 1 + + + Video + + + + BG_Options + + + BackgroundColor + + + + Menu + + 40 + 40 + 0,00 + 1200 + 50 + + + StaticColor + + + + + + + 640 + 48 + + 0,00 + + 32 + + + + StaticColor + + + TextSColor + + Center + + + + Outline + + TR_SCREENOLYRICS_OPTIONS + + + + + + + 75 + 105 + + 0,00 + + 32 + + + + StaticColor + + + TextSColor + + Left + + + + Outline + + TR_SCREENOLYRICS_STYLE + + + + + + + 75 + 165 + + 0,00 + + 32 + + + + StaticColor + + + TextSColor + + Left + + + + Outline + + TR_SCREENOLYRICS_ONTOP + + + + + + + Button + + Button + + 145 + 600 + 0,00 + 150 + 50 + + + ButtonColor + + + ButtonSColor + + + 75 + 10 + + 32 + + 142 + + + ButtonTextColor + + + ButtonTextSColor + + Center + + + + Outline + + TR_BUTTON_BACK + + + + + + 10 + 26 + + + + + + 10 + 26 + + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 500 + 100 + 0,00 + 700 + 50 + + 505 + 105 + 0,00 + 40 + 40 + + 1170 + 105 + 0,00 + 40 + 40 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 32,00 + + 205,33 + + Outline + + Bold + + 4 + + + + Invisible + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + SelectSlideArrowLeft + + SelectSlideArrowRight + + SelectSlide + + 500 + 160 + 0,00 + 700 + 50 + + 505 + 165 + 0,00 + 40 + 40 + + 1170 + 165 + 0,00 + 40 + 40 + + + SelectSlideColor + + + SelectSlideSColor + + + SelectSlideHColor + + + ArrowColor + + + ArrowSColor + + + TextColor + + + TextSColor + + 32,00 + + 205,33 + + Outline + + Bold + + 2 + + + diff --git a/Output/Themes/Changelog/Changelog_ScreenOptionsLyrics.txt b/Output/Themes/Changelog/Changelog_ScreenOptionsLyrics.txt new file mode 100644 index 00000000..8af47a1e --- /dev/null +++ b/Output/Themes/Changelog/Changelog_ScreenOptionsLyrics.txt @@ -0,0 +1,17 @@ +ScreenOptionsSound + +++++++++++ +Version 1: + +Add: + + + + + + +and some texts for description (Text1, Text2, Text3) +TR_SCREENOLYRICS_OPTIONS +TR_SCREENOLYRICS_STYLE +TR_SCREENOLYRICS_ONTOP +++++++++++ diff --git a/Vocaluxe/Menu/CGraphics.cs b/Vocaluxe/Menu/CGraphics.cs index 092a777d..d0363134 100644 --- a/Vocaluxe/Menu/CGraphics.cs +++ b/Vocaluxe/Menu/CGraphics.cs @@ -27,11 +27,12 @@ namespace Vocaluxe.Menu ScreenOptionsSound = 10, ScreenOptionsRecord = 11, ScreenOptionsVideo = 12, - ScreenOptionsTheme = 13, + ScreenOptionsLyrics = 13, + ScreenOptionsTheme = 14, - ScreenNames = 14, + ScreenNames = 15, - ScreenCredits = 15, + ScreenCredits = 16, ScreenNull = -1 } @@ -228,6 +229,7 @@ namespace Vocaluxe.Menu _Screens.Add(new CScreenOptionsSound()); _Screens.Add(new CScreenOptionsRecord()); _Screens.Add(new CScreenOptionsVideo()); + _Screens.Add(new CScreenOptionsLyrics()); _Screens.Add(new CScreenOptionsTheme()); _Screens.Add(new CScreenNames()); _Screens.Add(new CScreenCredits()); diff --git a/Vocaluxe/Screens/CScreenOptions.cs b/Vocaluxe/Screens/CScreenOptions.cs index 0e22fba7..851919bf 100644 --- a/Vocaluxe/Screens/CScreenOptions.cs +++ b/Vocaluxe/Screens/CScreenOptions.cs @@ -18,6 +18,7 @@ namespace Vocaluxe.Screens private const string ButtonOptionsSound = "ButtonOptionsSound"; private const string ButtonOptionsRecord = "ButtonOptionsRecord"; private const string ButtonOptionsVideo = "ButtonOptionsVideo"; + private const string ButtonOptionsLyrics = "ButtonOptionsLyrics"; private const string ButtonOptionsTheme = "ButtonOptionsTheme"; public CScreenOptions() @@ -31,7 +32,7 @@ namespace Vocaluxe.Screens _ThemeName = "ScreenOptions"; _ScreenVersion = ScreenVersion; - _ThemeButtons = new string[] { ButtonOptionsGame, ButtonOptionsSound, ButtonOptionsRecord, ButtonOptionsVideo, ButtonOptionsTheme }; + _ThemeButtons = new string[] { ButtonOptionsGame, ButtonOptionsSound, ButtonOptionsRecord, ButtonOptionsVideo, ButtonOptionsLyrics, ButtonOptionsTheme }; } public override bool HandleInput(KeyEvent KeyEvent) @@ -68,6 +69,9 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonOptionsVideo)].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsVideo); + if (Buttons[htButtons(ButtonOptionsLyrics)].Selected) + CGraphics.FadeTo(EScreens.ScreenOptionsLyrics); + if (Buttons[htButtons(ButtonOptionsTheme)].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsTheme); @@ -95,6 +99,9 @@ namespace Vocaluxe.Screens if (Buttons[htButtons(ButtonOptionsVideo)].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsVideo); + if (Buttons[htButtons(ButtonOptionsLyrics)].Selected) + CGraphics.FadeTo(EScreens.ScreenOptionsLyrics); + if (Buttons[htButtons(ButtonOptionsTheme)].Selected) CGraphics.FadeTo(EScreens.ScreenOptionsTheme); } diff --git a/Vocaluxe/Screens/CScreenOptionsLyrics.cs b/Vocaluxe/Screens/CScreenOptionsLyrics.cs new file mode 100644 index 00000000..6224f0fa --- /dev/null +++ b/Vocaluxe/Screens/CScreenOptionsLyrics.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +using Vocaluxe.Base; +using Vocaluxe.Menu; + +namespace Vocaluxe.Screens +{ + class CScreenOptionsLyrics : CMenu + { + // Version number for theme files. Increment it, if you've changed something on the theme files! + const int ScreenVersion = 1; + + private const string SelectSlideLyricStyle = "SelectSlideLyricStyle"; + private const string SelectSlideLyricsOnTop = "SelectSlideLyricsOnTop"; + + private const string ButtonExit = "ButtonExit"; + + public CScreenOptionsLyrics() + { + Init(); + } + + protected override void Init() + { + base.Init(); + + _ThemeName = "ScreenOptionsLyrics"; + _ScreenVersion = ScreenVersion; + + _ThemeButtons = new string[] { ButtonExit }; + _ThemeSelectSlides = new string[] { SelectSlideLyricStyle, SelectSlideLyricsOnTop }; + } + + public override void LoadTheme() + { + base.LoadTheme(); + SelectSlides[htSelectSlides(SelectSlideLyricStyle)].SetValues((int)CConfig.LyricStyle); + SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].SetValues((int)CConfig.LyricsOnTop); + } + + public override bool HandleInput(KeyEvent KeyEvent) + { + base.HandleInput(KeyEvent); + + if (KeyEvent.KeyPressed) + { + + } + else + { + switch (KeyEvent.Key) + { + case Keys.Escape: + case Keys.Back: + SaveConfig(); + CGraphics.FadeTo(EScreens.ScreenOptions); + break; + + case Keys.S: + CGraphics.FadeTo(EScreens.ScreenSong); + break; + + case Keys.Enter: + if (Buttons[htButtons(ButtonExit)].Selected) + { + SaveConfig(); + CGraphics.FadeTo(EScreens.ScreenOptions); + } + break; + + case Keys.Left: + SaveConfig(); + break; + + case Keys.Right: + SaveConfig(); + break; + } + } + return true; + } + + public override bool HandleMouse(MouseEvent MouseEvent) + { + base.HandleMouse(MouseEvent); + + if (MouseEvent.RB) + { + SaveConfig(); + CGraphics.FadeTo(EScreens.ScreenOptions); + } + if (MouseEvent.LB && IsMouseOver(MouseEvent)) + { + SaveConfig(); + if (Buttons[htButtons(ButtonExit)].Selected) + { + CGraphics.FadeTo(EScreens.ScreenOptions); + } + } + return true; + } + + public override bool UpdateGame() + { + return true; + } + + public override bool Draw() + { + base.Draw(); + return true; + } + + private void SaveConfig() + { + CConfig.LyricsOnTop = (EOffOn)SelectSlides[htSelectSlides(SelectSlideLyricsOnTop)].Selection; + CConfig.LyricStyle = (ELyricStyle)SelectSlides[htSelectSlides(SelectSlideLyricStyle)].Selection; + CConfig.SaveConfig(); + } + } +} diff --git a/Vocaluxe/Vocaluxe.csproj b/Vocaluxe/Vocaluxe.csproj index e8282b61..459146bf 100644 --- a/Vocaluxe/Vocaluxe.csproj +++ b/Vocaluxe/Vocaluxe.csproj @@ -197,6 +197,7 @@ +