diff options
Diffstat (limited to 'plugins/hotkeys')
-rw-r--r-- | plugins/hotkeys/actionhandlers.c | 7 | ||||
-rw-r--r-- | plugins/hotkeys/actionhandlers.h | 3 | ||||
-rw-r--r-- | plugins/hotkeys/hotkeys.c | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/plugins/hotkeys/actionhandlers.c b/plugins/hotkeys/actionhandlers.c index ab90a788..b28c9c39 100644 --- a/plugins/hotkeys/actionhandlers.c +++ b/plugins/hotkeys/actionhandlers.c @@ -306,3 +306,10 @@ action_remove_from_playqueue_handler (DB_plugin_action_t *act, int ctx) { deadbeef->sendmessage (DB_EV_PLAYLIST_REFRESH, 0, 0, 0); return 0; } + +int +action_toggle_mute_handler (DB_plugin_action_t *act, int ctx) { + int mute = 1-deadbeef->audio_is_mute (); + deadbeef->audio_set_mute (mute); + return 0; +} diff --git a/plugins/hotkeys/actionhandlers.h b/plugins/hotkeys/actionhandlers.h index 7457f8eb..46a2e0cb 100644 --- a/plugins/hotkeys/actionhandlers.h +++ b/plugins/hotkeys/actionhandlers.h @@ -96,4 +96,7 @@ action_add_to_playqueue_handler (DB_plugin_action_t *act, int ctx); int action_remove_from_playqueue_handler (DB_plugin_action_t *act, int ctx); +int +action_toggle_mute_handler (DB_plugin_action_t *act, int ctx); + #endif diff --git a/plugins/hotkeys/hotkeys.c b/plugins/hotkeys/hotkeys.c index ca519976..b2c9f750 100644 --- a/plugins/hotkeys/hotkeys.c +++ b/plugins/hotkeys/hotkeys.c @@ -889,10 +889,10 @@ static DB_plugin_action_t action_add_to_playqueue = { }; static DB_plugin_action_t action_toggle_mute = { - .title = "Playback/[stub] Toggle Mute", + .title = "Playback/Toggle Mute", .name = "toggle_mute", .flags = DB_ACTION_COMMON, - .callback = NULL, + .callback = action_toggle_mute_handler, .next = &action_add_to_playqueue }; |