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
982d005d
Commit
982d005d
authored
Mar 09, 2016
by
Andrew Eikum
Committed by
Alexandre Julliard
Mar 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Implement Set/GetMasterVolumeLevel.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
89de040e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
audiovolume.c
dlls/mmdevapi/audiovolume.c
+17
-4
render.c
dlls/mmdevapi/tests/render.c
+10
-1
No files found.
dlls/mmdevapi/audiovolume.c
View file @
982d005d
...
@@ -43,6 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
...
@@ -43,6 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
typedef
struct
AEVImpl
{
typedef
struct
AEVImpl
{
IAudioEndpointVolumeEx
IAudioEndpointVolumeEx_iface
;
IAudioEndpointVolumeEx
IAudioEndpointVolumeEx_iface
;
LONG
ref
;
LONG
ref
;
float
master_vol
;
}
AEVImpl
;
}
AEVImpl
;
static
inline
AEVImpl
*
impl_from_IAudioEndpointVolumeEx
(
IAudioEndpointVolumeEx
*
iface
)
static
inline
AEVImpl
*
impl_from_IAudioEndpointVolumeEx
(
IAudioEndpointVolumeEx
*
iface
)
...
@@ -120,9 +121,16 @@ static HRESULT WINAPI AEV_GetChannelCount(IAudioEndpointVolumeEx *iface, UINT *c
...
@@ -120,9 +121,16 @@ static HRESULT WINAPI AEV_GetChannelCount(IAudioEndpointVolumeEx *iface, UINT *c
static
HRESULT
WINAPI
AEV_SetMasterVolumeLevel
(
IAudioEndpointVolumeEx
*
iface
,
float
leveldb
,
const
GUID
*
ctx
)
static
HRESULT
WINAPI
AEV_SetMasterVolumeLevel
(
IAudioEndpointVolumeEx
*
iface
,
float
leveldb
,
const
GUID
*
ctx
)
{
{
AEVImpl
*
This
=
impl_from_IAudioEndpointVolumeEx
(
iface
);
TRACE
(
"(%p)->(%f,%s)
\n
"
,
iface
,
leveldb
,
debugstr_guid
(
ctx
));
TRACE
(
"(%p)->(%f,%s)
\n
"
,
iface
,
leveldb
,
debugstr_guid
(
ctx
));
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
if
(
leveldb
<
-
100
.
f
||
leveldb
>
0
.
f
)
return
E_INVALIDARG
;
This
->
master_vol
=
leveldb
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
AEV_SetMasterVolumeLevelScalar
(
IAudioEndpointVolumeEx
*
iface
,
float
level
,
const
GUID
*
ctx
)
static
HRESULT
WINAPI
AEV_SetMasterVolumeLevelScalar
(
IAudioEndpointVolumeEx
*
iface
,
float
level
,
const
GUID
*
ctx
)
...
@@ -134,11 +142,16 @@ static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *ifa
...
@@ -134,11 +142,16 @@ static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *ifa
static
HRESULT
WINAPI
AEV_GetMasterVolumeLevel
(
IAudioEndpointVolumeEx
*
iface
,
float
*
leveldb
)
static
HRESULT
WINAPI
AEV_GetMasterVolumeLevel
(
IAudioEndpointVolumeEx
*
iface
,
float
*
leveldb
)
{
{
AEVImpl
*
This
=
impl_from_IAudioEndpointVolumeEx
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
leveldb
);
TRACE
(
"(%p)->(%p)
\n
"
,
iface
,
leveldb
);
if
(
!
leveldb
)
if
(
!
leveldb
)
return
E_POINTER
;
return
E_POINTER
;
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
*
leveldb
=
This
->
master_vol
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
AEV_GetMasterVolumeLevelScalar
(
IAudioEndpointVolumeEx
*
iface
,
float
*
level
)
static
HRESULT
WINAPI
AEV_GetMasterVolumeLevelScalar
(
IAudioEndpointVolumeEx
*
iface
,
float
*
level
)
...
...
dlls/mmdevapi/tests/render.c
View file @
982d005d
...
@@ -2247,7 +2247,7 @@ static void test_endpointvolume(void)
...
@@ -2247,7 +2247,7 @@ static void test_endpointvolume(void)
{
{
HRESULT
hr
;
HRESULT
hr
;
IAudioEndpointVolume
*
aev
;
IAudioEndpointVolume
*
aev
;
float
mindb
,
maxdb
,
increment
;
float
mindb
,
maxdb
,
increment
,
volume
;
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioEndpointVolume
,
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioEndpointVolume
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
aev
);
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
aev
);
...
@@ -2262,6 +2262,15 @@ static void test_endpointvolume(void)
...
@@ -2262,6 +2262,15 @@ static void test_endpointvolume(void)
ok
(
hr
==
S_OK
,
"GetVolumeRange failed: 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetVolumeRange failed: 0x%08x
\n
"
,
hr
);
trace
(
"got range: [%f,%f]/%f
\n
"
,
mindb
,
maxdb
,
increment
);
trace
(
"got range: [%f,%f]/%f
\n
"
,
mindb
,
maxdb
,
increment
);
hr
=
IAudioEndpointVolume_SetMasterVolumeLevel
(
aev
,
mindb
-
increment
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"SetMasterVolumeLevel failed: 0x%08x
\n
"
,
hr
);
hr
=
IAudioEndpointVolume_GetMasterVolumeLevel
(
aev
,
&
volume
);
ok
(
hr
==
S_OK
,
"GetMasterVolumeLevel failed: 0x%08x
\n
"
,
hr
);
hr
=
IAudioEndpointVolume_SetMasterVolumeLevel
(
aev
,
volume
,
NULL
);
ok
(
hr
==
S_OK
,
"SetMasterVolumeLevel failed: 0x%08x
\n
"
,
hr
);
IAudioEndpointVolume_Release
(
aev
);
IAudioEndpointVolume_Release
(
aev
);
}
}
...
...
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