From a6cedc1a067cfdfb1ba44a8f4b98ea78ae3fe78f Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 25 Jul 2009 15:39:54 +0200 Subject: [PATCH] winealsa: Add option to disable mixer. Enable by setting the registry key HKCU\Software\Wine\Alsa Driver\DisableMixer to "Y". --- dlls/winealsa.drv/mixer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/winealsa.drv/mixer.c b/dlls/winealsa.drv/mixer.c index e5cd3477995..802ac4c83f2 100644 --- a/dlls/winealsa.drv/mixer.c +++ b/dlls/winealsa.drv/mixer.c @@ -42,6 +42,7 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" +#include "winreg.h" #include "winuser.h" #include "winnls.h" #include "mmddk.h" @@ -52,6 +53,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mixer); +#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1') + #ifdef HAVE_ALSA #define WINE_MIXER_MANUF_ID 0xAA @@ -500,6 +503,21 @@ static void ALSA_MixerInit(void) /* Add master channel, uncounted channels and an extra for capture */ mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + 1; + { + BYTE buffer[32]; + DWORD size = sizeof(buffer); + HKEY hkey = 0; + /* @@ Wine registry key: HKCU\Software\Wine\Direct3D */ + if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Alsa Driver", &hkey)) { + if (!RegQueryValueExA( hkey, "DisableMixer", 0, NULL, buffer, &size)) { + if ( IS_OPTION_TRUE( buffer[0] ) ) { + WARN("Mixing disabled in registry!\n"); + goto close; + } + } + } + } + /* If there is only 'Capture' and 'Master', this device is not worth it */ if (mixdev[mixnum].chans == 2) { -- 2.11.4.GIT