Commit 1cfdb0fd authored by Alexandre Julliard's avatar Alexandre Julliard

Moved the audio driver configuration to HKCU\Software\Wine\Drivers and

changed it a bit to follow the model of the graphics driver.
parent ab88743c
......@@ -723,8 +723,7 @@ BOOL MMDRV_Init(void)
char driver_buffer[256];
char mapper_buffer[256];
char midi_buffer[256];
char* p1;
char* p2;
char* p;
DWORD type, size;
BOOL ret = FALSE;
TRACE("()\n");
......@@ -733,13 +732,29 @@ BOOL MMDRV_Init(void)
strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER);
strcpy(midi_buffer, WINE_DEFAULT_WINMM_MIDI);
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\WinMM */
if (! RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\WinMM", &hKey)) {
/* @@ Wine registry key: HKCU\Software\Wine\Drivers */
if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hKey))
{
size = sizeof(driver_buffer);
if (RegQueryValueExA(hKey, "Drivers", 0, &type, (LPVOID)driver_buffer, &size))
if (RegQueryValueExA(hKey, "Audio", 0, &type, (LPVOID)driver_buffer, &size))
strcpy(driver_buffer, WINE_DEFAULT_WINMM_DRIVER);
}
p = driver_buffer;
while (p)
{
char filename[sizeof(driver_buffer)+10];
char *next = strchr(p, ',');
if (next) *next++ = 0;
sprintf( filename, "wine%s.drv", p );
ret |= MMDRV_Install( filename, filename, FALSE );
p = next;
}
/* finish with mappers */
/* finish with mappers */
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\WinMM */
if (! RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\WinMM", &hKey)) {
size = sizeof(mapper_buffer);
if (RegQueryValueExA(hKey, "WaveMapper", 0, &type, (LPVOID)mapper_buffer, &size))
strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER);
......@@ -751,14 +766,6 @@ BOOL MMDRV_Init(void)
RegCloseKey(hKey);
}
p1 = driver_buffer;
while (p1) {
p2 = strchr(p1, ';');
if (p2) *p2++ = '\0';
ret |= MMDRV_Install(p1, p1, FALSE);
p1 = p2;
}
ret |= MMDRV_Install("wavemapper", mapper_buffer, TRUE);
ret |= MMDRV_Install("midimapper", midi_buffer, TRUE);
return ret;
......
......@@ -28,7 +28,7 @@
#include "winbase.h"
#include "mmddk.h"
#define WINE_DEFAULT_WINMM_DRIVER "wineoss.drv"
#define WINE_DEFAULT_WINMM_DRIVER "oss"
#define WINE_DEFAULT_WINMM_MAPPER "msacm.drv"
#define WINE_DEFAULT_WINMM_MIDI "midimap.drv"
......
......@@ -55,7 +55,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
{
if (!strcmp (pAudioDrv->szDriver, drivername))
{
set_reg_key("Winmm", "Drivers", (char *) pAudioDrv->szDriver);
set_reg_key("Drivers", "Audio", (char *) pAudioDrv->szDriver);
SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM) hDlg, 0); /* enable apply button */
SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_SETCURSEL,
(WPARAM) i, 0);
......@@ -66,7 +66,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
static void initAudioDlg (HWND hDlg)
{
char *curAudioDriver = get_reg_key("Winmm", "Drivers", "winealsa.drv");
char *curAudioDriver = get_reg_key("Drivers", "Audio", "alsa");
const AUDIO_DRIVER *pAudioDrv = NULL;
int i;
......@@ -101,7 +101,7 @@ static const char *audioAutoDetect(void)
if(fd)
{
close(fd);
driversFound[numFound] = "wineoss.drv";
driversFound[numFound] = "oss";
name[numFound] = "OSS";
numFound++;
}
......@@ -109,7 +109,7 @@ static const char *audioAutoDetect(void)
/* try to detect alsa */
if(!stat("/proc/asound", &buf))
{
driversFound[numFound] = "winealsa.drv";
driversFound[numFound] = "alsa";
name[numFound] = "Alsa";
numFound++;
}
......@@ -118,7 +118,7 @@ static const char *audioAutoDetect(void)
argv_new[2] = "ps awx|grep artsd|grep -v grep|grep artsd > /dev/null";
if(!spawnvp(_P_WAIT, "/bin/sh", argv_new))
{
driversFound[numFound] = "winearts.drv";
driversFound[numFound] = "arts";
name[numFound] = "aRts";
numFound++;
}
......@@ -127,7 +127,7 @@ static const char *audioAutoDetect(void)
argv_new[2] = "ps awx|grep jackd|grep -v grep|grep jackd > /dev/null";
if(!spawnvp(_P_WAIT, "/bin/sh", argv_new))
{
driversFound[numFound] = "winejack.drv";
driversFound[numFound] = "jack";
name[numFound] = "jack";
numFound++;
}
......
......@@ -58,12 +58,12 @@ static DLL_DESC sDLLType[] = {
};
static AUDIO_DRIVER sAudioDrivers[] = {
{"Alsa", "winealsa.drv"},
{"aRts", "winearts.drv"},
{"OSS", "wineoss.drv"},
{"Jack", "winejack.drv"},
{"Nas", "winenas.drv"},
{"Audio IO(Solaris)", "wineaudioio.drv"},
{"Alsa", "alsa"},
{"aRts", "arts"},
{"OSS", "oss"},
{"Jack", "jack"},
{"Nas", "nas"},
{"Audio IO(Solaris)", "audioio"},
{"Disable sound", ""},
{"", ""}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment