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
9a9a86ea
Commit
9a9a86ea
authored
May 02, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa: Move ChannelAudioVolume into mmdevapi.
parent
49baaf13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
168 additions
and
177 deletions
+168
-177
session.c
dlls/mmdevapi/session.c
+167
-0
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+1
-177
No files found.
dlls/mmdevapi/session.c
View file @
9a9a86ea
...
...
@@ -39,6 +39,11 @@ static inline struct audio_session_wrapper *impl_from_IAudioSessionControl2(IAud
return
CONTAINING_RECORD
(
iface
,
struct
audio_session_wrapper
,
IAudioSessionControl2_iface
);
}
static
inline
struct
audio_session_wrapper
*
impl_from_IChannelAudioVolume
(
IChannelAudioVolume
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_session_wrapper
,
IChannelAudioVolume_iface
);
}
static
inline
struct
audio_session_wrapper
*
impl_from_ISimpleAudioVolume
(
ISimpleAudioVolume
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_session_wrapper
,
ISimpleAudioVolume_iface
);
...
...
@@ -265,6 +270,168 @@ const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl =
control_SetDuckingPreference
};
static
HRESULT
WINAPI
channelvolume_QueryInterface
(
IChannelAudioVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
TRACE
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppv
);
if
(
!
ppv
)
return
E_POINTER
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IChannelAudioVolume
))
*
ppv
=
iface
;
else
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
channelvolume_AddRef
(
IChannelAudioVolume
*
iface
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
return
IAudioSessionControl2_AddRef
(
&
This
->
IAudioSessionControl2_iface
);
}
static
ULONG
WINAPI
channelvolume_Release
(
IChannelAudioVolume
*
iface
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
return
IAudioSessionControl2_Release
(
&
This
->
IAudioSessionControl2_iface
);
}
static
HRESULT
WINAPI
channelvolume_GetChannelCount
(
IChannelAudioVolume
*
iface
,
UINT32
*
out
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
struct
audio_session
*
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
channelvolume_SetChannelVolume
(
IChannelAudioVolume
*
iface
,
UINT32
index
,
float
level
,
const
GUID
*
context
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
struct
audio_session
*
session
=
This
->
session
;
struct
audio_client
*
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
,
struct
audio_client
,
entry
)
set_stream_volumes
(
client
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
channelvolume_GetChannelVolume
(
IChannelAudioVolume
*
iface
,
UINT32
index
,
float
*
level
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
struct
audio_session
*
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
channelvolume_SetAllVolumes
(
IChannelAudioVolume
*
iface
,
UINT32
count
,
const
float
*
levels
,
const
GUID
*
context
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
struct
audio_session
*
session
=
This
->
session
;
struct
audio_client
*
client
;
unsigned
int
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
,
struct
audio_client
,
entry
)
set_stream_volumes
(
client
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
channelvolume_GetAllVolumes
(
IChannelAudioVolume
*
iface
,
UINT32
count
,
float
*
levels
)
{
struct
audio_session_wrapper
*
This
=
impl_from_IChannelAudioVolume
(
iface
);
struct
audio_session
*
session
=
This
->
session
;
unsigned
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
;
}
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
=
{
channelvolume_QueryInterface
,
channelvolume_AddRef
,
channelvolume_Release
,
channelvolume_GetChannelCount
,
channelvolume_SetChannelVolume
,
channelvolume_GetChannelVolume
,
channelvolume_SetAllVolumes
,
channelvolume_GetAllVolumes
};
static
HRESULT
WINAPI
simplevolume_QueryInterface
(
ISimpleAudioVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
dlls/winealsa.drv/mmdevdrv.c
View file @
9a9a86ea
...
...
@@ -77,7 +77,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
AudioSessionWrapper
*
AudioSessionWrapper_Create
(
ACImpl
*
client
);
...
...
@@ -106,11 +106,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
);
...
...
@@ -1659,177 +1654,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
"
);
TRACE
(
"ALSA does not support volume control
\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
;
unsigned
int
i
;
ACImpl
*
client
;
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
"
);
TRACE
(
"ALSA does not support volume control
\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
;
unsigned
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