summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-24 13:53:09 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-24 13:53:09 +0100
commit9afb563e52434f3901ba47552c628e527d1701df (patch)
treec500f764ee66b278a3dc1f5442d47398775cf7c2 /plugins
parent96fe746b8aadf6a6c22fe4d83ae4d1652e07473c (diff)
gtkui: added cycle play order hotkeys
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/actionhandlers.c26
-rw-r--r--plugins/gtkui/actionhandlers.h3
-rw-r--r--plugins/gtkui/gtkui.c10
3 files changed, 38 insertions, 1 deletions
diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c
index b1f159fb..c8d16424 100644
--- a/plugins/gtkui/actionhandlers.c
+++ b/plugins/gtkui/actionhandlers.c
@@ -1008,3 +1008,29 @@ action_playback_order_linear_handler(DB_plugin_action_t *act, int ctx) {
g_idle_add (action_playback_order_linear_handler_cb, NULL);
return 0;
}
+
+//deadbeef->conf_get_int ("playback.loop", PLAYBACK_MODE_LOOP_ALL)
+gboolean
+action_playback_order_cycle_handler_cb (void *data) {
+ int ord = deadbeef->conf_get_int ("playback.order", PLAYBACK_ORDER_LINEAR);
+ switch (ord) {
+ case PLAYBACK_ORDER_LINEAR:
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_shuffle")), 1);
+ break;
+ case PLAYBACK_ORDER_SHUFFLE_TRACKS:
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_shuffle_albums")), 1);
+ break;
+ case PLAYBACK_ORDER_SHUFFLE_ALBUMS:
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_random")), 1);
+ break;
+ case PLAYBACK_ORDER_RANDOM:
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_linear")), 1);
+ break;
+ }
+}
+
+int
+action_playback_order_cycle_handler(DB_plugin_action_t *act, int ctx) {
+ g_idle_add (action_playback_order_cycle_handler_cb, NULL);
+ return 0;
+}
diff --git a/plugins/gtkui/actionhandlers.h b/plugins/gtkui/actionhandlers.h
index 3b5e7027..036b922d 100644
--- a/plugins/gtkui/actionhandlers.h
+++ b/plugins/gtkui/actionhandlers.h
@@ -207,4 +207,7 @@ action_playback_order_shuffle_handler(DB_plugin_action_t *act, int ctx);
int
action_playback_order_linear_handler(DB_plugin_action_t *act, int ctx);
+int
+action_playback_order_cycle_handler(DB_plugin_action_t *act, int ctx);
+
#endif
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 172b2759..61c3cafa 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -1413,12 +1413,20 @@ static DB_plugin_action_t action_playback_loop_all = {
.next = &action_playback_loop_single
};
+static DB_plugin_action_t action_playback_order_cycle = {
+ .title = "Playback/Cycle playback order",
+ .name = "order_cycle",
+ .flags = DB_ACTION_COMMON,
+ .callback = action_playback_order_cycle_handler,
+ .next = &action_playback_loop_all
+};
+
static DB_plugin_action_t action_playback_order_random = {
.title = "Playback/Playback order - Random",
.name = "order_random",
.flags = DB_ACTION_COMMON,
.callback = action_playback_order_random_handler,
- .next = &action_playback_loop_all
+ .next = &action_playback_order_cycle
};
static DB_plugin_action_t action_playback_order_shuffle_albums = {