Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1758ba6c
Commit
1758ba6c
authored
Dec 07, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Dec 07, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecfg: Show all sound card drivers and their devices.
parent
2e5da5f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
273 additions
and
10 deletions
+273
-10
En.rc
programs/winecfg/En.rc
+8
-10
audio.c
programs/winecfg/audio.c
+264
-0
resource.h
programs/winecfg/resource.h
+1
-0
No files found.
programs/winecfg/En.rc
View file @
1758ba6c
...
...
@@ -155,16 +155,14 @@ 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,49,14
PUSHBUTTON "Configure",IDC_AUDIO_CONFIGURE,170,40,49,14
PUSHBUTTON "Control Panel",IDC_AUDIO_CONTROL_PANEL,170,60,49,14
GROUPBOX " DirectSound ",IDC_STATIC,8,75,244,120
LTEXT "Hardware Acceleration: ",IDC_STATIC,15,85,90,10
COMBOBOX IDC_DSOUND_HW_ACCEL,100,83,150,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Driver Emulation",IDC_DSOUND_DRV_EMUL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,100,230,10
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
END
IDD_APPEARANCE DIALOG DISCARDABLE 0, 0, 260, 250
...
...
programs/winecfg/audio.c
View file @
1758ba6c
...
...
@@ -38,12 +38,17 @@
#include <shlwapi.h>
#include <shlobj.h>
#include <mmsystem.h>
#include <mmreg.h>
#include <mmsystem.h>
#include <mmddk.h>
#include "winecfg.h"
#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
winecfg
);
typedef
DWORD
(
WINAPI
*
MessagePtr
)(
UINT
,
UINT
,
DWORD
,
DWORD
,
DWORD
);
static
const
char
*
DSound_HW_Accels
[]
=
{
"Full"
,
"Standard"
,
...
...
@@ -116,6 +121,264 @@ static void configureAudioDriver(HWND hDlg, const char *drivername)
}
}
static
void
initAudioDeviceTree
(
HWND
hDlg
)
{
const
AUDIO_DRIVER
*
pAudioDrv
=
NULL
;
int
i
,
j
;
TVINSERTSTRUCT
insert
;
HTREEITEM
root
,
driver
[
10
];
HWND
tree
=
NULL
;
tree
=
GetDlgItem
(
hDlg
,
IDC_AUDIO_TREE
);
if
(
!
tree
)
return
;
SetWindowLong
(
tree
,
GWL_STYLE
,
GetWindowLong
(
tree
,
GWL_STYLE
)
|
TVS_HASBUTTONS
|
TVS_HASLINES
|
TVS_LINESATROOT
);
insert
.
hParent
=
TVI_ROOT
;
insert
.
hInsertAfter
=
TVI_LAST
;
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"Sound Drivers"
;
insert
.
item
.
cChildren
=
1
;
root
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
pAudioDrv
=
getAudioDrivers
();
for
(
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
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
text
;
driver
[
i
]
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
else
{
HINSTANCE
lib
;
lib
=
LoadLibrary
(
name
);
if
(
lib
)
{
int
num_wod
=
0
,
num_wid
=
0
,
num_mod
=
0
,
num_mid
=
0
,
num_aux
=
0
,
num_mxd
=
0
;
MessagePtr
wodMessagePtr
=
(
MessagePtr
)
GetProcAddress
(
lib
,
"wodMessage"
);
MessagePtr
widMessagePtr
=
(
MessagePtr
)
GetProcAddress
(
lib
,
"widMessage"
);
MessagePtr
modMessagePtr
=
(
MessagePtr
)
GetProcAddress
(
lib
,
"modMessage"
);
MessagePtr
midMessagePtr
=
(
MessagePtr
)
GetProcAddress
(
lib
,
"midMessage"
);
MessagePtr
auxMessagePtr
=
(
MessagePtr
)
GetProcAddress
(
lib
,
"auxMessage"
);
MessagePtr
mxdMessagePtr
=
(
MessagePtr
)
GetProcAddress
(
lib
,
"mxdMessage"
);
if
(
wodMessagePtr
)
num_wod
=
wodMessagePtr
(
0
,
WODM_GETNUMDEVS
,
0
,
0
,
0
);
if
(
widMessagePtr
)
num_wid
=
widMessagePtr
(
0
,
WIDM_GETNUMDEVS
,
0
,
0
,
0
);
if
(
modMessagePtr
)
num_mod
=
modMessagePtr
(
0
,
MODM_GETNUMDEVS
,
0
,
0
,
0
);
if
(
midMessagePtr
)
num_mid
=
midMessagePtr
(
0
,
MIDM_GETNUMDEVS
,
0
,
0
,
0
);
if
(
auxMessagePtr
)
num_aux
=
auxMessagePtr
(
0
,
AUXDM_GETNUMDEVS
,
0
,
0
,
0
);
if
(
mxdMessagePtr
)
num_mxd
=
mxdMessagePtr
(
0
,
MXDM_GETNUMDEVS
,
0
,
0
,
0
);
if
(
num_wod
==
0
&&
num_wid
==
0
&&
num_mod
==
0
&&
num_mid
==
0
&&
num_aux
==
0
&&
num_mxd
==
0
)
{
insert
.
hParent
=
root
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
text
;
driver
[
i
]
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
else
{
HTREEITEM
type
;
insert
.
hParent
=
root
;
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
text
;
insert
.
item
.
cChildren
=
1
;
driver
[
i
]
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
if
(
num_wod
)
{
insert
.
hParent
=
driver
[
i
];
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"Wave Out Devices"
;
insert
.
item
.
cChildren
=
1
;
type
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
for
(
j
=
0
;
j
<
num_wod
;
j
++
)
{
WAVEOUTCAPSW
caps
;
char
szPname
[
MAXPNAMELEN
];
wodMessagePtr
(
j
,
WODM_GETDEVCAPS
,
0
,
(
DWORD
)
&
caps
,
sizeof
(
caps
));
WideCharToMultiByte
(
CP_ACP
,
0
,
caps
.
szPname
,
-
1
,
szPname
,
MAXPNAMELEN
,
0
,
0
);
insert
.
hParent
=
type
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
szPname
;
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
}
if
(
num_wid
)
{
insert
.
hParent
=
driver
[
i
];
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"Wave In Devices"
;
insert
.
item
.
cChildren
=
1
;
type
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
for
(
j
=
0
;
j
<
num_wid
;
j
++
)
{
WAVEINCAPSW
caps
;
char
szPname
[
MAXPNAMELEN
];
widMessagePtr
(
j
,
WIDM_GETDEVCAPS
,
0
,
(
DWORD
)
&
caps
,
sizeof
(
caps
));
WideCharToMultiByte
(
CP_ACP
,
0
,
caps
.
szPname
,
-
1
,
szPname
,
MAXPNAMELEN
,
0
,
0
);
insert
.
hParent
=
type
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
szPname
;
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
}
if
(
num_mod
)
{
insert
.
hParent
=
driver
[
i
];
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"MIDI Out Devices"
;
insert
.
item
.
cChildren
=
1
;
type
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
for
(
j
=
0
;
j
<
num_mod
;
j
++
)
{
MIDIOUTCAPSW
caps
;
char
szPname
[
MAXPNAMELEN
];
modMessagePtr
(
j
,
MODM_GETDEVCAPS
,
0
,
(
DWORD
)
&
caps
,
sizeof
(
caps
));
WideCharToMultiByte
(
CP_ACP
,
0
,
caps
.
szPname
,
-
1
,
szPname
,
MAXPNAMELEN
,
0
,
0
);
insert
.
hParent
=
type
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
szPname
;
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
}
if
(
num_mid
)
{
insert
.
hParent
=
driver
[
i
];
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"MIDI In Devices"
;
insert
.
item
.
cChildren
=
1
;
type
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
for
(
j
=
0
;
j
<
num_mid
;
j
++
)
{
MIDIINCAPSW
caps
;
char
szPname
[
MAXPNAMELEN
];
midMessagePtr
(
j
,
MIDM_GETDEVCAPS
,
0
,
(
DWORD
)
&
caps
,
sizeof
(
caps
));
WideCharToMultiByte
(
CP_ACP
,
0
,
caps
.
szPname
,
-
1
,
szPname
,
MAXPNAMELEN
,
0
,
0
);
insert
.
hParent
=
type
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
szPname
;
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
}
if
(
num_aux
)
{
insert
.
hParent
=
driver
[
i
];
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"Aux Devices"
;
insert
.
item
.
cChildren
=
1
;
type
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
for
(
j
=
0
;
j
<
num_aux
;
j
++
)
{
AUXCAPSW
caps
;
char
szPname
[
MAXPNAMELEN
];
auxMessagePtr
(
j
,
AUXDM_GETDEVCAPS
,
0
,
(
DWORD
)
&
caps
,
sizeof
(
caps
));
WideCharToMultiByte
(
CP_ACP
,
0
,
caps
.
szPname
,
-
1
,
szPname
,
MAXPNAMELEN
,
0
,
0
);
insert
.
hParent
=
type
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
szPname
;
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
}
if
(
num_mxd
)
{
insert
.
hParent
=
driver
[
i
];
insert
.
item
.
mask
=
TVIF_TEXT
|
TVIF_CHILDREN
;
insert
.
item
.
pszText
=
"Mixer Devices"
;
insert
.
item
.
cChildren
=
1
;
type
=
(
HTREEITEM
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
for
(
j
=
0
;
j
<
num_mxd
;
j
++
)
{
MIXERCAPSW
caps
;
char
szPname
[
MAXPNAMELEN
];
mxdMessagePtr
(
j
,
MXDM_GETDEVCAPS
,
0
,
(
DWORD
)
&
caps
,
sizeof
(
caps
));
WideCharToMultiByte
(
CP_ACP
,
0
,
caps
.
szPname
,
-
1
,
szPname
,
MAXPNAMELEN
,
0
,
0
);
insert
.
hParent
=
type
;
insert
.
item
.
mask
=
TVIF_TEXT
;
insert
.
item
.
pszText
=
szPname
;
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_INSERTITEM
,
0
,
(
LPARAM
)
&
insert
);
}
}
}
FreeLibrary
(
lib
);
}
}
}
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_SELECTITEM
,
0
,
0
);
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
root
);
for
(
j
=
0
;
j
<
i
;
j
++
)
SendDlgItemMessage
(
hDlg
,
IDC_AUDIO_TREE
,
TVM_EXPAND
,
TVE_EXPAND
,
(
LPARAM
)
driver
[
j
]);
}
static
void
initAudioDlg
(
HWND
hDlg
)
{
char
*
curAudioDriver
=
get_reg_key
(
config_key
,
"Drivers"
,
"Audio"
,
"alsa"
);
...
...
@@ -134,6 +397,7 @@ static void initAudioDlg (HWND hDlg)
}
}
initAudioDeviceTree
(
hDlg
);
SendDlgItemMessage
(
hDlg
,
IDC_DSOUND_HW_ACCEL
,
CB_RESETCONTENT
,
0
,
0
);
for
(
i
=
0
;
NULL
!=
DSound_HW_Accels
[
i
];
++
i
)
{
...
...
programs/winecfg/resource.h
View file @
1758ba6c
...
...
@@ -139,6 +139,7 @@
#define IDC_AUDIO_CONTROL_PANEL 1303
#define IDC_DSOUND_HW_ACCEL 1304
#define IDC_DSOUND_DRV_EMUL 1305
#define IDC_AUDIO_TREE 1306
/* appearance tab */
#define IDC_THEME_COLORCOMBO 1401
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment