diff --git a/programs/winecfg/.gitignore b/programs/winecfg/.gitignore index 6cea06eb057..fe762505f59 100644 --- a/programs/winecfg/.gitignore +++ b/programs/winecfg/.gitignore @@ -1,4 +1,5 @@ Makefile +idb_checkbox.bmp idb_wine.bmp winecfg winecfg.res diff --git a/programs/winecfg/Bg.rc b/programs/winecfg/Bg.rc index aae116e0b30..45c9c9740e9 100644 --- a/programs/winecfg/Bg.rc +++ b/programs/winecfg/Bg.rc @@ -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 diff --git a/programs/winecfg/De.rc b/programs/winecfg/De.rc index 7fb61309211..d0789637f93 100644 --- a/programs/winecfg/De.rc +++ b/programs/winecfg/De.rc @@ -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 "Gerte",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 "Gerte",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 diff --git a/programs/winecfg/En.rc b/programs/winecfg/En.rc index dfa545191b0..5a750ff05a6 100644 --- a/programs/winecfg/En.rc +++ b/programs/winecfg/En.rc @@ -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 diff --git a/programs/winecfg/Es.rc b/programs/winecfg/Es.rc index d9e0cd8725d..748c90fd7dc 100644 --- a/programs/winecfg/Es.rc +++ b/programs/winecfg/Es.rc @@ -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 "Aceleracin Hardware: ",IDC_STATIC,15,215,90,10 - COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Emulacin 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 "Aceleracin Hardware: ",IDC_STATIC,15,215,90,10 + COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Emulacin del manejador",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10 END IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250 diff --git a/programs/winecfg/Fi.rc b/programs/winecfg/Fi.rc index ccc692cf8d4..8526b2ebb1c 100644 --- a/programs/winecfg/Fi.rc +++ b/programs/winecfg/Fi.rc @@ -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 "&Mrit",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 diff --git a/programs/winecfg/Fr.rc b/programs/winecfg/Fr.rc index deedca3dca8..f71a70bd176 100644 --- a/programs/winecfg/Fr.rc +++ b/programs/winecfg/Fr.rc @@ -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 "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 "Acclration matrielle: ",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 "Acclration matrielle: ",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 diff --git a/programs/winecfg/Ja.rc b/programs/winecfg/Ja.rc index 4796b19c31f..4c8060b9cb2 100644 --- a/programs/winecfg/Ja.rc +++ b/programs/winecfg/Ja.rc @@ -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 "I[fBIhCo: ",IDC_STATIC,10,20,60,8 - COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "o",IDC_AUDIO_AUTODETECT,170,20,49,14 - PUSHBUTTON "ݒ",IDC_AUDIO_CONFIGURE,170,40,49,14 - PUSHBUTTON "Rg[pl",IDC_AUDIO_CONTROL_PANEL,170,60,49,14 - - GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120 - - LTEXT "n[hEFAEANZ[V: ",IDC_STATIC,15,85,90,10 - COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "hCoEG~[V",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10 - + GROUPBOX " Driver Selection ",IDC_STATIC,8,4,244,195 + LTEXT "I[fBIhCo: ",IDC_STATIC,10,20,277,30 + CONTROL "Devices",IDC_AUDIO_TREE,"SysTreeView32",WS_BORDER | WS_TABSTOP,15,50,140,140 + PUSHBUTTON "Rg[pl",IDC_AUDIO_CONTROL_PANEL,170,50,49,14 + GROUPBOX " DirectSound ",IDC_STATIC,8,205,244,60 + LTEXT "n[hEFAEANZ[V: ",IDC_STATIC,15,215,90,10 + COMBOBOX IDC_DSOUND_HW_ACCEL,100,213,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "hCoEG~[V",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,230,230,10 END IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250 diff --git a/programs/winecfg/Ko.rc b/programs/winecfg/Ko.rc index 56e04229fe9..da192ed1622 100644 --- a/programs/winecfg/Ko.rc +++ b/programs/winecfg/Ko.rc @@ -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 diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in index a0de554b9fd..7f79b38644a 100644 --- a/programs/winecfg/Makefile.in +++ b/programs/winecfg/Makefile.in @@ -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@ diff --git a/programs/winecfg/Nl.rc b/programs/winecfg/Nl.rc index b4cdf9a6f23..d30b079789a 100644 --- a/programs/winecfg/Nl.rc +++ b/programs/winecfg/Nl.rc @@ -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 diff --git a/programs/winecfg/No.rc b/programs/winecfg/No.rc index 7e49c4b0a4b..cef2a52b3e2 100644 --- a/programs/winecfg/No.rc +++ b/programs/winecfg/No.rc @@ -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 diff --git a/programs/winecfg/Ru.rc b/programs/winecfg/Ru.rc index 22eec6ad3b8..9bfe9233ebe 100644 --- a/programs/winecfg/Ru.rc +++ b/programs/winecfg/Ru.rc @@ -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 diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c index 36227ca8bb0..ae079df8de8 100644 --- a/programs/winecfg/audio.c +++ b/programs/winecfg/audio.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -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;icode) { 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; diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c index f9ea205e128..a49d9395c1b 100644 --- a/programs/winecfg/main.c +++ b/programs/winecfg/main.c @@ -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); } diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h index bed9c1b14bb..e79f86135f7 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -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 diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c index 560d6169d34..96d8f7a5d94 100644 --- a/programs/winecfg/winecfg.c +++ b/programs/winecfg/winecfg.c @@ -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); diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h index b100b6803b2..0e78d2fa242 100644 --- a/programs/winecfg/winecfg.h +++ b/programs/winecfg/winecfg.h @@ -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 diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc index 15b0eec4205..f929056da12 100644 --- a/programs/winecfg/winecfg.rc +++ b/programs/winecfg/winecfg.rc @@ -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' +} */