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
0dc5bab1
Commit
0dc5bab1
authored
Jun 18, 2010
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Jun 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecfg: Only initialise the audio drivers once.
parent
f479aa5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
10 deletions
+37
-10
audio.c
programs/winecfg/audio.c
+37
-10
No files found.
programs/winecfg/audio.c
View file @
0dc5bab1
...
...
@@ -86,9 +86,10 @@ typedef struct
{
UINT
nameID
;
const
char
*
szDriver
;
HDRVR
hDriver
;
}
AUDIO_DRIVER
;
static
const
AUDIO_DRIVER
sAudioDrivers
[]
=
{
static
AUDIO_DRIVER
sAudioDrivers
[]
=
{
{
IDS_DRIVER_ALSA
,
"alsa"
},
{
IDS_DRIVER_OSS
,
"oss"
},
{
IDS_DRIVER_COREAUDIO
,
"coreaudio"
},
...
...
@@ -118,7 +119,7 @@ static void configureAudioDriver(HWND hDlg)
HDRVR
hdrvr
;
char
wine_driver
[
MAX_NAME_LENGTH
+
9
];
sprintf
(
wine_driver
,
"wine%s.drv"
,
pAudioDrv
->
szDriver
);
hdrvr
=
OpenDriverA
(
wine_driver
,
0
,
0
)
;
hdrvr
=
pAudioDrv
->
hDriver
;
if
(
hdrvr
!=
0
)
{
if
(
SendDriverMessage
(
hdrvr
,
DRV_QUERYCONFIGURE
,
0
,
0
)
!=
0
)
...
...
@@ -129,7 +130,6 @@ static void configureAudioDriver(HWND hDlg)
dci
.
lpszDCIAliasName
=
NULL
;
SendDriverMessage
(
hdrvr
,
DRV_CONFIGURE
,
0
,
(
LONG_PTR
)
&
dci
);
}
CloseDriver
(
hdrvr
,
0
,
0
);
}
else
{
...
...
@@ -197,7 +197,7 @@ static void removeDriver(const char * driver)
static
void
initAudioDeviceTree
(
HWND
hDlg
)
{
const
AUDIO_DRIVER
*
pAudioDrv
=
NULL
;
AUDIO_DRIVER
*
pAudioDrv
=
NULL
;
int
i
,
j
;
TVINSERTSTRUCTW
insert
;
HTREEITEM
root
,
driver
[
10
];
...
...
@@ -247,7 +247,7 @@ static void initAudioDeviceTree(HWND hDlg)
LoadStringW
(
GetModuleHandle
(
NULL
),
pAudioDrv
->
nameID
,
text
,
sizeof
(
text
)
/
sizeof
(
text
[
0
]));
if
((
hdrv
=
OpenDriverA
(
name
,
0
,
0
)
))
if
((
hdrv
=
pAudioDrv
->
hDriver
))
{
HMODULE
lib
;
if
((
lib
=
GetDriverModuleHandle
(
hdrv
)))
...
...
@@ -473,7 +473,6 @@ static void initAudioDeviceTree(HWND hDlg)
}
}
}
CloseDriver
(
hdrv
,
0
,
0
);
}
}
...
...
@@ -490,7 +489,7 @@ static void initAudioDeviceTree(HWND hDlg)
static
void
findAudioDrivers
(
void
)
{
int
numFound
=
0
;
const
AUDIO_DRIVER
*
pAudioDrv
=
NULL
;
AUDIO_DRIVER
*
pAudioDrv
=
NULL
;
HCURSOR
old_cursor
;
/* delete an existing list */
...
...
@@ -511,10 +510,38 @@ static void findAudioDrivers(void)
sprintf
(
driver
,
"wine%s.drv"
,
pAudioDrv
->
szDriver
);
if
((
hdrv
=
OpenDriverA
(
driver
,
0
,
0
)))
{
CloseDriver
(
hdrv
,
0
,
0
);
hdrv
=
pAudioDrv
->
hDriver
;
if
(
!
pAudioDrv
->
hDriver
&&
(
hdrv
=
OpenDriverA
(
driver
,
0
,
0
)))
{
HMODULE
lib
=
GetDriverModuleHandle
(
hdrv
);
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"
);
pAudioDrv
->
hDriver
=
hdrv
;
if
(
wodMessagePtr
)
wodMessagePtr
(
0
,
DRVM_INIT
,
0
,
0
,
0
);
if
(
widMessagePtr
)
widMessagePtr
(
0
,
DRVM_INIT
,
0
,
0
,
0
);
if
(
modMessagePtr
)
modMessagePtr
(
0
,
DRVM_INIT
,
0
,
0
,
0
);
if
(
midMessagePtr
)
midMessagePtr
(
0
,
DRVM_INIT
,
0
,
0
,
0
);
if
(
auxMessagePtr
)
auxMessagePtr
(
0
,
DRVM_INIT
,
0
,
0
,
0
);
if
(
mxdMessagePtr
)
mxdMessagePtr
(
0
,
DRVM_INIT
,
0
,
0
,
0
);
}
if
(
hdrv
)
{
if
(
loadedAudioDrv
)
loadedAudioDrv
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
loadedAudioDrv
,
(
numFound
+
1
)
*
sizeof
(
AUDIO_DRIVER
));
else
...
...
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