summaryrefslogtreecommitdiffstats
path: root/libao2
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-17 07:54:11 +0100
committerwm4 <wm4@mplayer2.org>2012-01-18 04:21:46 +0100
commit06b1de26875dded600ac5771d4c0bd87f1d6e802 (patch)
treeadf08f344f280f633ab78c49c88704038b0381db /libao2
parent56c1ab1c62e4e35c7b62d2b8143f6e9247f4c96c (diff)
downloadmpv-06b1de26875dded600ac5771d4c0bd87f1d6e802.tar.bz2
mpv-06b1de26875dded600ac5771d4c0bd87f1d6e802.tar.xz
mixer, libao: add proper mute control
The mixer frontend code can now make use of a proper system mixer mute toggle, if the audio output driver supports it. The consequence is that, if support is available, mplayer will no longer temporarily set the system volume to 0 if mute is enabled. Generally, the code now deals with the following combinations of available AO features: - software volume control forced by user (--softvol / soft_vol flag) => if enabled, never touch the "hardware" controls - "hardware"/driver volume control available (whether AOCONTROL_GET/SET_VOLUME works) => if not available, enable volume controls by enabling softvol - "hardware"/driver mute control (AOCONTROL_GET/SET_MUTE) => if not available, emulate by setting volume to 0 - whether the volume+mute controls are kept or not when the AO is closed (indicated by ao->no_persistent_volume) => if not persistent, restore the volume/mute next time the AO is opened
Diffstat (limited to 'libao2')
-rw-r--r--libao2/audio_out.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/libao2/audio_out.h b/libao2/audio_out.h
index a8efc92069..c5ddb5bf60 100644
--- a/libao2/audio_out.h
+++ b/libao2/audio_out.h
@@ -97,10 +97,19 @@ void list_audio_out(void);
#define AOCONTROL_SET_DEVICE 1
#define AOCONTROL_GET_DEVICE 2
#define AOCONTROL_QUERY_FORMAT 3 /* test for availabilty of a format */
+// Uses ao_control_vol_t* as arg.
+// If the volume controls are joint, the average of both volumes should be used.
#define AOCONTROL_GET_VOLUME 4
#define AOCONTROL_SET_VOLUME 5
-#define AOCONTROL_SET_PLUGIN_DRIVER 6
-#define AOCONTROL_SET_PLUGIN_LIST 7
+// Uses ao_control_vol_t* as arg.
+// left==0.0f means muted, left==1.0f means not muted (right likewise)
+// Other values between are invalid.
+// If the mtue controls are joint, the output should be muted if either of the
+// two channels are muted.
+#define AOCONTROL_GET_MUTE 6
+#define AOCONTROL_SET_MUTE 7
+#define AOCONTROL_SET_PLUGIN_DRIVER 8
+#define AOCONTROL_SET_PLUGIN_LIST 9
#define AOPLAY_FINAL_CHUNK 1