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
3d93a192
Commit
3d93a192
authored
Oct 22, 2009
by
Ken Thomases
Committed by
Alexandre Julliard
Oct 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Allow getting/setting volume on device as well as instances.
parent
e94587c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
audio.c
dlls/winecoreaudio.drv/audio.c
+27
-7
No files found.
dlls/winecoreaudio.drv/audio.c
View file @
3d93a192
...
...
@@ -170,6 +170,7 @@ typedef struct {
CoreAudio_Device
*
cadev
;
WAVEOUTCAPSW
caps
;
char
interface_name
[
32
];
DWORD
device_volume
;
BOOL
trace_on
;
BOOL
warn_on
;
...
...
@@ -620,6 +621,8 @@ LONG CoreAudio_WaveInit(void)
WOutDev
[
i
].
caps
.
dwFormats
|=
WAVE_FORMAT_1M16
;
WOutDev
[
i
].
caps
.
dwFormats
|=
WAVE_FORMAT_1S16
;
WOutDev
[
i
].
device_volume
=
0xffffffff
;
WOutDev
[
i
].
lock
=
0
;
/* initialize the mutex */
}
...
...
@@ -904,6 +907,9 @@ static DWORD wodOpen(WORD wDevID, WINE_WAVEOUT_INSTANCE** pInstance, LPWAVEOPEND
}
auInited
=
TRUE
;
AudioUnit_SetVolume
(
audioUnit
,
LOWORD
(
WOutDev
[
wDevID
].
device_volume
)
/
65535
.
0
f
,
HIWORD
(
WOutDev
[
wDevID
].
device_volume
)
/
65535
.
0
f
);
/* Our render callback CoreAudio_woAudioUnitIOProc may be called before
* AudioOutputUnitStart returns. Core Audio will grab its own internal
* lock before calling it and the callback grabs wwo->lock. This would
...
...
@@ -1439,9 +1445,6 @@ static DWORD wodGetPosition(WORD wDevID, WINE_WAVEOUT_INSTANCE* wwo, LPMMTIME lp
*/
static
DWORD
wodGetVolume
(
WORD
wDevID
,
WINE_WAVEOUT_INSTANCE
*
wwo
,
LPDWORD
lpdwVol
)
{
float
left
;
float
right
;
if
(
wDevID
>=
MAX_WAVEOUTDRV
)
{
WARN
(
"bad device ID !
\n
"
);
...
...
@@ -1450,10 +1453,17 @@ static DWORD wodGetVolume(WORD wDevID, WINE_WAVEOUT_INSTANCE* wwo, LPDWORD lpdwV
TRACE
(
"(%u, %p, %p);
\n
"
,
wDevID
,
wwo
,
lpdwVol
);
AudioUnit_GetVolume
(
wwo
->
audioUnit
,
&
left
,
&
right
);
if
(
wwo
)
{
float
left
;
float
right
;
AudioUnit_GetVolume
(
wwo
->
audioUnit
,
&
left
,
&
right
);
*
lpdwVol
=
(
WORD
)(
left
*
0xFFFFl
)
+
((
WORD
)(
right
*
0xFFFFl
)
<<
16
);
}
else
*
lpdwVol
=
WOutDev
[
wDevID
].
device_volume
;
*
lpdwVol
=
(
WORD
)(
left
*
0xFFFFl
)
+
((
WORD
)(
right
*
0xFFFFl
)
<<
16
);
return
MMSYSERR_NOERROR
;
}
...
...
@@ -1476,7 +1486,17 @@ static DWORD wodSetVolume(WORD wDevID, WINE_WAVEOUT_INSTANCE* wwo, DWORD dwParam
TRACE
(
"(%u, %p, %08x);
\n
"
,
wDevID
,
wwo
,
dwParam
);
AudioUnit_SetVolume
(
wwo
->
audioUnit
,
left
,
right
);
if
(
wwo
)
AudioUnit_SetVolume
(
wwo
->
audioUnit
,
left
,
right
);
else
{
OSSpinLockLock
(
&
WOutDev
[
wDevID
].
lock
);
LIST_FOR_EACH_ENTRY
(
wwo
,
&
WOutDev
[
wDevID
].
instances
,
WINE_WAVEOUT_INSTANCE
,
entry
)
AudioUnit_SetVolume
(
wwo
->
audioUnit
,
left
,
right
);
OSSpinLockUnlock
(
&
WOutDev
[
wDevID
].
lock
);
WOutDev
[
wDevID
].
device_volume
=
dwParam
;
}
return
MMSYSERR_NOERROR
;
}
...
...
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