Commit 8d9d1fb1 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

Add some basic dsound configuration on Audio panel.

parent 9ccea114
......@@ -153,6 +153,13 @@ BEGIN
PUSHBUTTON "Autodetect",IDC_AUDIO_AUTODETECT,170,20,49,14
PUSHBUTTON "Configure",IDC_AUDIO_CONFIGURE,170,40,49,14
PUSHBUTTON "Control Panel",IDC_AUDIO_CONTROL_PANEL,170,60,49,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "Hardware Acceleration: ",IDC_STATIC,15,85,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Driver Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
END
STRINGTABLE DISCARDABLE
......
......@@ -139,6 +139,13 @@ BEGIN
PUSHBUTTON "Autodtection",IDC_AUDIO_AUTODETECT,170,20,85,14
PUSHBUTTON "Configurer",IDC_AUDIO_CONFIGURE,170,40,85,14
PUSHBUTTON "Panneau de configuration",IDC_AUDIO_CONTROL_PANEL,170,60,85,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "Hardware Acceleration: ",IDC_STATIC,15,85,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Driver Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
END
STRINGTABLE DISCARDABLE
......
......@@ -44,6 +44,14 @@
WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
static const char* DSound_HW_Accels[] = {
"Full",
"Standard",
"Basic",
"Emulation",
NULL
};
/* Select the correct entry in the combobox based on drivername */
static void selectAudioDriver(HWND hDlg, const char *drivername)
{
......@@ -113,6 +121,7 @@ static void initAudioDlg (HWND hDlg)
char *curAudioDriver = get_reg_key(config_key, "Drivers", "Audio", "alsa");
const AUDIO_DRIVER *pAudioDrv = NULL;
int i;
char* buf = NULL;
WINE_TRACE("\n");
......@@ -124,6 +133,31 @@ static void initAudioDlg (HWND hDlg)
SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_SETCURSEL, i, 0);
}
}
SendDlgItemMessage(hDlg, IDC_DSOUND_HW_ACCEL, CB_RESETCONTENT, 0, 0);
for (i = 0; NULL != DSound_HW_Accels[i]; ++i) {
SendDlgItemMessage(hDlg, IDC_DSOUND_HW_ACCEL, CB_ADDSTRING, 0, (LPARAM) DSound_HW_Accels[i]);
}
buf = get_reg_key(config_key, keypath("DirectSound"), "HardwareAcceleration", "Full");
for (i = 0; NULL != DSound_HW_Accels[i]; ++i) {
if (strcmp(buf, DSound_HW_Accels[i]) == 0) {
SendDlgItemMessage(hDlg, IDC_DSOUND_HW_ACCEL, CB_SETCURSEL, i, 0);
break ;
}
}
if (NULL == DSound_HW_Accels[i]) {
WINE_ERR("Invalid Direct Sound HW Accel read from registry (%s)\n", buf);
}
HeapFree(GetProcessHeap(), 0, buf);
buf = get_reg_key(config_key, keypath("DirectSound"), "EmulDriver", "N");
if (IS_OPTION_TRUE(*buf))
CheckDlgButton(hDlg, IDC_DSOUND_DRV_EMUL, BST_CHECKED);
else
CheckDlgButton(hDlg, IDC_DSOUND_DRV_EMUL, BST_UNCHECKED);
HeapFree(GetProcessHeap(), 0, buf);
}
static const char *audioAutoDetect(void)
......@@ -226,6 +260,23 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case IDC_AUDIO_CONTROL_PANEL:
MessageBox(NULL, "Launching audio control panel not implemented yet!", "Fixme", MB_OK | MB_ICONERROR);
break;
case IDC_DSOUND_HW_ACCEL:
if (HIWORD(wParam) == CBN_SELCHANGE) {
int selected_dsound_accel;
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
selected_dsound_accel = SendDlgItemMessage(hDlg, IDC_DSOUND_HW_ACCEL, CB_GETCURSEL, 0, 0);
set_reg_key(config_key, keypath("DirectSound"), "HardwareAcceleration", DSound_HW_Accels[selected_dsound_accel]);
}
break;
case IDC_DSOUND_DRV_EMUL:
if (HIWORD(wParam) == BN_CLICKED) {
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
if (IsDlgButtonChecked(hDlg, IDC_DSOUND_DRV_EMUL) == BST_CHECKED)
set_reg_key(config_key, keypath("DirectSound"), "EmulDriver", "Y");
else
set_reg_key(config_key, keypath("DirectSound"), "EmulDriver", "N");
}
break;
}
break;
......
......@@ -127,3 +127,5 @@
#define IDC_AUDIO_DRIVER 1301
#define IDC_AUDIO_CONFIGURE 1302
#define IDC_AUDIO_CONTROL_PANEL 1303
#define IDC_DSOUND_HW_ACCEL 1304
#define IDC_DSOUND_DRV_EMUL 1305
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