summaryrefslogtreecommitdiff
path: root/plugins/hotkeys/actionhandlers.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-25 12:06:13 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-25 12:06:13 +0100
commit4d190480e4dbb382673e5a2f698fe39c9feb9b80 (patch)
tree1f20b25c59054b0d724202bf8334f764c64e7906 /plugins/hotkeys/actionhandlers.c
parentb4fb95c1a8fc2bc7a87a98355e64ac2945b79f02 (diff)
added add/remove to/from playqueue hotkeys
Diffstat (limited to 'plugins/hotkeys/actionhandlers.c')
-rw-r--r--plugins/hotkeys/actionhandlers.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/hotkeys/actionhandlers.c b/plugins/hotkeys/actionhandlers.c
index ec8e00b5..ab90a788 100644
--- a/plugins/hotkeys/actionhandlers.c
+++ b/plugins/hotkeys/actionhandlers.c
@@ -277,4 +277,32 @@ action_clear_playlist_handler (DB_plugin_action_t *act, int ctx) {
return 0;
}
+int
+action_add_to_playqueue_handler (DB_plugin_action_t *act, int ctx) {
+ DB_playItem_t *it = deadbeef->pl_get_first (PL_MAIN);
+ while (it) {
+ if (deadbeef->pl_is_selected (it)) {
+ deadbeef->pl_playqueue_push (it);
+ }
+ DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN);
+ deadbeef->pl_item_unref (it);
+ it = next;
+ }
+ deadbeef->sendmessage (DB_EV_PLAYLIST_REFRESH, 0, 0, 0);
+ return 0;
+}
+int
+action_remove_from_playqueue_handler (DB_plugin_action_t *act, int ctx) {
+ DB_playItem_t *it = deadbeef->pl_get_first (PL_MAIN);
+ while (it) {
+ if (deadbeef->pl_is_selected (it)) {
+ deadbeef->pl_playqueue_remove (it);
+ }
+ DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN);
+ deadbeef->pl_item_unref (it);
+ it = next;
+ }
+ deadbeef->sendmessage (DB_EV_PLAYLIST_REFRESH, 0, 0, 0);
+ return 0;
+}