winecfg: Use sound tree view for driver selection.

- Move driver selection and configuration into tree view.
- Only show loadable drivers.
This commit is contained in:
Robert Reif 2005-12-17 12:30:06 +01:00 committed by Alexandre Julliard
parent 8accfc1def
commit f0c55e7d52
19 changed files with 548 additions and 299 deletions

View File

@ -1,4 +1,5 @@
Makefile
idb_checkbox.bmp
idb_wine.bmp
winecfg
winecfg.res

View File

@ -22,6 +22,14 @@
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 8, "MS Shell Dlg"
@ -154,18 +162,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Çâóêîâ äðàéâåð: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Îòêðèâàíå",IDC_AUDIO_AUTODETECT,170,20,69,14
PUSHBUTTON "Íàñòðîéêà",IDC_AUDIO_CONFIGURE,170,40,69,14
PUSHBUTTON "Êîíòðîëåí ïàíåë",IDC_AUDIO_CONTROL_PANEL,170,60,69,14
CONTROL "Óñòðîéñòâà",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Õàðäóåðíî óñêîðåíèå: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Ñîôòóåðíà åìóëàöèÿ",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Çâóêîâ äðàéâåð ",IDC_STATIC,15,20,227,30
CONTROL "Óñòðîéñòâà",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "Êîíòðîëåí ïàíåë",IDC_AUDIO_CONTROL_PANEL,170,50,69,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "Õàðäóåðíî óñêîðåíèå: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Ñîôòóåðíà åìóëàöèÿ",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -22,6 +22,14 @@
LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 8, "MS Shell Dlg"
@ -151,16 +159,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Audio Treiber: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Automatisch",IDC_AUDIO_AUTODETECT,170,20,59,14
PUSHBUTTON "Konfigurieren",IDC_AUDIO_CONFIGURE,170,40,59,14
PUSHBUTTON "Kontrollschirm",IDC_AUDIO_CONTROL_PANEL,170,60,59,14
CONTROL "Geräte",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Hardware Beschleunigung: ", IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Treiber Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Audio Treiber: ",IDC_STATIC,15,20,227,30
CONTROL "Geräte",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,50,140,140
PUSHBUTTON "Kontrollschirm",IDC_AUDIO_CONTROL_PANEL,170,50,59,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Hardware Beschleunigung: ", IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Treiber Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -24,6 +24,14 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 8, "MS Shell Dlg"
@ -153,16 +161,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Audio driver: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Autodetect",IDC_AUDIO_AUTODETECT,170,20,59,14
PUSHBUTTON "Configure",IDC_AUDIO_CONFIGURE,170,40,59,14
PUSHBUTTON "Control Panel",IDC_AUDIO_CONTROL_PANEL,170,60,59,14
CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
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
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Select a sound driver by checking the box of the desired driver. Disable sound by not selecting any driver. Selection of multiple drivers is not recomended. Configure a driver by right clicking on it.",IDC_STATIC,15,20,227,30
CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "Control Panel",IDC_AUDIO_CONTROL_PANEL,170,50,59,14
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
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -22,6 +22,14 @@
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 8, "MS Shell Dlg"
@ -151,16 +159,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Manejador audio:",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Autodetectar",IDC_AUDIO_AUTODETECT,170,20,59,14
PUSHBUTTON "Configurar",IDC_AUDIO_CONFIGURE,170,40,59,14
PUSHBUTTON "Panel de control",IDC_AUDIO_CONTROL_PANEL,170,60,59,14
CONTROL "Dispositivos",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Aceleración Hardware: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Emulación del manejador",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Manejador audio:",IDC_STATIC,15,20,227,30
CONTROL "Dispositivos",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "Panel de control",IDC_AUDIO_CONTROL_PANEL,170,50,59,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Aceleración Hardware: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Emulación del manejador",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -22,6 +22,14 @@
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 8, "MS Shell Dlg"
@ -150,17 +158,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Ääniajuri: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Tunnista automaattisesti",IDC_AUDIO_AUTODETECT,170,20,79,14
PUSHBUTTON "&Määritä",IDC_AUDIO_CONFIGURE,170,40,79,14
PUSHBUTTON "&Hallintapaneeli",IDC_AUDIO_CONTROL_PANEL,170,60,79,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "Laitteistopohjainen kiihdytys:",IDC_STATIC,15,85,110,10
COMBOBOX IDC_DSOUND_HW_ACCEL,125,83,100,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Ajurin &emulointi",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Ääniajuri: ",IDC_STATIC,15,20,227,30
CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "&Hallintapaneeli",IDC_AUDIO_CONTROL_PANEL,170,50,79,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Laitteistopohjainen kiihdytys:",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Ajurin &emulointi",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -22,6 +22,14 @@
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 8, "MS Shell Dlg"
@ -152,17 +160,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Pilote audio: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Autodétection",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 "Accélération matérielle: ",IDC_STATIC,15,85,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Emulation pilote",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Pilote audio: ",IDC_STATIC,15,20,227,30
CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "Panneau de configuration",IDC_AUDIO_CONTROL_PANEL,170,50,85,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Accélération matérielle: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Emulation pilote",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -24,6 +24,14 @@
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
FONT 9, "MS UI Gothic"
@ -153,18 +161,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 9, "MS UI Gothic"
BEGIN
LTEXT "オーディオドライバ: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "自動検出",IDC_AUDIO_AUTODETECT,170,20,49,14
PUSHBUTTON "設定",IDC_AUDIO_CONFIGURE,170,40,49,14
PUSHBUTTON "コントロールパネル",IDC_AUDIO_CONTROL_PANEL,170,60,49,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "ハードウェア・アクセラレーション: ",IDC_STATIC,15,85,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "ドライバ・エミュレーション",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "オーディオドライバ: ",IDC_STATIC,10,20,277,30
CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "コントロールパネル",IDC_AUDIO_CONTROL_PANEL,170,50,49,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "ハードウェア・アクセラレーション: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "ドライバ・エミュレーション",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -24,6 +24,14 @@
*/
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
@ -154,16 +162,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "오디오 드라이버: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "자동검색",IDC_AUDIO_AUTODETECT,170,20,59,14
PUSHBUTTON "설정",IDC_AUDIO_CONFIGURE,170,40,59,14
PUSHBUTTON "제어판",IDC_AUDIO_CONTROL_PANEL,170,60,59,14
CONTROL "장치",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
GROUPBOX "DirectSound ",IDC_STATIC,8,205,244,120
LTEXT "하드웨어 가속: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "드라이버 애뮬",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "오디오 드라이버: ",IDC_STATIC,10,20,227,30
CONTROL "장치",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,50,140,140
PUSHBUTTON "제어판",IDC_AUDIO_CONTROL_PANEL,170,50,59,14
GROUPBOX "DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "하드웨어 가속: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "드라이버 애뮬",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winecfg.exe
APPMODE = -mwindows
IMPORTS = comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 advapi32 kernel32
IMPORTS = comdlg32 comctl32 shell32 ole32 winmm shlwapi uxtheme user32 gdi32 advapi32 kernel32
C_SRCS = \
appdefaults.c \
@ -21,7 +21,9 @@ C_SRCS = \
RC_SRCS = winecfg.rc
RC_BINSRC = winecfg.rc
RC_BINARIES = idb_wine.bmp
RC_BINARIES = \
idb_checkbox.bmp \
idb_wine.bmp
@MAKE_PROG_RULES@

View File

@ -22,6 +22,14 @@
*/
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
@ -151,16 +159,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Geluidsbesturing: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Automatisch detecteren",IDC_AUDIO_AUTODETECT,170,18,79,14
PUSHBUTTON "Configureer",IDC_AUDIO_CONFIGURE,170,38,79,14
PUSHBUTTON "Configuratiescherm",IDC_AUDIO_CONTROL_PANEL,170,58,79,14
CONTROL "Apparaten",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Hardwareversnelling: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Stuurprogramma emulatie",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Geluidsbesturing: ",IDC_STATIC,15,20,227,30
CONTROL "Apparaten",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,50,150,160
PUSHBUTTON "Configuratiescherm",IDC_AUDIO_CONTROL_PANEL,170,50,79,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Hardwareversnelling: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Stuurprogramma emulatie",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -21,6 +21,14 @@
*/
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
@ -150,16 +158,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Lyddriver: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Automatisk",IDC_AUDIO_AUTODETECT,170,20,59,14
PUSHBUTTON "Oppsett",IDC_AUDIO_CONFIGURE,170,40,59,14
PUSHBUTTON "Kontrollpanel",IDC_AUDIO_CONTROL_PANEL,170,60,59,14
CONTROL "Enheter",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,10,40,150,160
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Maskinvareakselerasjon: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Driveremulering",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Lyddriver: ",IDC_STATIC,15,20,227,30
CONTROL "Enheter",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "Kontrollpanel",IDC_AUDIO_CONTROL_PANEL,170,50,59,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Maskinvareakselerasjon: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Driveremulering",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -21,6 +21,14 @@
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
IDR_WINECFG MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "Configure", IDC_AUDIO_CONFIGURE
END
END
IDD_ABOUTCFG DIALOGEX 0, 0, 260, 270
STYLE WS_CHILD
@ -154,18 +162,14 @@ IDD_AUDIOCFG DIALOG DISCARDABLE 0, 0, 260, 250
STYLE WS_CHILD | WS_DISABLED
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Çâóêîâîé äðàéâåð: ",IDC_STATIC,40,20,90,8
COMBOBOX IDC_AUDIO_DRIVER,40,40,75,105,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Îïðåäåëèòü àâòîìàòè÷åñêè",IDC_AUDIO_AUTODETECT,150,20,100,14
PUSHBUTTON "Íàñòðîèòü",IDC_AUDIO_CONFIGURE,170,40,80,14
PUSHBUTTON "Ïàíåëü óïðàâëåíèÿ",IDC_AUDIO_CONTROL_PANEL,170,60,80,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "Àïïàðàòíîå óñêîðåíèå: ",IDC_STATIC,15,85,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Ïðîãðàììíàÿ ýìóëÿöèÿ",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195
LTEXT "Çâóêîâîé äðàéâåð: ",IDC_STATIC,15,20,227,30
CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140
PUSHBUTTON "Ïàíåëü óïðàâëåíèÿ",IDC_AUDIO_CONTROL_PANEL,170,50,80,14
GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60
LTEXT "Àïïàðàòíîå óñêîðåíèå: ",IDC_STATIC,15,215,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Ïðîãðàììíàÿ ýìóëÿöèÿ",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250

View File

@ -40,6 +40,7 @@
#include <shlguid.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <mmreg.h>
#include <mmsystem.h>
@ -50,6 +51,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
#define DRIVER_MASK 0x80000000
#define DEVICE_MASK 0x40000000
typedef DWORD (WINAPI * MessagePtr)(UINT, UINT, DWORD, DWORD, DWORD);
static const char* DSound_HW_Accels[] = {
@ -60,68 +64,112 @@ static const char* DSound_HW_Accels[] = {
NULL
};
/* Select the correct entry in the combobox based on drivername */
static void selectAudioDriver(HWND hDlg, const char *drivername)
{
int i;
const AUDIO_DRIVER *pAudioDrv = NULL;
/* list of available drivers */
static AUDIO_DRIVER * loadedAudioDrv;
if ((pAudioDrv = getAudioDrivers()))
{
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++)
/* local copy of registry setting */
static char curAudioDriver[1024];
/* driver index to configure */
static int toConfigure;
/* display a driver specific configuration dialog */
static void configureAudioDriver(HWND hDlg)
{
const AUDIO_DRIVER *pAudioDrv = &loadedAudioDrv[toConfigure];
if (strlen(pAudioDrv->szDriver) != 0)
{
if (!strcmp (pAudioDrv->szDriver, drivername))
{
set_reg_key(config_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);
}
HDRVR hdrvr;
char wine_driver[MAX_NAME_LENGTH + 8];
sprintf(wine_driver, "wine%s.drv", pAudioDrv->szDriver);
hdrvr = OpenDriverA(wine_driver, 0, 0);
if (hdrvr != 0)
{
if (SendDriverMessage(hdrvr, DRV_QUERYCONFIGURE, 0, 0) != 0)
{
DRVCONFIGINFO dci;
LONG lRes;
dci.dwDCISize = sizeof (dci);
dci.lpszDCISectionName = NULL;
dci.lpszDCIAliasName = NULL;
lRes = SendDriverMessage(hdrvr, DRV_CONFIGURE, 0, (LONG)&dci);
}
CloseDriver(hdrvr, 0, 0);
}
else
{
char str[1024];
sprintf(str, "Couldn't open %s!", wine_driver);
MessageBox(hDlg, str, "Fixme", MB_OK | MB_ICONERROR);
}
}
}
}
static void configureAudioDriver(HWND hDlg, const char *drivername)
/* is driver in local copy of driver registry string */
static BOOL isDriverSet(const char * driver)
{
int i;
const AUDIO_DRIVER *pAudioDrv = NULL;
WINE_TRACE("driver = %s, curAudioDriver = %s\n", driver, curAudioDriver);
if ((pAudioDrv = getAudioDrivers()))
{
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++)
if (strstr(curAudioDriver, driver))
return TRUE;
return FALSE;
}
/* add driver to local copy of driver registry string */
static void addDriver(const char * driver)
{
if (!isDriverSet(driver))
{
if (!strcmp (pAudioDrv->szDriver, drivername))
{
if (strlen(pAudioDrv->szDriver) != 0)
{
HDRVR hdrvr;
char wine_driver[MAX_NAME_LENGTH + 8];
sprintf(wine_driver, "wine%s.drv", pAudioDrv->szDriver);
hdrvr = OpenDriverA(wine_driver, 0, 0);
if (hdrvr != 0)
{
if (SendDriverMessage(hdrvr, DRV_QUERYCONFIGURE, 0, 0) != 0)
{
DRVCONFIGINFO dci;
LONG lRes;
dci.dwDCISize = sizeof (dci);
dci.lpszDCISectionName = NULL;
dci.lpszDCIAliasName = NULL;
lRes = SendDriverMessage(hdrvr, DRV_CONFIGURE, 0, (LONG)&dci);
}
CloseDriver(hdrvr, 0, 0);
}
else
{
char str[1024];
sprintf(str, "Couldn't open %s!", wine_driver);
MessageBox(NULL, str, "Fixme", MB_OK | MB_ICONERROR);
}
}
break;
}
if (strlen(curAudioDriver))
strcat(curAudioDriver, ",");
strcat(curAudioDriver, driver);
}
}
/* remove driver from local copy of driver registry string */
static void removeDriver(const char * driver)
{
char before[32], after[32], * start;
strcpy(before, ",");
strcat(before, driver);
strcpy(after, driver);
strcat(after, ",");
if ((start = strstr(curAudioDriver, after)))
{
int len = strlen(after);
char * end = curAudioDriver + strlen(curAudioDriver);
int i, count = end - start + len;
for (i = 0; i < count; i++)
{
if (start + len >= end)
*start = 0;
else
*start = start[len];
start++;
}
}
else if ((start = strstr(curAudioDriver, before)))
{
int len = strlen(before);
char * end = curAudioDriver + strlen(curAudioDriver);
int i, count = end - start + len;
for (i = 0; i < count; i++)
{
if (start + len >= end)
*start = 0;
else
*start = start[len];
start++;
}
}
else if (strcmp(curAudioDriver, driver) == 0)
{
strcpy(curAudioDriver, "");
}
}
}
static void initAudioDeviceTree(HWND hDlg)
@ -131,45 +179,42 @@ static void initAudioDeviceTree(HWND hDlg)
TVINSERTSTRUCT insert;
HTREEITEM root, driver[10];
HWND tree = NULL;
HIMAGELIST hImageList;
HBITMAP hBitMap;
tree = GetDlgItem(hDlg, IDC_AUDIO_TREE);
if (!tree)
return;
/* set tree view style */
SetWindowLong(tree, GWL_STYLE, GetWindowLong(tree, GWL_STYLE) | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT);
/* state checkbox */
hImageList = ImageList_Create(16, 16, FALSE, 3, 0);
hBitMap = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_CHECKBOX));
ImageList_Add(hImageList, hBitMap, NULL);
DeleteObject(hBitMap);
TreeView_SetImageList(tree, hImageList, TVSIL_STATE);
/* root item */
insert.hParent = TVI_ROOT;
insert.hInsertAfter = TVI_LAST;
insert.u.item.mask = TVIF_TEXT | TVIF_CHILDREN;
insert.u.item.pszText = "Sound Drivers";
insert.u.item.cChildren = 1;
root = (HTREEITEM)SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
pAudioDrv = getAudioDrivers();
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++) {
/* iterate over list of loaded drivers */
for (pAudioDrv = loadedAudioDrv, i = 0; *pAudioDrv->szName; i++, pAudioDrv++) {
HDRVR hdrv;
char name[MAX_PATH];
char text[MAX_PATH];
if (strlen(pAudioDrv->szDriver) == 0)
continue;
sprintf(name, "wine%s.drv", pAudioDrv->szDriver);
sprintf(text, "%s Driver", pAudioDrv->szName);
hdrv = OpenDriverA(name, 0, 0);
if (hdrv == 0) /* no driver loaded */
{
insert.hParent = root;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.pszText = text;
driver[i] = (HTREEITEM)SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
else
if ((hdrv = OpenDriverA(name, 0, 0)))
{
HMODULE lib;
if ((lib = GetDriverModuleHandle(hdrv)))
@ -203,8 +248,10 @@ static void initAudioDeviceTree(HWND hDlg)
if (num_wod == 0 && num_wid == 0 && num_mod == 0 && num_mid == 0 && num_aux == 0 && num_mxd == 0)
{
insert.hParent = root;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;
insert.u.item.pszText = text;
insert.u.item.stateMask = TVIS_STATEIMAGEMASK;
insert.u.item.lParam = i + DRIVER_MASK;
driver[i] = (HTREEITEM)SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -213,9 +260,16 @@ static void initAudioDeviceTree(HWND hDlg)
HTREEITEM type;
insert.hParent = root;
insert.u.item.mask = TVIF_TEXT | TVIF_CHILDREN;
insert.u.item.mask = TVIF_TEXT | TVIF_CHILDREN | TVIF_STATE | TVIF_PARAM;
insert.u.item.pszText = text;
insert.u.item.cChildren = 1;
insert.u.item.stateMask = TVIS_STATEIMAGEMASK;
insert.u.item.lParam = i + DRIVER_MASK;
if (isDriverSet(pAudioDrv->szDriver))
insert.u.item.state = INDEXTOSTATEIMAGEMASK(2);
else
insert.u.item.state = INDEXTOSTATEIMAGEMASK(1);
driver[i] = (HTREEITEM)SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
@ -233,12 +287,13 @@ static void initAudioDeviceTree(HWND hDlg)
WAVEOUTCAPSW caps;
char szPname[MAXPNAMELEN];
wodMessagePtr(j, WODM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
wodMessagePtr(j, WODM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
WideCharToMultiByte(CP_ACP, 0, caps.szPname, -1, szPname, MAXPNAMELEN, 0, 0);
insert.hParent = type;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_PARAM;
insert.u.item.pszText = szPname;
insert.u.item.lParam = j + DEVICE_MASK;
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -258,12 +313,13 @@ static void initAudioDeviceTree(HWND hDlg)
WAVEINCAPSW caps;
char szPname[MAXPNAMELEN];
widMessagePtr(j, WIDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
widMessagePtr(j, WIDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
WideCharToMultiByte(CP_ACP, 0, caps.szPname, -1, szPname, MAXPNAMELEN, 0, 0);
insert.hParent = type;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_PARAM;
insert.u.item.pszText = szPname;
insert.u.item.lParam = j + DEVICE_MASK;
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -283,12 +339,13 @@ static void initAudioDeviceTree(HWND hDlg)
MIDIOUTCAPSW caps;
char szPname[MAXPNAMELEN];
modMessagePtr(j, MODM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
modMessagePtr(j, MODM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
WideCharToMultiByte(CP_ACP, 0, caps.szPname, -1, szPname, MAXPNAMELEN, 0, 0);
insert.hParent = type;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_PARAM;
insert.u.item.pszText = szPname;
insert.u.item.lParam = j + DEVICE_MASK;
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -308,12 +365,13 @@ static void initAudioDeviceTree(HWND hDlg)
MIDIINCAPSW caps;
char szPname[MAXPNAMELEN];
midMessagePtr(j, MIDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
midMessagePtr(j, MIDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
WideCharToMultiByte(CP_ACP, 0, caps.szPname, -1, szPname, MAXPNAMELEN, 0, 0);
insert.hParent = type;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_PARAM;
insert.u.item.pszText = szPname;
insert.u.item.lParam = j + DEVICE_MASK;
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -333,12 +391,13 @@ static void initAudioDeviceTree(HWND hDlg)
AUXCAPSW caps;
char szPname[MAXPNAMELEN];
auxMessagePtr(j, AUXDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
auxMessagePtr(j, AUXDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
WideCharToMultiByte(CP_ACP, 0, caps.szPname, -1, szPname, MAXPNAMELEN, 0, 0);
insert.hParent = type;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_PARAM;
insert.u.item.pszText = szPname;
insert.u.item.lParam = j + DEVICE_MASK;
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -358,12 +417,13 @@ static void initAudioDeviceTree(HWND hDlg)
MIXERCAPSW caps;
char szPname[MAXPNAMELEN];
mxdMessagePtr(j, MXDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
mxdMessagePtr(j, MXDM_GETDEVCAPS, 0, (DWORD)&caps, sizeof(caps));
WideCharToMultiByte(CP_ACP, 0, caps.szPname, -1, szPname, MAXPNAMELEN, 0, 0);
insert.hParent = type;
insert.u.item.mask = TVIF_TEXT;
insert.u.item.mask = TVIF_TEXT | TVIF_PARAM;
insert.u.item.pszText = szPname;
insert.u.item.lParam = j + DEVICE_MASK;
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_INSERTITEM, 0, (LPARAM)&insert);
}
@ -379,31 +439,108 @@ static void initAudioDeviceTree(HWND hDlg)
SendDlgItemMessage(hDlg, IDC_AUDIO_TREE, TVM_EXPAND, TVE_EXPAND, (LPARAM)driver[j]);
}
/* find all drivers that can be loaded */
static void findAudioDrivers(void)
{
int numFound = 0;
const AUDIO_DRIVER *pAudioDrv = NULL;
/* delete an existing list */
if (loadedAudioDrv)
{
HeapFree(GetProcessHeap(), 0, loadedAudioDrv);
loadedAudioDrv = 0;
}
for (pAudioDrv = getAudioDrivers(); *pAudioDrv->szName; pAudioDrv++)
{
if (strlen(pAudioDrv->szDriver))
{
HDRVR hdrv;
char driver[MAX_PATH];
sprintf(driver, "wine%s.drv", pAudioDrv->szDriver);
if ((hdrv = OpenDriverA(driver, 0, 0)))
{
CloseDriver(hdrv, 0, 0);
if (loadedAudioDrv)
loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER));
else
loadedAudioDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(AUDIO_DRIVER));
CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER));
numFound++;
}
}
}
/* terminate list with empty driver */
loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER));
CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER));
}
/* check local copy of registry string for unloadable drivers */
static void checkRegistrySetting(HWND hDlg)
{
const AUDIO_DRIVER *pAudioDrv;
char * token, * tokens = strdup(curAudioDriver);
start_over:
token = strtok(tokens, ",");
while (token != NULL)
{
BOOL found = FALSE;
for (pAudioDrv = loadedAudioDrv; *pAudioDrv->szName; pAudioDrv++)
{
if (strcmp(token, pAudioDrv->szDriver) == 0)
{
found = TRUE;
break;
}
}
if (found == FALSE)
{
char str[1024];
sprintf(str, "Found driver in registry that in not available!\n\nRemove \"%s\" from registry?", token);
if (MessageBox(hDlg, str, "WARNING", MB_ICONWARNING | MB_YESNOCANCEL) == IDYES)
{
removeDriver(token);
strcpy(tokens, curAudioDriver);
goto start_over;
}
}
token = strtok(NULL, ",");
}
free(tokens);
}
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");
pAudioDrv = getAudioDrivers ();
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++) {
SendDlgItemMessage (hDlg, IDC_AUDIO_DRIVER, CB_ADDSTRING,
0, (LPARAM) pAudioDrv->szName);
if (!strcmp (pAudioDrv->szDriver, curAudioDriver)) {
SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_SETCURSEL, i, 0);
}
}
/* make a local copy of the current registry setting */
strcpy(curAudioDriver, get_reg_key(config_key, "Drivers", "Audio", ""));
WINE_TRACE("curAudioDriver = %s\n", curAudioDriver);
/* make a list of all drivers that can be loaded */
findAudioDrivers();
/* check for drivers that can't be loaded */
checkRegistrySetting(hDlg);
initAudioDeviceTree(hDlg);
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");
}
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);
@ -421,84 +558,16 @@ static void initAudioDlg (HWND hDlg)
else
CheckDlgButton(hDlg, IDC_DSOUND_DRV_EMUL, BST_UNCHECKED);
HeapFree(GetProcessHeap(), 0, buf);
}
static const char *audioAutoDetect(void)
{
const char *driversFound[10];
const char *name[10];
int numFound = 0;
const AUDIO_DRIVER *pAudioDrv = NULL;
int i;
pAudioDrv = getAudioDrivers();
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++)
{
if (strlen(pAudioDrv->szDriver))
{
HDRVR hdrv;
char driver[MAX_PATH];
sprintf(driver, "wine%s.drv", pAudioDrv->szDriver);
if ((hdrv = OpenDriverA(driver, 0, 0)))
{
CloseDriver(hdrv, 0, 0);
driversFound[numFound] = pAudioDrv->szDriver;
name[numFound] = pAudioDrv->szName;
numFound++;
}
}
}
if(numFound == 0)
{
MessageBox(NULL, "Could not detect any audio devices/servers", "Failed", MB_OK);
return "";
}
else
{
/* TODO: possibly smarter handling of multiple drivers? */
char text[128];
sprintf(text, "Found ");
for(i=0;i<numFound;i++)
{
strcat(text, name[i]);
if(i != numFound-1)
strcat(text,", ");
}
MessageBox(NULL, (LPCTSTR)text, "Successful", MB_OK);
return driversFound[0];
}
}
INT_PTR CALLBACK
AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_AUDIO_AUTODETECT:
selectAudioDriver(hDlg, audioAutoDetect());
break;
case IDC_AUDIO_DRIVER:
if ((HIWORD(wParam) == CBN_SELCHANGE) ||
(HIWORD(wParam) == CBN_SELCHANGE))
{
const AUDIO_DRIVER *pAudioDrv = getAudioDrivers();
int selected_driver = SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_GETCURSEL, 0, 0);
selectAudioDriver(hDlg, (char*)pAudioDrv[selected_driver].szDriver);
}
break;
case IDC_AUDIO_CONFIGURE:
{
const AUDIO_DRIVER *pAudioDrv = getAudioDrivers();
int selected_driver = SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_GETCURSEL, 0, 0);
configureAudioDriver(hDlg, (char*)pAudioDrv[selected_driver].szDriver);
}
configureAudioDriver(hDlg);
break;
case IDC_AUDIO_CONTROL_PANEL:
MessageBox(NULL, "Launching audio control panel not implemented yet!", "Fixme", MB_OK | MB_ICONERROR);
@ -508,12 +577,12 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
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]);
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);
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
@ -526,18 +595,92 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_SHOWWINDOW:
set_window_title(hDlg);
break;
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->code) {
case PSN_KILLACTIVE:
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
break;
case PSN_APPLY:
set_reg_key(config_key, "Drivers", "Audio", curAudioDriver);
apply();
SetWindowLongPtr(hDlg, DWLP_MSGRESULT, PSNRET_NOERROR);
break;
case PSN_SETACTIVE:
break;
case NM_CLICK:
if (((LPNMHDR)lParam)->idFrom == IDC_AUDIO_TREE)
{
TVHITTESTINFO ht;
DWORD dwPos = GetMessagePos();
HWND tree = ((LPNMHDR)lParam)->hwndFrom;
ZeroMemory(&ht, sizeof(ht));
ht.pt.x = GET_X_LPARAM(dwPos);
ht.pt.y = GET_Y_LPARAM(dwPos);
MapWindowPoints(HWND_DESKTOP, tree, &ht.pt, 1);
TreeView_HitTest(tree, &ht);
if (TVHT_ONITEMSTATEICON & ht.flags)
{
TVITEM tvItem;
int index;
ZeroMemory(&tvItem, sizeof(tvItem));
tvItem.hItem = ht.hItem;
TreeView_GetItem(tree, &tvItem);
index = TreeView_GetItemState(tree, ht.hItem, TVIS_STATEIMAGEMASK);
if (index == INDEXTOSTATEIMAGEMASK(1))
{
TreeView_SetItemState(tree, ht.hItem, INDEXTOSTATEIMAGEMASK(2), TVIS_STATEIMAGEMASK);
addDriver(loadedAudioDrv[tvItem.lParam & 0xff].szDriver);
SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM) hDlg, 0); /* enable apply button */
}
else if (index == INDEXTOSTATEIMAGEMASK(2))
{
TreeView_SetItemState(tree, ht.hItem, INDEXTOSTATEIMAGEMASK(1), TVIS_STATEIMAGEMASK);
removeDriver(loadedAudioDrv[tvItem.lParam & 0xff].szDriver);
SendMessage(GetParent(hDlg), PSM_CHANGED, (WPARAM) hDlg, 0); /* enable apply button */
}
}
}
break;
case NM_RCLICK:
if (((LPNMHDR)lParam)->idFrom == IDC_AUDIO_TREE)
{
TVHITTESTINFO ht;
DWORD dwPos = GetMessagePos();
HWND tree = ((LPNMHDR)lParam)->hwndFrom;
POINT pt;
ZeroMemory(&ht, sizeof(ht));
pt.x = GET_X_LPARAM(dwPos);
pt.y = GET_Y_LPARAM(dwPos);
ht.pt = pt;
MapWindowPoints(HWND_DESKTOP, tree, &ht.pt, 1);
TreeView_HitTest(tree, &ht);
if (TVHT_ONITEMLABEL & ht.flags)
{
TVITEM tvItem;
ZeroMemory(&tvItem, sizeof(tvItem));
tvItem.hItem = ht.hItem;
tvItem.mask = TVIF_PARAM;
tvItem.lParam = -1;
if (TreeView_GetItem(tree, &tvItem))
{
if (tvItem.lParam & DRIVER_MASK)
{
if (hPopupMenus)
{
TrackPopupMenu(GetSubMenu(hPopupMenus, 0), TPM_RIGHTBUTTON, pt.x, pt.y, 0, tree, NULL);
toConfigure = tvItem.lParam & ~DRIVER_MASK;
}
}
else if (tvItem.lParam & DEVICE_MASK)
{
/* FIXME TBD */
}
}
}
}
}
break;

View File

@ -259,7 +259,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrev, LPSTR szCmdLine, int nShow)
return 0;
}
if (initialize() != 0) {
if (initialize(hInstance) != 0) {
WINE_ERR("initialization failed, aborting\n");
ExitProcess(1);
}

View File

@ -133,13 +133,14 @@
#define IDC_APP_REMOVEAPP 1202
/* audio tab */
#define IDC_AUDIO_AUTODETECT 1300
#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
#define IDC_AUDIO_TREE 1306
#define IDC_AUDIO_CONFIGURE 1300
#define IDC_AUDIO_CONTROL_PANEL 1301
#define IDC_DSOUND_HW_ACCEL 1302
#define IDC_DSOUND_DRV_EMUL 1303
#define IDC_AUDIO_TREE 1304
#define IDR_WINECFG 1305
#define IDB_CHECKBOX 1306
#define IDB_DEVICE 1307
/* appearance tab */
#define IDC_THEME_COLORCOMBO 1401

View File

@ -38,9 +38,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(winecfg);
#include "winecfg.h"
#include "resource.h"
HKEY config_key = NULL;
HMENU hPopupMenus = 0;
/* this is called from the WM_SHOWWINDOW handlers of each tab page.
@ -604,7 +605,8 @@ void PRINTERROR(void)
WINE_TRACE("error: '%s'\n", msg);
}
int initialize(void) {
int initialize(HINSTANCE hInstance)
{
DWORD res = RegCreateKey(HKEY_CURRENT_USER, WINE_KEY_ROOT, &config_key);
if (res != ERROR_SUCCESS) {
@ -612,6 +614,9 @@ int initialize(void) {
return 1;
}
/* load any menus */
hPopupMenus = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_WINECFG));
/* we could probably just have the list as static data */
settings = HeapAlloc(GetProcessHeap(), 0, sizeof(struct list));
list_init(settings);

View File

@ -65,7 +65,7 @@ char **enumerate_values(HKEY root, char *path);
*/
char *keypath(const char *section);
int initialize(void);
int initialize(HINSTANCE hInstance);
extern HKEY config_key;
/* hack for the property sheet control */
@ -133,4 +133,6 @@ static inline void set_text(HWND dialog, WORD id, const char *text)
#define WINE_KEY_ROOT "Software\\Wine"
extern HMENU hPopupMenus;
#endif

View File

@ -964,3 +964,40 @@ IDB_WINE BITMAP idb_wine.bmp
'1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B 1B'
'1B 1B 1B 1B 00 00'
} */
/* BINRES idb_checkbox.bmp */
IDB_CHECKBOX BITMAP idb_checkbox.bmp
/* {
'42 4D F6 01 00 00 00 00 00 00 76 00 00 00 28 00'
'00 00 30 00 00 00 10 00 00 00 01 00 04 00 00 00'
'00 00 80 01 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80'
'00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80'
'00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF'
'00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF'
'00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF FF'
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00'
'00 00 00 00 00 0F FF 00 00 00 00 00 00 0F FF FF'
'FF FF FF FF FF FF FF 00 00 00 00 00 00 0F FF 00'
'00 00 00 00 00 0F FF FF FF FF FF FF FF FF FF 00'
'FF FF FF FF F0 0F FF 00 FF FF FF FF F0 0F FF FF'
'FF FF FF FF FF FF FF 00 FF FF FF FF F0 0F FF 00'
'FF F0 FF FF F0 0F FF FF FF FF FF FF FF FF FF 00'
'FF FF FF FF F0 0F FF 00 FF 00 0F FF F0 0F FF FF'
'FF FF FF FF FF FF FF 00 FF FF FF FF F0 0F FF 00'
'F0 00 00 FF F0 0F FF FF FF FF FF FF FF FF FF 00'
'FF FF FF FF F0 0F FF 00 F0 0F 00 0F F0 0F FF FF'
'FF FF FF FF FF FF FF 00 FF FF FF FF F0 0F FF 00'
'F0 FF F0 00 F0 0F FF FF FF FF FF FF FF FF FF 00'
'FF FF FF FF F0 0F FF 00 FF FF FF 00 F0 0F FF FF'
'FF FF FF FF FF FF FF 00 FF FF FF FF F0 0F FF 00'
'FF FF FF F0 F0 0F FF FF FF FF FF FF FF FF FF 00'
'FF FF FF FF F0 0F FF 00 FF FF FF FF F0 0F FF FF'
'FF FF FF FF FF FF FF 00 00 00 00 00 00 0F FF 00'
'00 00 00 00 00 0F FF FF FF FF FF FF FF FF FF 00'
'00 00 00 00 00 0F FF 00 00 00 00 00 00 0F FF FF'
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
'FF FF FF FF FF FF'
} */