summaryrefslogtreecommitdiff
path: root/plugins/hotkeys
diff options
context:
space:
mode:
authorGravatar Aleksejs Popovs <me@popoffka.ru>2014-05-01 19:21:22 +0300
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-01 18:55:17 +0200
commitfc44e817e339017737e3063c050414301de4d671 (patch)
tree91b9c592b367b39706f8f074796c50287d0d5c32 /plugins/hotkeys
parent102e78d943cf640a73a1b6aa13e3a6343f07ca1a (diff)
added "stop playback after current album finishes" functionality
Diffstat (limited to 'plugins/hotkeys')
-rw-r--r--plugins/hotkeys/hotkeys.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c
index 9ad4aead..f1deaac8 100644
--- a/plugins/hotkeys/hotkeys.c
+++ b/plugins/hotkeys/hotkeys.c
@@ -745,6 +745,15 @@ action_toggle_stop_after_current_cb (struct DB_plugin_action_s *action, int ctx)
return 0;
}
+int
+action_toggle_stop_after_album_cb (struct DB_plugin_action_s *action, int ctx) {
+ int var = deadbeef->conf_get_int ("playlist.stop_after_album", 0);
+ var = 1 - var;
+ deadbeef->conf_set_int ("playlist.stop_after_album", var);
+ deadbeef->sendmessage (DB_EV_CONFIGCHANGED, 0, 0, 0);
+ return 0;
+}
+
static DB_plugin_action_t action_reload_metadata = {
.title = "Reload Metadata",
.name = "reload_metadata",
@@ -1058,10 +1067,18 @@ static DB_plugin_action_t action_toggle_stop_after_current = {
.next = &action_volume_down
};
+static DB_plugin_action_t action_toggle_stop_after_album = {
+ .title = "Playback/Toggle Stop After Current Album",
+ .name = "toggle_stop_after_album",
+ .flags = DB_ACTION_COMMON,
+ .callback2 = action_toggle_stop_after_album_cb,
+ .next = &action_toggle_stop_after_current
+};
+
static DB_plugin_action_t *
hotkeys_get_actions (DB_playItem_t *it)
{
- return &action_toggle_stop_after_current;
+ return &action_toggle_stop_after_album;
}
// define plugin interface