Key shortcut to show only songs of the current playlist

CTRL+L while a playlist is open. It's a toggle key, just press again to return to normal list.
While filtered to a playlist, you can also use CTRL+L while the playlist is not open to switch back to the normal view.

My initial plans included also a button on the playlist pane, to the left of the playlist save button. I was able to add this button and set events on it. But I don't know how to filter and refresh the song screen, while I'm in the CPlaylist class of the VocaluxeLib namespace. After playing around for hours I stopped trying this and added just this key shortcut.
This commit is contained in:
Stefan authored and GitHub committed 2020-02-02 15:17:46 +01:00
1 parent 30d9c40fc6
commit ca1b640f1f
1 file changed
+23 -3
+23 -3
View File
@@ -363,6 +363,13 @@ namespace Vocaluxe.Screens
_ShowHighscore();
}
break;
case Keys.L:
if (keyEvent.Mod == EModifier.Ctrl)
{
_TogglePlaylistFilter();
}
break;
}
if (!_SearchActive)
{
@@ -869,9 +876,6 @@ namespace Vocaluxe.Screens
CParty.OnSongChange(_SelectedSongID, ref _Sso);
}
_Sso = CParty.GetSongSelectionOptions();
if (_Sso.Selection.PartyMode)
{
CSongs.Sort(_Sso.Sorting.SongSorting, _Sso.Sorting.Tabs, _Sso.Sorting.IgnoreArticles, _Sso.Sorting.SearchString, _Sso.Sorting.DuetOptions, _Sso.Sorting.FilterPlaylistID);
@@ -1253,6 +1257,22 @@ namespace Vocaluxe.Screens
_JumpTo_lastSearchString = searchString;
}
public void _TogglePlaylistFilter()
{
if (_Sso.Sorting.FilterPlaylistID == _Playlist.ActivePlaylistID)
{
if (_Playlist.ActivePlaylistID == -1)
return;
_Sso.Sorting.FilterPlaylistID = -1;
}
else
_Sso.Sorting.FilterPlaylistID = _Playlist.ActivePlaylistID;
CSongs.Sort(_Sso.Sorting.SongSorting, _Sso.Sorting.Tabs, _Sso.Sorting.IgnoreArticles, _Sso.Sorting.SearchString, _Sso.Sorting.DuetOptions, _Sso.Sorting.FilterPlaylistID);
_SongMenu.OnShow();
}
private void _ApplyNewSearchFilter(string newFilterString)
{
CParty.SetSearchString(newFilterString, _SearchActive);