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
9da395d0
Commit
9da395d0
authored
May 02, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Use mmdevapi's ChannelAudioVolume.
parent
9a9a86ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
173 deletions
+1
-173
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+1
-173
No files found.
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
9da395d0
...
...
@@ -59,7 +59,7 @@ extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl;
static
const
IAudioClockVtbl
AudioClock_Vtbl
;
static
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
static
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
static
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
extern
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
static
WCHAR
drv_key_devicesW
[
256
];
...
...
@@ -100,11 +100,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface)
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioCaptureClient_iface
);
}
static
inline
AudioSessionWrapper
*
impl_from_IChannelAudioVolume
(
IChannelAudioVolume
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
AudioSessionWrapper
,
IChannelAudioVolume_iface
);
}
static
inline
ACImpl
*
impl_from_IAudioClock
(
IAudioClock
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioClock_iface
);
...
...
@@ -1607,173 +1602,6 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl =
AudioStreamVolume_GetAllVolumes
};
static
HRESULT
WINAPI
ChannelAudioVolume_QueryInterface
(
IChannelAudioVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
))
*
ppv
=
iface
;
if
(
*
ppv
){
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"Unknown interface %s
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ChannelAudioVolume_AddRef
(
IChannelAudioVolume
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
return
IAudioSessionControl2_AddRef
(
&
This
->
IAudioSessionControl2_iface
);
}
static
ULONG
WINAPI
ChannelAudioVolume_Release
(
IChannelAudioVolume
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
return
IAudioSessionControl2_Release
(
&
This
->
IAudioSessionControl2_iface
);
}
static
HRESULT
WINAPI
ChannelAudioVolume_GetChannelCount
(
IChannelAudioVolume
*
iface
,
UINT32
*
out
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
TRACE
(
"(%p)->(%p)
\n
"
,
session
,
out
);
if
(
!
out
)
return
NULL_PTR_ERR
;
*
out
=
session
->
channel_count
;
return
S_OK
;
}
static
HRESULT
WINAPI
ChannelAudioVolume_SetChannelVolume
(
IChannelAudioVolume
*
iface
,
UINT32
index
,
float
level
,
const
GUID
*
context
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
ACImpl
*
client
;
TRACE
(
"(%p)->(%d, %f, %s)
\n
"
,
session
,
index
,
level
,
wine_dbgstr_guid
(
context
));
if
(
level
<
0
.
f
||
level
>
1
.
f
)
return
E_INVALIDARG
;
if
(
index
>=
session
->
channel_count
)
return
E_INVALIDARG
;
if
(
context
)
FIXME
(
"Notifications not supported yet
\n
"
);
sessions_lock
();
session
->
channel_vols
[
index
]
=
level
;
LIST_FOR_EACH_ENTRY
(
client
,
&
session
->
clients
,
ACImpl
,
entry
)
set_stream_volumes
(
client
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
ChannelAudioVolume_GetChannelVolume
(
IChannelAudioVolume
*
iface
,
UINT32
index
,
float
*
level
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
TRACE
(
"(%p)->(%d, %p)
\n
"
,
session
,
index
,
level
);
if
(
!
level
)
return
NULL_PTR_ERR
;
if
(
index
>=
session
->
channel_count
)
return
E_INVALIDARG
;
*
level
=
session
->
channel_vols
[
index
];
return
S_OK
;
}
static
HRESULT
WINAPI
ChannelAudioVolume_SetAllVolumes
(
IChannelAudioVolume
*
iface
,
UINT32
count
,
const
float
*
levels
,
const
GUID
*
context
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
ACImpl
*
client
;
UINT32
i
;
TRACE
(
"(%p)->(%d, %p, %s)
\n
"
,
session
,
count
,
levels
,
wine_dbgstr_guid
(
context
));
if
(
!
levels
)
return
NULL_PTR_ERR
;
if
(
count
!=
session
->
channel_count
)
return
E_INVALIDARG
;
if
(
context
)
FIXME
(
"Notifications not supported yet
\n
"
);
sessions_lock
();
for
(
i
=
0
;
i
<
count
;
++
i
)
session
->
channel_vols
[
i
]
=
levels
[
i
];
LIST_FOR_EACH_ENTRY
(
client
,
&
session
->
clients
,
ACImpl
,
entry
)
set_stream_volumes
(
client
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
ChannelAudioVolume_GetAllVolumes
(
IChannelAudioVolume
*
iface
,
UINT32
count
,
float
*
levels
)
{
AudioSessionWrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
int
i
;
TRACE
(
"(%p)->(%d, %p)
\n
"
,
session
,
count
,
levels
);
if
(
!
levels
)
return
NULL_PTR_ERR
;
if
(
count
!=
session
->
channel_count
)
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
count
;
++
i
)
levels
[
i
]
=
session
->
channel_vols
[
i
];
return
S_OK
;
}
static
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
=
{
ChannelAudioVolume_QueryInterface
,
ChannelAudioVolume_AddRef
,
ChannelAudioVolume_Release
,
ChannelAudioVolume_GetChannelCount
,
ChannelAudioVolume_SetChannelVolume
,
ChannelAudioVolume_GetChannelVolume
,
ChannelAudioVolume_SetAllVolumes
,
ChannelAudioVolume_GetAllVolumes
};
HRESULT
WINAPI
AUDDRV_GetAudioSessionWrapper
(
const
GUID
*
guid
,
IMMDevice
*
device
,
AudioSessionWrapper
**
out
)
{
...
...
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