From fc0dd193ba64ca2029f4f3c5f4bb40bb7b8ee324 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Mon, 19 Mar 2012 17:43:11 +0100 Subject: [PATCH] Fixed JumpTo method, JumpTo is still disabled in 0.1 --- Vocaluxe/Screens/CScreenSong.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSong.cs b/Vocaluxe/Screens/CScreenSong.cs index 42fb3b06..c336e187 100644 --- a/Vocaluxe/Screens/CScreenSong.cs +++ b/Vocaluxe/Screens/CScreenSong.cs @@ -63,7 +63,7 @@ namespace Vocaluxe.Screens { JumpTo(KeyEvent.Unicode); return true; - }*/ + } */ } else { @@ -304,11 +304,10 @@ namespace Vocaluxe.Screens id = CSongs.VisibleSongs[song].ID; } - // here is a fault: SetSelectedSong should point to the visible index - Vocaluxe.Lib.Song.CSong s = Array.Find(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); - if (s != null && s.ID > -1) + int visibleID = Array.FindIndex(CSongs.VisibleSongs, element => element.Artist.StartsWith(Letter.ToString(), StringComparison.OrdinalIgnoreCase)); + if (visibleID > -1) { - id = s.ID; + id = visibleID; SongMenus[htSongMenus(SongMenu)].SetSelectedSong(id); } } @@ -345,4 +344,4 @@ namespace Vocaluxe.Screens SongMenus[htSongMenus(SongMenu)].OnShow(); } } -} +} \ No newline at end of file