From e1e8da8bfe85e42b4e0c893170acd7ecbe3af512 Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 25 Nov 2012 12:22:57 +0100 Subject: added new set_mute/is_mute API; added hotkey for this --- plugins/hotkeys/actionhandlers.c | 7 +++++++ plugins/hotkeys/actionhandlers.h | 3 +++ plugins/hotkeys/hotkeys.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'plugins/hotkeys') 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 }; -- cgit v1.2.3