summaryrefslogtreecommitdiff
path: root/plugins/hotkeys
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-25 12:22:57 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-25 12:22:57 +0100
commite1e8da8bfe85e42b4e0c893170acd7ecbe3af512 (patch)
treea153f644c8db59f2343d9e1a39b49f06792e2f26 /plugins/hotkeys
parent4d190480e4dbb382673e5a2f698fe39c9feb9b80 (diff)
added new set_mute/is_mute API; added hotkey for this
Diffstat (limited to 'plugins/hotkeys')
-rw-r--r--plugins/hotkeys/actionhandlers.c7
-rw-r--r--plugins/hotkeys/actionhandlers.h3
-rw-r--r--plugins/hotkeys/hotkeys.c4
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
};