From fdef790583785f59d974635aa0f703261c3ab5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 12:07:52 +0200 Subject: [PATCH 01/10] More work on jump-to-function. Should it be active in 0.3? There is still something to do. --- Vocaluxe/Screens/CScreenSong.cs | 36 +++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 40e9582d..35c9595e 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -1005,12 +1005,40 @@ namespace Vocaluxe.Screens int curSelected = _SongMenus[_SongMenu].GetActualSelection(); if (CSongs.IsInCategory) { - //TODO: Check and use sorting method + //TODO: What's to do with multiple tags? + //How can we get current letter? I think we have to save it - Or is there a better method? ReadOnlyCollection songs = CSongs.VisibleSongs; int ct = songs.Count; - if (curSelected >= 0 && curSelected < ct - 1 && songs[curSelected].Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)) - start = curSelected + 1; - int visibleID = _FindIndex(songs, start, element => element.Artist.StartsWith(letter.ToString(), StringComparison.OrdinalIgnoreCase)); + int visibleID = -1; + switch (CConfig.SongSorting) + { + 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)); + break; + + //TODO: Does this make sense? Maybe we should deactivate this for years? You could only jump between 1 and 2 + 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)); + 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)); + 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)); + break; + } if (visibleID > -1) _SongMenus[_SongMenu].SetSelectedSong(visibleID); } From 8fabde717fc42b22047ee24c717cbce2220dd156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 12:49:29 +0200 Subject: [PATCH 02/10] Added second level to jump-to. --- Vocaluxe/Screens/CScreenSong.cs | 34 +++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 35c9595e..40ce96d3 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -1003,7 +1003,13 @@ namespace Vocaluxe.Screens { int start = 0; int curSelected = _SongMenus[_SongMenu].GetActualSelection(); - if (CSongs.IsInCategory) + bool firstLevel = CConfig.Tabs == EOffOn.TR_CONFIG_OFF && CSongs.IsInCategory; + bool secondSort = CConfig.Tabs == EOffOn.TR_CONFIG_ON && + (CConfig.SongSorting == ESongSorting.TR_CONFIG_ARTIST || + CConfig.SongSorting == ESongSorting.TR_CONFIG_ARTIST_LETTER || + CConfig.SongSorting == ESongSorting.TR_CONFIG_FOLDER || + CConfig.SongSorting == ESongSorting.TR_CONFIG_TITLE_LETTER); + if (firstLevel && !secondSort) { //TODO: What's to do with multiple tags? //How can we get current letter? I think we have to save it - Or is there a better method? @@ -1042,7 +1048,31 @@ namespace Vocaluxe.Screens if (visibleID > -1) _SongMenus[_SongMenu].SetSelectedSong(visibleID); } - else + else if (secondSort && CSongs.IsInCategory) + { + ReadOnlyCollection songs = CSongs.VisibleSongs; + int ct = songs.Count; + int visibleID = -1; + switch (CConfig.SongSorting) + { + 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)); + 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)); + break; + } + if (visibleID > -1) + _SongMenus[_SongMenu].SetSelectedSong(visibleID); + } + else if(!CSongs.IsInCategory) { ReadOnlyCollection categories = CSongs.Categories; int ct = categories.Count; From 42e1d5c46337c6099bb7b0465a12b154ec711914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 14:05:17 +0200 Subject: [PATCH 03/10] Disable jump-to in party-modes. --- 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 40ce96d3..c9a869a3 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -172,7 +172,7 @@ namespace Vocaluxe.Screens { if (_SearchActive) _ApplyNewSearchFilter(_SearchText + keyEvent.Unicode); - else + else if(!_Sso.Selection.PartyMode) { _JumpTo(keyEvent.Unicode); return true; From bfc41c7678ce3beb4b4a077dc61763ec5f80c782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 14:10:17 +0200 Subject: [PATCH 04/10] Could use num-block for jokers in party-mode. --- Vocaluxe/Screens/CScreenSong.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index c9a869a3..ba5216e7 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -284,26 +284,32 @@ namespace Vocaluxe.Screens break; case Keys.D1: + case Keys.NumPad1: _SelectNextRandom(0); break; case Keys.D2: + case Keys.NumPad2: _SelectNextRandom(1); break; case Keys.D3: + case Keys.NumPad3: _SelectNextRandom(2); break; case Keys.D4: + case Keys.NumPad4: _SelectNextRandom(3); break; case Keys.D5: + case Keys.NumPad5: _SelectNextRandom(4); break; case Keys.D6: + case Keys.NumPad6: _SelectNextRandom(5); break; } From 81a9486091acb601164b1917815a7dfb1b2389b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 14:22:56 +0200 Subject: [PATCH 05/10] =?UTF-8?q?Fix=20sorting=20('=C3=84'=20was=20after?= =?UTF-8?q?=20'Z')=20-=20Is=20this=20okay=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vocaluxe/Base/CSongSorter.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Vocaluxe/Base/CSongSorter.cs b/Vocaluxe/Base/CSongSorter.cs index 161f3eb4..1c427fcf 100644 --- a/Vocaluxe/Base/CSongSorter.cs +++ b/Vocaluxe/Base/CSongSorter.cs @@ -86,28 +86,28 @@ namespace Vocaluxe.Base private int _SortByFieldArtistTitle(CSongPointer s1, CSongPointer s2) { - int res = String.Compare(s1.SortString, s2.SortString, StringComparison.OrdinalIgnoreCase); + int res = String.Compare(s1.SortString, s2.SortString, StringComparison.CurrentCultureIgnoreCase); if (res == 0) { if (_IgnoreArticles == EOffOn.TR_CONFIG_ON) { - res = String.Compare(CSongs.Songs[s1.SongID].ArtistSorting, CSongs.Songs[s2.SongID].ArtistSorting, StringComparison.OrdinalIgnoreCase); - return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase); + res = String.Compare(CSongs.Songs[s1.SongID].ArtistSorting, CSongs.Songs[s2.SongID].ArtistSorting, StringComparison.CurrentCultureIgnoreCase); + return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.CurrentCultureIgnoreCase); } - res = String.Compare(CSongs.Songs[s1.SongID].Artist, CSongs.Songs[s2.SongID].Artist, StringComparison.OrdinalIgnoreCase); - return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase); + res = String.Compare(CSongs.Songs[s1.SongID].Artist, CSongs.Songs[s2.SongID].Artist, StringComparison.CurrentCultureIgnoreCase); + return res != 0 ? res : String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.CurrentCultureIgnoreCase); } return res; } private int _SortByFieldTitle(CSongPointer s1, CSongPointer s2) { - int res = String.Compare(s1.SortString, s2.SortString, StringComparison.OrdinalIgnoreCase); + int res = String.Compare(s1.SortString, s2.SortString, StringComparison.CurrentCultureIgnoreCase); if (res == 0) { return _IgnoreArticles == EOffOn.TR_CONFIG_ON - ? String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.OrdinalIgnoreCase) : - String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.OrdinalIgnoreCase); + ? String.Compare(CSongs.Songs[s1.SongID].TitleSorting, CSongs.Songs[s2.SongID].TitleSorting, StringComparison.CurrentCultureIgnoreCase) : + String.Compare(CSongs.Songs[s1.SongID].Title, CSongs.Songs[s2.SongID].Title, StringComparison.CurrentCultureIgnoreCase); } return res; } From 6bdfb49cbbd6c1638221dc6f6f46fafb45a9ea09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 14:46:01 +0200 Subject: [PATCH 06/10] Fixed double-click-bug on screen-song. --- Vocaluxe/Screens/CScreenSong.cs | 4 +--- VocaluxeLib/Menu/SongMenu/CSongMenu.cs | 5 +++++ VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs | 2 ++ VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs | 9 +++++++++ VocaluxeLib/Menu/SongMenu/ISongMenu.cs | 2 ++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index ba5216e7..5cccfc67 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -449,9 +449,7 @@ namespace Vocaluxe.Screens if (mouseEvent.LD && !_Sso.Selection.PartyMode) { - //TODO: Causes Bug if you select a song (e.g. with Select random song) and double click a normal button. - //E.g. clicking to fast on Select random song starts the next random song. is this OK? - if (CSongs.NumSongsVisible > 0 && _SongMenus[_SongMenu].GetActualSelection() != -1) + if (CSongs.NumSongsVisible > 0 && _SongMenus[_SongMenu].GetActualSelection() != -1 && _SongMenus[_SongMenu].IsMouseOverActualSelection(mouseEvent)) { _ToggleSongOptions(ESongOptionsView.None); _StartVisibleSong(_SongMenus[_SongMenu].GetActualSelection()); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenu.cs b/VocaluxeLib/Menu/SongMenu/CSongMenu.cs index b4c3f32a..b66013b4 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenu.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenu.cs @@ -98,6 +98,11 @@ namespace VocaluxeLib.Menu.SongMenu _SongMenu.SetActive(active); } + public bool IsMouseOverActualSelection(SMouseEvent mEvent) + { + return _SongMenu.IsMouseOverActualSelection(mEvent); + } + public int GetSelectedSong() { return _SongMenu.GetSelectedSong(); diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index aabb9749..b2353579 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -518,6 +518,8 @@ namespace VocaluxeLib.Menu.SongMenu _Active = active; } + public virtual bool IsMouseOverActualSelection(SMouseEvent mEvent) { return false; } + public virtual int GetSelectedSong() { return -1; diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 7cdc4dec..d263fe92 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -485,6 +485,15 @@ namespace VocaluxeLib.Menu.SongMenu return _Locked; } + public override bool IsMouseOverActualSelection(SMouseEvent mEvent) + { + CStatic selCov = GetSelectedSongCover(); + if (selCov.Texture == null) + return false; + SRectF rect = new SRectF(selCov.Rect.X - selCov.Rect.W*0.2f, selCov.Rect.Y - selCov.Rect.H*0.2f, selCov.Rect.W*1.2f, selCov.Rect.H*1.2f, selCov.Rect.Z); + return CHelper.IsInBounds(rect, mEvent); + } + public override CStatic GetSelectedSongCover() { foreach (CStatic tile in _Tiles) diff --git a/VocaluxeLib/Menu/SongMenu/ISongMenu.cs b/VocaluxeLib/Menu/SongMenu/ISongMenu.cs index 060a8cf4..7f2cd6ec 100644 --- a/VocaluxeLib/Menu/SongMenu/ISongMenu.cs +++ b/VocaluxeLib/Menu/SongMenu/ISongMenu.cs @@ -40,6 +40,8 @@ namespace VocaluxeLib.Menu.SongMenu bool IsActive(); void SetActive(bool active); + bool IsMouseOverActualSelection(SMouseEvent mEvent); + int GetSelectedCategory(); void SetSelectedCategory(int categoryNr); int GetActualSelection(); From 24fbb13a1673113cc7d2209dc7efda90ffa43aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 14:54:51 +0200 Subject: [PATCH 07/10] Fixed building of -letter-categories. --- Vocaluxe/Base/CSongCategorizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Base/CSongCategorizer.cs b/Vocaluxe/Base/CSongCategorizer.cs index aba5bb88..70733d88 100644 --- a/Vocaluxe/Base/CSongCategorizer.cs +++ b/Vocaluxe/Base/CSongCategorizer.cs @@ -72,9 +72,9 @@ namespace Vocaluxe.Base Char firstLetter = Char.ToUpper(songPointer.SortString.Normalize(NormalizationForm.FormD)[0]); if (Char.IsLetter(firstLetter)) { - if (lastCategory == null || songPointer.SortString != lastCategory.Name) + if (lastCategory == null || firstLetter.ToString() != lastCategory.Name) { - lastCategory = new CCategory(songPointer.SortString); + lastCategory = new CCategory(firstLetter.ToString()); _Categories.Add(lastCategory); } lastCategory.Songs.Add(songPointer); From 7d5babebad166b5c0bc8e9084abf05ad6453eefd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 15:25:48 +0200 Subject: [PATCH 08/10] Some theme-fixes --- Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml | 6 +++--- Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml | 6 +++--- Output/Themes/Ambient/Screens/ScreenParty.xml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml index 89dce324..b2620651 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsRecord.xml @@ -410,7 +410,7 @@ 75 - 16 + 12 27 @@ -467,7 +467,7 @@ 75 - 16 + 12 27 @@ -835,4 +835,4 @@ - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml index 5bbf6015..74f21bd9 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml @@ -79,9 +79,9 @@ - CoverBackground + Invisble - 75 + 500 460 0,00 320 @@ -756,4 +756,4 @@ 3 - \ No newline at end of file + diff --git a/Output/Themes/Ambient/Screens/ScreenParty.xml b/Output/Themes/Ambient/Screens/ScreenParty.xml index b55de8be..d725b993 100644 --- a/Output/Themes/Ambient/Screens/ScreenParty.xml +++ b/Output/Themes/Ambient/Screens/ScreenParty.xml @@ -568,7 +568,7 @@ Outline - TR_BUTTON_EXIT + TR_BUTTON_BACK @@ -653,4 +653,4 @@ 1 - \ No newline at end of file + From ac3294099e5bba582ba09305a0945f49669695d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Sun, 26 May 2013 15:47:32 +0200 Subject: [PATCH 09/10] Fix edit-mode of texts (and a crash on screen-song) --- VocaluxeLib/Menu/CText.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VocaluxeLib/Menu/CText.cs b/VocaluxeLib/Menu/CText.cs index 8299e395..e326d5d8 100644 --- a/VocaluxeLib/Menu/CText.cs +++ b/VocaluxeLib/Menu/CText.cs @@ -199,6 +199,8 @@ namespace VocaluxeLib.Menu { _Theme.Text = value; _Text = translation; + if (_EditMode) + _Text += "|"; _PositionNeedsUpdate = true; } } From e8adefeec52d0f6e011d82d5a847c830ad0286e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Mon, 27 May 2013 19:24:59 +0200 Subject: [PATCH 10/10] Fixed typo. --- Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml index 74f21bd9..d8fa4e2f 100644 --- a/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml +++ b/Output/Themes/Ambient/Screens/ScreenOptionsVideo.xml @@ -79,7 +79,7 @@ - Invisble + Invisible 500 460