diff options
author | 2012-11-24 13:35:37 +0100 | |
---|---|---|
committer | 2012-11-24 13:35:37 +0100 | |
commit | 96fe746b8aadf6a6c22fe4d83ae4d1652e07473c (patch) | |
tree | 0a4a63649d73ebaff0d66ddad5ddb17790ba078a /plugins | |
parent | 5bfdd5e0c4021ff0dd3f5670bce335465350c3b3 (diff) |
gtkui: added playorder hotkeys
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkui/actionhandlers.c | 43 | ||||
-rw-r--r-- | plugins/gtkui/actionhandlers.h | 12 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 16 |
3 files changed, 63 insertions, 8 deletions
diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c index 04386cca..b1f159fb 100644 --- a/plugins/gtkui/actionhandlers.c +++ b/plugins/gtkui/actionhandlers.c @@ -965,3 +965,46 @@ action_playback_loop_all_handler(DB_plugin_action_t *act, int ctx) { return 0; } +gboolean +action_playback_order_random_handler_cb (void *data) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_random")), 1); +} + +int +action_playback_order_random_handler(DB_plugin_action_t *act, int ctx) { + g_idle_add (action_playback_order_random_handler_cb, NULL); + return 0; +} + +gboolean +action_playback_order_shuffle_albums_handler_cb (void *data) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_shuffle_albums")), 1); +} + +int +action_playback_order_shuffle_albums_handler(DB_plugin_action_t *act, int ctx) { + g_idle_add (action_playback_order_shuffle_albums_handler_cb, NULL); + return 0; +} + +gboolean +action_playback_order_shuffle_handler_cb (void *data) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_shuffle")), 1); +} + +int +action_playback_order_shuffle_handler(DB_plugin_action_t *act, int ctx) { + g_idle_add (action_playback_order_shuffle_handler_cb, NULL); + return 0; +} + +gboolean +action_playback_order_linear_handler_cb (void *data) { + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lookup_widget (mainwin, "order_linear")), 1); +} + +int +action_playback_order_linear_handler(DB_plugin_action_t *act, int ctx) { + g_idle_add (action_playback_order_linear_handler_cb, NULL); + return 0; +} diff --git a/plugins/gtkui/actionhandlers.h b/plugins/gtkui/actionhandlers.h index 18b15171..3b5e7027 100644 --- a/plugins/gtkui/actionhandlers.h +++ b/plugins/gtkui/actionhandlers.h @@ -195,4 +195,16 @@ action_playback_loop_single_handler(DB_plugin_action_t *act, int ctx); int action_playback_loop_all_handler(DB_plugin_action_t *act, int ctx); +int +action_playback_order_random_handler(DB_plugin_action_t *act, int ctx); + +int +action_playback_order_shuffle_albums_handler(DB_plugin_action_t *act, int ctx); + +int +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); + #endif diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 3f49647d..172b2759 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -1414,34 +1414,34 @@ static DB_plugin_action_t action_playback_loop_all = { }; static DB_plugin_action_t action_playback_order_random = { - .title = "Playback/[stub] Playback order - Random", + .title = "Playback/Playback order - Random", .name = "order_random", .flags = DB_ACTION_COMMON, - .callback = NULL, + .callback = action_playback_order_random_handler, .next = &action_playback_loop_all }; static DB_plugin_action_t action_playback_order_shuffle_albums = { - .title = "Playback/[stub] Playback order - Shuffle albums", + .title = "Playback/Playback order - Shuffle albums", .name = "order_shuffle_albums", .flags = DB_ACTION_COMMON, - .callback = NULL, + .callback = action_playback_order_shuffle_albums_handler, .next = &action_playback_order_random }; static DB_plugin_action_t action_playback_order_shuffle = { - .title = "Playback/[stub] Playback order - Shuffle tracks", + .title = "Playback/Playback order - Shuffle tracks", .name = "order_shuffle", .flags = DB_ACTION_COMMON, - .callback = NULL, + .callback = action_playback_order_shuffle_handler, .next = &action_playback_order_shuffle_albums }; static DB_plugin_action_t action_playback_order_linear = { - .title = "Playback/[stub] Playback order - Linear", + .title = "Playback/Playback order - Linear", .name = "order_linear", .flags = DB_ACTION_COMMON, - .callback = NULL, + .callback = action_playback_order_linear_handler, .next = &action_playback_order_shuffle }; |