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
04c909ea
Commit
04c909ea
authored
Apr 30, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
May 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineoss: Use mmdevapi's SimpleAudioVolume.
parent
4ee9c5dd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
131 deletions
+11
-131
mmdevdrv.c
dlls/wineoss.drv/mmdevdrv.c
+1
-131
oss.c
dlls/wineoss.drv/oss.c
+10
-0
No files found.
dlls/wineoss.drv/mmdevdrv.c
View file @
04c909ea
...
...
@@ -81,7 +81,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl;
static
const
IAudioRenderClientVtbl
AudioRenderClient_Vtbl
;
static
const
IAudioCaptureClientVtbl
AudioCaptureClient_Vtbl
;
extern
const
IAudioSessionControl2Vtbl
AudioSessionControl2_Vtbl
;
static
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
extern
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
;
static
const
IAudioClockVtbl
AudioClock_Vtbl
;
static
const
IAudioClock2Vtbl
AudioClock2_Vtbl
;
static
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
...
...
@@ -112,11 +112,6 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface)
return
CONTAINING_RECORD
(
iface
,
ACImpl
,
IAudioCaptureClient_iface
);
}
static
inline
AudioSessionWrapper
*
impl_from_ISimpleAudioVolume
(
ISimpleAudioVolume
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
AudioSessionWrapper
,
ISimpleAudioVolume_iface
);
}
static
inline
AudioSessionWrapper
*
impl_from_IChannelAudioVolume
(
IChannelAudioVolume
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
AudioSessionWrapper
,
IChannelAudioVolume_iface
);
...
...
@@ -1460,131 +1455,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client)
return
ret
;
}
static
HRESULT
WINAPI
SimpleAudioVolume_QueryInterface
(
ISimpleAudioVolume
*
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_ISimpleAudioVolume
))
*
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
SimpleAudioVolume_AddRef
(
ISimpleAudioVolume
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_ISimpleAudioVolume
(
iface
);
return
IAudioSessionControl2_AddRef
(
&
This
->
IAudioSessionControl2_iface
);
}
static
ULONG
WINAPI
SimpleAudioVolume_Release
(
ISimpleAudioVolume
*
iface
)
{
AudioSessionWrapper
*
This
=
impl_from_ISimpleAudioVolume
(
iface
);
return
IAudioSessionControl2_Release
(
&
This
->
IAudioSessionControl2_iface
);
}
static
HRESULT
WINAPI
SimpleAudioVolume_SetMasterVolume
(
ISimpleAudioVolume
*
iface
,
float
level
,
const
GUID
*
context
)
{
AudioSessionWrapper
*
This
=
impl_from_ISimpleAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
ACImpl
*
client
;
TRACE
(
"(%p)->(%f, %s)
\n
"
,
session
,
level
,
wine_dbgstr_guid
(
context
));
if
(
level
<
0
.
f
||
level
>
1
.
f
)
return
E_INVALIDARG
;
if
(
context
)
FIXME
(
"Notifications not supported yet
\n
"
);
sessions_lock
();
session
->
master_vol
=
level
;
TRACE
(
"OSS doesn't support setting volume
\n
"
);
LIST_FOR_EACH_ENTRY
(
client
,
&
session
->
clients
,
ACImpl
,
entry
)
set_stream_volumes
(
client
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
SimpleAudioVolume_GetMasterVolume
(
ISimpleAudioVolume
*
iface
,
float
*
level
)
{
AudioSessionWrapper
*
This
=
impl_from_ISimpleAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
TRACE
(
"(%p)->(%p)
\n
"
,
session
,
level
);
if
(
!
level
)
return
NULL_PTR_ERR
;
*
level
=
session
->
master_vol
;
return
S_OK
;
}
static
HRESULT
WINAPI
SimpleAudioVolume_SetMute
(
ISimpleAudioVolume
*
iface
,
BOOL
mute
,
const
GUID
*
context
)
{
AudioSessionWrapper
*
This
=
impl_from_ISimpleAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
ACImpl
*
client
;
TRACE
(
"(%p)->(%u, %s)
\n
"
,
session
,
mute
,
debugstr_guid
(
context
));
sessions_lock
();
session
->
mute
=
mute
;
LIST_FOR_EACH_ENTRY
(
client
,
&
session
->
clients
,
ACImpl
,
entry
)
set_stream_volumes
(
client
);
sessions_unlock
();
return
S_OK
;
}
static
HRESULT
WINAPI
SimpleAudioVolume_GetMute
(
ISimpleAudioVolume
*
iface
,
BOOL
*
mute
)
{
AudioSessionWrapper
*
This
=
impl_from_ISimpleAudioVolume
(
iface
);
AudioSession
*
session
=
This
->
session
;
TRACE
(
"(%p)->(%p)
\n
"
,
session
,
mute
);
if
(
!
mute
)
return
NULL_PTR_ERR
;
*
mute
=
This
->
session
->
mute
;
return
S_OK
;
}
static
const
ISimpleAudioVolumeVtbl
SimpleAudioVolume_Vtbl
=
{
SimpleAudioVolume_QueryInterface
,
SimpleAudioVolume_AddRef
,
SimpleAudioVolume_Release
,
SimpleAudioVolume_SetMasterVolume
,
SimpleAudioVolume_GetMasterVolume
,
SimpleAudioVolume_SetMute
,
SimpleAudioVolume_GetMute
};
static
HRESULT
WINAPI
AudioStreamVolume_QueryInterface
(
IAudioStreamVolume
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
dlls/wineoss.drv/oss.c
View file @
04c909ea
...
...
@@ -1360,6 +1360,16 @@ static NTSTATUS oss_set_volumes(void *args)
{
struct
set_volumes_params
*
params
=
args
;
struct
oss_stream
*
stream
=
handle_get_stream
(
params
->
stream
);
UINT16
i
;
if
(
params
->
master_volume
)
{
for
(
i
=
0
;
i
<
stream
->
fmt
->
nChannels
;
++
i
)
{
if
(
params
->
master_volume
*
params
->
volumes
[
i
]
*
params
->
session_volumes
[
i
]
!=
1
.
0
f
)
{
FIXME
(
"Volume control is not implemented
\n
"
);
break
;
}
}
}
oss_lock
(
stream
);
stream
->
mute
=
!
params
->
master_volume
;
...
...
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