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) ...@@ -723,8 +723,7 @@ BOOL MMDRV_Init(void)
char driver_buffer[256]; char driver_buffer[256];
char mapper_buffer[256]; char mapper_buffer[256];
char midi_buffer[256]; char midi_buffer[256];
char* p1; char* p;
char* p2;
DWORD type, size; DWORD type, size;
BOOL ret = FALSE; BOOL ret = FALSE;
TRACE("()\n"); TRACE("()\n");
...@@ -733,13 +732,29 @@ BOOL MMDRV_Init(void) ...@@ -733,13 +732,29 @@ BOOL MMDRV_Init(void)
strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER); strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER);
strcpy(midi_buffer, WINE_DEFAULT_WINMM_MIDI); strcpy(midi_buffer, WINE_DEFAULT_WINMM_MIDI);
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\WinMM */ /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
if (! RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\WinMM", &hKey)) { if (!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hKey))
{
size = sizeof(driver_buffer); 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); 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); size = sizeof(mapper_buffer);
if (RegQueryValueExA(hKey, "WaveMapper", 0, &type, (LPVOID)mapper_buffer, &size)) if (RegQueryValueExA(hKey, "WaveMapper", 0, &type, (LPVOID)mapper_buffer, &size))
strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER); strcpy(mapper_buffer, WINE_DEFAULT_WINMM_MAPPER);
...@@ -751,14 +766,6 @@ BOOL MMDRV_Init(void) ...@@ -751,14 +766,6 @@ BOOL MMDRV_Init(void)
RegCloseKey(hKey); 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("wavemapper", mapper_buffer, TRUE);
ret |= MMDRV_Install("midimapper", midi_buffer, TRUE); ret |= MMDRV_Install("midimapper", midi_buffer, TRUE);
return ret; return ret;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "winbase.h" #include "winbase.h"
#include "mmddk.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_MAPPER "msacm.drv"
#define WINE_DEFAULT_WINMM_MIDI "midimap.drv" #define WINE_DEFAULT_WINMM_MIDI "midimap.drv"
......
...@@ -55,7 +55,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername) ...@@ -55,7 +55,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
{ {
if (!strcmp (pAudioDrv->szDriver, 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 */ SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM) hDlg, 0); /* enable apply button */
SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_SETCURSEL, SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_SETCURSEL,
(WPARAM) i, 0); (WPARAM) i, 0);
...@@ -66,7 +66,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername) ...@@ -66,7 +66,7 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
static void initAudioDlg (HWND hDlg) 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; const AUDIO_DRIVER *pAudioDrv = NULL;
int i; int i;
...@@ -101,7 +101,7 @@ static const char *audioAutoDetect(void) ...@@ -101,7 +101,7 @@ static const char *audioAutoDetect(void)
if(fd) if(fd)
{ {
close(fd); close(fd);
driversFound[numFound] = "wineoss.drv"; driversFound[numFound] = "oss";
name[numFound] = "OSS"; name[numFound] = "OSS";
numFound++; numFound++;
} }
...@@ -109,7 +109,7 @@ static const char *audioAutoDetect(void) ...@@ -109,7 +109,7 @@ static const char *audioAutoDetect(void)
/* try to detect alsa */ /* try to detect alsa */
if(!stat("/proc/asound", &buf)) if(!stat("/proc/asound", &buf))
{ {
driversFound[numFound] = "winealsa.drv"; driversFound[numFound] = "alsa";
name[numFound] = "Alsa"; name[numFound] = "Alsa";
numFound++; numFound++;
} }
...@@ -118,7 +118,7 @@ static const char *audioAutoDetect(void) ...@@ -118,7 +118,7 @@ static const char *audioAutoDetect(void)
argv_new[2] = "ps awx|grep artsd|grep -v grep|grep artsd > /dev/null"; argv_new[2] = "ps awx|grep artsd|grep -v grep|grep artsd > /dev/null";
if(!spawnvp(_P_WAIT, "/bin/sh", argv_new)) if(!spawnvp(_P_WAIT, "/bin/sh", argv_new))
{ {
driversFound[numFound] = "winearts.drv"; driversFound[numFound] = "arts";
name[numFound] = "aRts"; name[numFound] = "aRts";
numFound++; numFound++;
} }
...@@ -127,7 +127,7 @@ static const char *audioAutoDetect(void) ...@@ -127,7 +127,7 @@ static const char *audioAutoDetect(void)
argv_new[2] = "ps awx|grep jackd|grep -v grep|grep jackd > /dev/null"; argv_new[2] = "ps awx|grep jackd|grep -v grep|grep jackd > /dev/null";
if(!spawnvp(_P_WAIT, "/bin/sh", argv_new)) if(!spawnvp(_P_WAIT, "/bin/sh", argv_new))
{ {
driversFound[numFound] = "winejack.drv"; driversFound[numFound] = "jack";
name[numFound] = "jack"; name[numFound] = "jack";
numFound++; numFound++;
} }
......
...@@ -58,12 +58,12 @@ static DLL_DESC sDLLType[] = { ...@@ -58,12 +58,12 @@ static DLL_DESC sDLLType[] = {
}; };
static AUDIO_DRIVER sAudioDrivers[] = { static AUDIO_DRIVER sAudioDrivers[] = {
{"Alsa", "winealsa.drv"}, {"Alsa", "alsa"},
{"aRts", "winearts.drv"}, {"aRts", "arts"},
{"OSS", "wineoss.drv"}, {"OSS", "oss"},
{"Jack", "winejack.drv"}, {"Jack", "jack"},
{"Nas", "winenas.drv"}, {"Nas", "nas"},
{"Audio IO(Solaris)", "wineaudioio.drv"}, {"Audio IO(Solaris)", "audioio"},
{"Disable sound", ""}, {"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