Added a new PlayQueueClear hotkey.

This commit is contained in:
Casey Langen 2020-12-22 19:17:05 -08:00
parent 210c98b8ad
commit fbbaea0beb
4 changed files with 9 additions and 1 deletions

View File

@ -6,7 +6,8 @@
completion. completion.
* fixed now playing readout ellipsizing. * fixed now playing readout ellipsizing.
* fixed a bug where last.fm scrobbles may get posted twice per track. * fixed a bug where last.fm scrobbles may get posted twice per track.
* added a hotkey to clear the play queue; press 'shift+x' in the play queue
window.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
0.96.2 0.96.2

View File

@ -241,6 +241,10 @@ bool NowPlayingLayout::KeyPress(const std::string& key) {
PlayQueueOverlays::ShowDeletePlaylistOverlay(this->library); PlayQueueOverlays::ShowDeletePlaylistOverlay(this->library);
return true; return true;
} }
else if (Hotkeys::Is(Hotkeys::PlayQueueClear, key)) {
this->playback.Edit().Clear();
return true;
}
else if (ProcessEditOperation(key)) { else if (ProcessEditOperation(key)) {
return true; return true;
} }

View File

@ -92,6 +92,7 @@ static std::unordered_map<std::string, Id> NAME_TO_ID = {
{ "play_queue_playlist_rename", Id::PlayQueuePlaylistRename }, { "play_queue_playlist_rename", Id::PlayQueuePlaylistRename },
{ "play_queue_playlist_delete", Id::PlayQueuePlaylistDelete }, { "play_queue_playlist_delete", Id::PlayQueuePlaylistDelete },
{ "play_queue_hot_swap", Id::PlayQueueHotSwap }, { "play_queue_hot_swap", Id::PlayQueueHotSwap },
{ "play_queue_clear", Id::PlayQueueClear },
{ "browse_playlists_new", Id::BrowsePlaylistsNew }, { "browse_playlists_new", Id::BrowsePlaylistsNew },
{ "browse_playlists_save", Id::BrowsePlaylistsSave }, { "browse_playlists_save", Id::BrowsePlaylistsSave },
@ -182,6 +183,7 @@ static std::unordered_map<Id, std::string, EnumHasher> ID_TO_DEFAULT = {
{ Id::PlayQueuePlaylistRename, "M-r" }, { Id::PlayQueuePlaylistRename, "M-r" },
{ Id::PlayQueuePlaylistDelete, "M-x" }, { Id::PlayQueuePlaylistDelete, "M-x" },
{ Id::PlayQueueHotSwap, "M-a" }, { Id::PlayQueueHotSwap, "M-a" },
{ Id::PlayQueueClear, "X" },
{ Id::BrowsePlaylistsSave, "M-s" }, { Id::BrowsePlaylistsSave, "M-s" },
{ Id::BrowsePlaylistsNew, "M-n" }, { Id::BrowsePlaylistsNew, "M-n" },

View File

@ -101,6 +101,7 @@ namespace musik {
PlayQueuePlaylistRename, PlayQueuePlaylistRename,
PlayQueuePlaylistDelete, PlayQueuePlaylistDelete,
PlayQueueHotSwap, PlayQueueHotSwap,
PlayQueueClear,
/* browse -> playlists */ /* browse -> playlists */
BrowsePlaylistsNew, BrowsePlaylistsNew,