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
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,12 +159,10 @@ 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 " 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

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,12 +161,10 @@ 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 " 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

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,12 +159,10 @@ 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 " 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

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

@ -25,6 +25,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
FONT 8, "MS Shell Dlg"
@ -154,13 +162,11 @@ 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
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

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

@ -23,6 +23,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
FONT 8, "MS Shell Dlg"
@ -151,12 +159,10 @@ 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 " 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

View File

@ -22,6 +22,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
FONT 8, "MS Shell Dlg"
@ -150,12 +158,10 @@ 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 " 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

View File

@ -22,6 +22,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
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,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,38 +64,20 @@ 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++)
{
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);
}
}
}
}
/* local copy of registry setting */
static char curAudioDriver[1024];
static void configureAudioDriver(HWND hDlg, const char *drivername)
{
int i;
const AUDIO_DRIVER *pAudioDrv = NULL;
/* driver index to configure */
static int toConfigure;
if ((pAudioDrv = getAudioDrivers()))
{
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++)
{
if (!strcmp (pAudioDrv->szDriver, drivername))
/* display a driver specific configuration dialog */
static void configureAudioDriver(HWND hDlg)
{
const AUDIO_DRIVER *pAudioDrv = &loadedAudioDrv[toConfigure];
if (strlen(pAudioDrv->szDriver) != 0)
{
HDRVR hdrvr;
@ -115,12 +101,74 @@ static void configureAudioDriver(HWND hDlg, const char *drivername)
{
char str[1024];
sprintf(str, "Couldn't open %s!", wine_driver);
MessageBox(NULL, str, "Fixme", MB_OK | MB_ICONERROR);
MessageBox(hDlg, str, "Fixme", MB_OK | MB_ICONERROR);
}
}
break;
}
/* is driver in local copy of driver registry string */
static BOOL isDriverSet(const char * driver)
{
WINE_TRACE("driver = %s, curAudioDriver = %s\n", driver, curAudioDriver);
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 (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, "");
}
}
@ -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);
@ -237,8 +291,9 @@ static void initAudioDeviceTree(HWND hDlg)
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);
}
@ -262,8 +317,9 @@ static void initAudioDeviceTree(HWND hDlg)
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);
}
@ -287,8 +343,9 @@ static void initAudioDeviceTree(HWND hDlg)
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);
}
@ -312,8 +369,9 @@ static void initAudioDeviceTree(HWND hDlg)
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);
}
@ -337,8 +395,9 @@ static void initAudioDeviceTree(HWND hDlg)
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);
}
@ -362,8 +421,9 @@ static void initAudioDeviceTree(HWND hDlg)
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,23 +439,100 @@ 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);
@ -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);
@ -533,11 +602,85 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
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'
} */