Hi Max,

This patch adds the "disabled" mixer type to not allow MPD to touch
the mixer. This fixes bug 2094.

git://git.musicpd.org/avuton/mpd.git

 doc/mpd.conf.5      |    2 +-
 doc/mpdconf.example |    4 ++++
 src/volume.c        |    3 +++
 src/volume.h        |    1 +
 4 files changed, 9 insertions(+), 1 deletions(-)

Avuton Olrich (1):
      mixer: Add "disabled" mixer_type.

diff --git a/doc/mpd.conf.5 b/doc/mpd.conf.5
index e375de1..592398a 100644
--- a/doc/mpd.conf.5
+++ b/doc/mpd.conf.5
@@ -163,7 +163,7 @@ Linear interpolator, very fast, poor quality.
 For an up-to-date list of available converters, please see the libsamplerate
 documentation (available online at <\fBhttp://www.mega-nerd.com/SRC/\fP>).
 .TP
-.B mixer_type <alsa, oss, software or hardware>
+.B mixer_type <alsa, oss, software, hardware or disabled>
 This specifies which mixer to use.  The default is hardware and depends on
 what audio output support mpd was built with. Options alsa and oss are
 legacy and should not be used in new configs, but when set mixer_device
diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index ba9a74e..5b19c02 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
@@ -245,6 +245,10 @@ log_file                   "~/.mpd/log"
 #
 #mixer_type                    "software"
 #
+# This example will not allow MPD to touch the mixer at all.
+#
+#mixer_type                    "disabled"
+#
 ###############################################################################


diff --git a/src/volume.c b/src/volume.c
index 5017910..c5c1e83 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -36,6 +36,7 @@

 #define VOLUME_MIXER_TYPE_SOFTWARE             0
 #define VOLUME_MIXER_TYPE_HARDWARE             1
+#define VOLUME_MIXER_TYPE_DISABLED             2

 #define VOLUME_MIXER_SOFTWARE_DEFAULT          ""
 #define SW_VOLUME_STATE                         "sw_volume: "
@@ -131,6 +132,8 @@ void volume_init(void)
        if (param) {
                if (strcmp(param->value, VOLUME_MIXER_SOFTWARE) == 0) {
                        volume_mixer_type = VOLUME_MIXER_TYPE_SOFTWARE;
+               } else if (strcmp(param->value, VOLUME_MIXER_DISABLED) == 0) {
+                       volume_mixer_type = VOLUME_MIXER_TYPE_DISABLED;
                } else if (strcmp(param->value, VOLUME_MIXER_HARDWARE) == 0) {
                        //nothing to do
                } else {
diff --git a/src/volume.h b/src/volume.h
index fbf86df..950f26e 100644
--- a/src/volume.h
+++ b/src/volume.h
@@ -25,6 +25,7 @@
 #define VOLUME_MIXER_ALSA      "alsa"
 #define VOLUME_MIXER_SOFTWARE  "software"
 #define VOLUME_MIXER_HARDWARE  "hardware"
+#define VOLUME_MIXER_DISABLED  "disabled"

 void volume_init(void);
-- 
avuton
--
|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to