From fbbaea0beb5e4eba017e9e11e1f20d0fe5230e67 Mon Sep 17 00:00:00 2001 From: Casey Langen Date: Tue, 22 Dec 2020 19:17:05 -0800 Subject: [PATCH] Added a new PlayQueueClear hotkey. --- CHANGELOG.txt | 3 ++- src/musikcube/app/layout/NowPlayingLayout.cpp | 4 ++++ src/musikcube/app/util/Hotkeys.cpp | 2 ++ src/musikcube/app/util/Hotkeys.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 45cb7a566..eb0584079 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,8 @@ completion. * fixed now playing readout ellipsizing. * 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 diff --git a/src/musikcube/app/layout/NowPlayingLayout.cpp b/src/musikcube/app/layout/NowPlayingLayout.cpp index 7cc6f6632..0e0f931c6 100755 --- a/src/musikcube/app/layout/NowPlayingLayout.cpp +++ b/src/musikcube/app/layout/NowPlayingLayout.cpp @@ -241,6 +241,10 @@ bool NowPlayingLayout::KeyPress(const std::string& key) { PlayQueueOverlays::ShowDeletePlaylistOverlay(this->library); return true; } + else if (Hotkeys::Is(Hotkeys::PlayQueueClear, key)) { + this->playback.Edit().Clear(); + return true; + } else if (ProcessEditOperation(key)) { return true; } diff --git a/src/musikcube/app/util/Hotkeys.cpp b/src/musikcube/app/util/Hotkeys.cpp index 955a1ab15..1648dbf31 100755 --- a/src/musikcube/app/util/Hotkeys.cpp +++ b/src/musikcube/app/util/Hotkeys.cpp @@ -92,6 +92,7 @@ static std::unordered_map NAME_TO_ID = { { "play_queue_playlist_rename", Id::PlayQueuePlaylistRename }, { "play_queue_playlist_delete", Id::PlayQueuePlaylistDelete }, { "play_queue_hot_swap", Id::PlayQueueHotSwap }, + { "play_queue_clear", Id::PlayQueueClear }, { "browse_playlists_new", Id::BrowsePlaylistsNew }, { "browse_playlists_save", Id::BrowsePlaylistsSave }, @@ -182,6 +183,7 @@ static std::unordered_map ID_TO_DEFAULT = { { Id::PlayQueuePlaylistRename, "M-r" }, { Id::PlayQueuePlaylistDelete, "M-x" }, { Id::PlayQueueHotSwap, "M-a" }, + { Id::PlayQueueClear, "X" }, { Id::BrowsePlaylistsSave, "M-s" }, { Id::BrowsePlaylistsNew, "M-n" }, diff --git a/src/musikcube/app/util/Hotkeys.h b/src/musikcube/app/util/Hotkeys.h index 5acd4cdbd..7debe76a5 100755 --- a/src/musikcube/app/util/Hotkeys.h +++ b/src/musikcube/app/util/Hotkeys.h @@ -101,6 +101,7 @@ namespace musik { PlayQueuePlaylistRename, PlayQueuePlaylistDelete, PlayQueueHotSwap, + PlayQueueClear, /* browse -> playlists */ BrowsePlaylistsNew,