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
01851672
Commit
01851672
authored
May 09, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Use mmdevapi's AudioStreamVolume.
parent
d8b098db
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
167 deletions
+14
-167
client.c
dlls/mmdevapi/client.c
+11
-1
session.c
dlls/mmdevapi/session.c
+1
-11
Makefile.in
dlls/wineoss.drv/Makefile.in
+1
-0
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+1
-155
No files found.
dlls/mmdevapi/client.c
View file @
01851672
...
...
@@ -36,7 +36,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
extern
void
sessions_lock
(
void
)
DECLSPEC_HIDDEN
;
extern
void
sessions_unlock
(
void
)
DECLSPEC_HIDDEN
;
extern
void
set_stream_volumes
(
struct
audio_client
*
This
)
DECLSPEC_HIDDEN
;
void
set_stream_volumes
(
struct
audio_client
*
This
)
{
struct
set_volumes_params
params
;
params
.
stream
=
This
->
stream
;
params
.
master_volume
=
(
This
->
session
->
mute
?
0
.
0
f
:
This
->
session
->
master_vol
);
params
.
volumes
=
This
->
vols
;
params
.
session_volumes
=
This
->
session
->
channel_vols
;
WINE_UNIX_CALL
(
set_volumes
,
&
params
);
}
static
inline
struct
audio_client
*
impl_from_IAudioStreamVolume
(
IAudioStreamVolume
*
iface
)
{
...
...
dlls/mmdevapi/session.c
View file @
01851672
...
...
@@ -33,17 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
extern
void
sessions_lock
(
void
)
DECLSPEC_HIDDEN
;
extern
void
sessions_unlock
(
void
)
DECLSPEC_HIDDEN
;
void
set_stream_volumes
(
struct
audio_client
*
This
)
{
struct
set_volumes_params
params
;
params
.
stream
=
This
->
stream
;
params
.
master_volume
=
(
This
->
session
->
mute
?
0
.
0
f
:
This
->
session
->
master_vol
);
params
.
volumes
=
This
->
vols
;
params
.
session_volumes
=
This
->
session
->
channel_vols
;
WINE_UNIX_CALL
(
set_volumes
,
&
params
);
}
extern
void
set_stream_volumes
(
struct
audio_client
*
This
)
DECLSPEC_HIDDEN
;
static
inline
struct
audio_session_wrapper
*
impl_from_IAudioSessionControl2
(
IAudioSessionControl2
*
iface
)
{
...
...
dlls/wineoss.drv/Makefile.in
View file @
01851672
...
...
@@ -7,6 +7,7 @@ UNIX_LIBS = $(OSS4_LIBS) $(PTHREAD_LIBS)
UNIX_CFLAGS
=
$(OSS4_CFLAGS)
C_SRCS
=
\
client.c
\
midi.c
\
midipatch.c
\
mmaux.c
\
...
...
dlls/wineoss.drv/mmdevdrv.c
View file @
01851672
...
...
@@ -84,7 +84,7 @@ extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl;
extern
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
static
const
IAudioClockVtbl
AudioClock_Vtbl
;
static
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
static
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
void
DECLSPEC_HIDDEN
sessions_lock
(
void
)
...
...
@@ -1449,160 +1449,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
return
ret
;
}
static
HRESULT
WINAPI
AudioStreamVolume_QueryInterface
(
IAudioStreamVolume
*
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_IAudioStreamVolume
))
*
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
AudioStreamVolume_AddRef
(
IAudioStreamVolume
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
return
IAudioClient3_AddRef
(
&
This
->
IAudioClient3_iface
);
}
static
ULONG
WINAPI
AudioStreamVolume_Release
(
IAudioStreamVolume
*
iface
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
return
IAudioClient3_Release
(
&
This
->
IAudioClient3_iface
);
}
static
HRESULT
WINAPI
AudioStreamVolume_GetChannelCount
(
IAudioStreamVolume
*
iface
,
UINT32
*
out
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
out
);
if
(
!
out
)
return
E_POINTER
;
*
out
=
This
->
channel_count
;
return
S_OK
;
}
static
HRESULT
WINAPI
AudioStreamVolume_SetChannelVolume
(
IAudioStreamVolume
*
iface
,
UINT32
index
,
float
level
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
TRACE
(
"(%p)->(%d, %f)
\n
"
,
This
,
index
,
level
);
if
(
level
<
0
.
f
||
level
>
1
.
f
)
return
E_INVALIDARG
;
if
(
index
>=
This
->
channel_count
)
return
E_INVALIDARG
;
sessions_lock
();
This
->
vols
[
index
]
=
level
;
TRACE
(
"OSS doesn't support setting volume
\n
"
);
set_stream_volumes
(
This
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
AudioStreamVolume_GetChannelVolume
(
IAudioStreamVolume
*
iface
,
UINT32
index
,
float
*
level
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
TRACE
(
"(%p)->(%d, %p)
\n
"
,
This
,
index
,
level
);
if
(
!
level
)
return
E_POINTER
;
if
(
index
>=
This
->
channel_count
)
return
E_INVALIDARG
;
*
level
=
This
->
vols
[
index
];
return
S_OK
;
}
static
HRESULT
WINAPI
AudioStreamVolume_SetAllVolumes
(
IAudioStreamVolume
*
iface
,
UINT32
count
,
const
float
*
levels
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
int
i
;
TRACE
(
"(%p)->(%d, %p)
\n
"
,
This
,
count
,
levels
);
if
(
!
levels
)
return
E_POINTER
;
if
(
count
!=
This
->
channel_count
)
return
E_INVALIDARG
;
sessions_lock
();
for
(
i
=
0
;
i
<
count
;
++
i
)
This
->
vols
[
i
]
=
levels
[
i
];
TRACE
(
"OSS doesn't support setting volume
\n
"
);
set_stream_volumes
(
This
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
AudioStreamVolume_GetAllVolumes
(
IAudioStreamVolume
*
iface
,
UINT32
count
,
float
*
levels
)
{
ACImpl
*
This
=
impl_from_IAudioStreamVolume
(
iface
);
int
i
;
TRACE
(
"(%p)->(%d, %p)
\n
"
,
This
,
count
,
levels
);
if
(
!
levels
)
return
E_POINTER
;
if
(
count
!=
This
->
channel_count
)
return
E_INVALIDARG
;
sessions_lock
();
for
(
i
=
0
;
i
<
count
;
++
i
)
levels
[
i
]
=
This
->
vols
[
i
];
sessions_unlock
();
return
S_OK
;
}
static
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
=
{
AudioStreamVolume_QueryInterface
,
AudioStreamVolume_AddRef
,
AudioStreamVolume_Release
,
AudioStreamVolume_GetChannelCount
,
AudioStreamVolume_SetChannelVolume
,
AudioStreamVolume_GetChannelVolume
,
AudioStreamVolume_SetAllVolumes
,
AudioStreamVolume_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