winecfg: Add default dsound sample rate and bits per sample.
This commit is contained in:
parent
44b7760e6a
commit
a76023f02a
|
@ -168,7 +168,11 @@ BEGIN
|
|||
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
|
||||
LTEXT "Hardware Acceleration: ",IDC_STATIC,15,215,90,10
|
||||
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Driver Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
|
||||
LTEXT "Default Sample Rate:",IDC_STATIC,15,232,70,8
|
||||
COMBOBOX IDC_DSOUND_RATES,90,230,42,76,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Default Bits Per Sample:",IDC_STATIC,137,232,80,8
|
||||
COMBOBOX IDC_DSOUND_BITS,220,230,30,56,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Driver Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,250,230,10
|
||||
END
|
||||
|
||||
IDD_DESKTOP_INTEGRATION DIALOG DISCARDABLE 0, 0, 260, 250
|
||||
|
|
|
@ -60,6 +60,22 @@ static const char* DSound_HW_Accels[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static const char* DSound_Rates[] = {
|
||||
"48000",
|
||||
"44100",
|
||||
"22050",
|
||||
"16000",
|
||||
"11025",
|
||||
"8000",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char* DSound_Bits[] = {
|
||||
"8",
|
||||
"16",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const AUDIO_DRIVER sAudioDrivers[] = {
|
||||
{"ALSA", "alsa"},
|
||||
{"aRts", "arts"},
|
||||
|
@ -635,6 +651,30 @@ static void initAudioDlg (HWND hDlg)
|
|||
}
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
|
||||
SendDlgItemMessage(hDlg, IDC_DSOUND_RATES, CB_RESETCONTENT, 0, 0);
|
||||
for (i = 0; NULL != DSound_Rates[i]; ++i) {
|
||||
SendDlgItemMessage(hDlg, IDC_DSOUND_RATES, CB_ADDSTRING, 0, (LPARAM) DSound_Rates[i]);
|
||||
}
|
||||
buf = get_reg_key(config_key, keypath("DirectSound"), "DefaultSampleRate", "22050");
|
||||
for (i = 0; NULL != DSound_Rates[i]; ++i) {
|
||||
if (strcmp(buf, DSound_Rates[i]) == 0) {
|
||||
SendDlgItemMessage(hDlg, IDC_DSOUND_RATES, CB_SETCURSEL, i, 0);
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
SendDlgItemMessage(hDlg, IDC_DSOUND_BITS, CB_RESETCONTENT, 0, 0);
|
||||
for (i = 0; NULL != DSound_Bits[i]; ++i) {
|
||||
SendDlgItemMessage(hDlg, IDC_DSOUND_BITS, CB_ADDSTRING, 0, (LPARAM) DSound_Bits[i]);
|
||||
}
|
||||
buf = get_reg_key(config_key, keypath("DirectSound"), "DefaultBitsPerSample", "8");
|
||||
for (i = 0; NULL != DSound_Bits[i]; ++i) {
|
||||
if (strcmp(buf, DSound_Bits[i]) == 0) {
|
||||
SendDlgItemMessage(hDlg, IDC_DSOUND_BITS, CB_SETCURSEL, i, 0);
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
buf = get_reg_key(config_key, keypath("DirectSound"), "EmulDriver", "N");
|
||||
if (IS_OPTION_TRUE(*buf))
|
||||
CheckDlgButton(hDlg, IDC_DSOUND_DRV_EMUL, BST_CHECKED);
|
||||
|
@ -663,6 +703,22 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
set_reg_key(config_key, keypath("DirectSound"), "HardwareAcceleration", DSound_HW_Accels[selected_dsound_accel]);
|
||||
}
|
||||
break;
|
||||
case IDC_DSOUND_RATES:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||
int selected_dsound_rate;
|
||||
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
|
||||
selected_dsound_rate = SendDlgItemMessage(hDlg, IDC_DSOUND_RATES, CB_GETCURSEL, 0, 0);
|
||||
set_reg_key(config_key, keypath("DirectSound"), "DefaultSampleRate", DSound_Rates[selected_dsound_rate]);
|
||||
}
|
||||
break;
|
||||
case IDC_DSOUND_BITS:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||
int selected_dsound_bits;
|
||||
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
|
||||
selected_dsound_bits = SendDlgItemMessage(hDlg, IDC_DSOUND_BITS, CB_GETCURSEL, 0, 0);
|
||||
set_reg_key(config_key, keypath("DirectSound"), "DefaultBitsPerSample", DSound_Bits[selected_dsound_bits]);
|
||||
}
|
||||
break;
|
||||
case IDC_DSOUND_DRV_EMUL:
|
||||
if (HIWORD(wParam) == BN_CLICKED) {
|
||||
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
|
||||
|
|
|
@ -151,6 +151,8 @@
|
|||
#define IDB_CHECKBOX 1306
|
||||
#define IDB_DEVICE 1307
|
||||
#define IDS_AUDIO_MISSING 1308
|
||||
#define IDC_DSOUND_RATES 1309
|
||||
#define IDC_DSOUND_BITS 1310
|
||||
|
||||
/* desktop integration tab */
|
||||
#define IDC_THEME_COLORCOMBO 1401
|
||||
|
|
Loading…
Reference in New Issue