Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
73cdf653
Commit
73cdf653
authored
Feb 14, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Feb 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Optionally load extra ALSA device names from the registry.
parent
f7d37b38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
Makefile.in
dlls/winealsa.drv/Makefile.in
+1
-1
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+53
-0
No files found.
dlls/winealsa.drv/Makefile.in
View file @
73cdf653
MODULE
=
winealsa.drv
IMPORTS
=
uuid ole32
IMPORTS
=
uuid ole32
advapi32
DELAYIMPORTS
=
winmm
EXTRALIBS
=
@ALSALIBS@
...
...
dlls/winealsa.drv/mmdevdrv.c
View file @
73cdf653
...
...
@@ -340,6 +340,57 @@ static HRESULT alsa_get_card_devices(snd_pcm_stream_t stream, WCHAR **ids, char
return
S_OK
;
}
static
void
get_reg_devices
(
snd_pcm_stream_t
stream
,
WCHAR
**
ids
,
char
**
keys
,
UINT
*
num
)
{
static
const
WCHAR
drv_keyW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'e'
,
'a'
,
'l'
,
's'
,
'a'
,
'.'
,
'd'
,
'r'
,
'v'
,
0
};
static
const
WCHAR
ALSAOutputDevices
[]
=
{
'A'
,
'L'
,
'S'
,
'A'
,
'O'
,
'u'
,
't'
,
'p'
,
'u'
,
't'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
's'
,
0
};
static
const
WCHAR
ALSAInputDevices
[]
=
{
'A'
,
'L'
,
'S'
,
'A'
,
'I'
,
'n'
,
'p'
,
'u'
,
't'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
's'
,
0
};
HKEY
key
;
WCHAR
reg_devices
[
256
];
DWORD
size
=
sizeof
(
reg_devices
),
type
,
len
;
const
WCHAR
*
value_name
=
(
stream
==
SND_PCM_STREAM_PLAYBACK
)
?
ALSAOutputDevices
:
ALSAInputDevices
;
/* @@ Wine registry key: HKCU\Software\Wine\Drivers\winealsa.drv */
if
(
RegOpenKeyW
(
HKEY_CURRENT_USER
,
drv_keyW
,
&
key
)
==
ERROR_SUCCESS
){
if
(
RegQueryValueExW
(
key
,
value_name
,
0
,
&
type
,
(
BYTE
*
)
reg_devices
,
&
size
)
==
ERROR_SUCCESS
){
WCHAR
*
p
=
reg_devices
;
if
(
type
!=
REG_MULTI_SZ
){
ERR
(
"Registry ALSA device list value type must be REG_MULTI_SZ
\n
"
);
RegCloseKey
(
key
);
return
;
}
while
(
*
p
){
char
devname
[
64
];
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
p
,
-
1
,
devname
,
sizeof
(
devname
),
NULL
,
NULL
);
if
(
alsa_try_open
(
devname
,
stream
)){
if
(
ids
&&
keys
){
len
=
lstrlenW
(
p
)
+
1
;
ids
[
*
num
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
memcpy
(
ids
[
*
num
],
p
,
len
*
sizeof
(
WCHAR
));
len
=
strlen
(
devname
)
+
1
;
keys
[
*
num
]
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
memcpy
(
keys
[
*
num
],
devname
,
len
);
}
++*
num
;
}
p
+=
lstrlenW
(
p
)
+
1
;
}
}
RegCloseKey
(
key
);
}
}
static
HRESULT
alsa_enum_devices
(
EDataFlow
flow
,
WCHAR
**
ids
,
char
**
keys
,
UINT
*
num
)
{
...
...
@@ -360,6 +411,8 @@ static HRESULT alsa_enum_devices(EDataFlow flow, WCHAR **ids, char **keys,
++*
num
;
}
get_reg_devices
(
stream
,
ids
,
keys
,
num
);
for
(
err
=
snd_card_next
(
&
card
);
card
!=
-
1
&&
err
>=
0
;
err
=
snd_card_next
(
&
card
)){
char
cardpath
[
64
];
...
...
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