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
89de040e
Commit
89de040e
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 IAudioEndpointVolume::GetVolumeRange.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
beb8986e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
8 deletions
+39
-8
audiovolume.c
dlls/mmdevapi/audiovolume.c
+10
-5
devenum.c
dlls/mmdevapi/devenum.c
+3
-2
mmdevapi.h
dlls/mmdevapi/mmdevapi.h
+1
-1
mmdevenum.c
dlls/mmdevapi/tests/mmdevenum.c
+1
-0
render.c
dlls/mmdevapi/tests/render.c
+24
-0
No files found.
dlls/mmdevapi/audiovolume.c
View file @
89de040e
...
...
@@ -233,10 +233,15 @@ static HRESULT WINAPI AEV_QueryHardwareSupport(IAudioEndpointVolumeEx *iface, DW
static
HRESULT
WINAPI
AEV_GetVolumeRange
(
IAudioEndpointVolumeEx
*
iface
,
float
*
mindb
,
float
*
maxdb
,
float
*
inc
)
{
TRACE
(
"(%p)->(%p,%p,%p)
\n
"
,
iface
,
mindb
,
maxdb
,
inc
);
if
(
!
mindb
||
!
maxdb
||
!
inc
)
return
E_POINTER
;
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
*
mindb
=
-
100
.
f
;
*
maxdb
=
0
.
f
;
*
inc
=
1
.
f
;
return
S_OK
;
}
static
HRESULT
WINAPI
AEV_GetVolumeRangeChannel
(
IAudioEndpointVolumeEx
*
iface
,
UINT
chan
,
float
*
mindb
,
float
*
maxdb
,
float
*
inc
)
...
...
@@ -273,17 +278,17 @@ static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl = {
AEV_GetVolumeRangeChannel
};
HRESULT
AudioEndpointVolume_Create
(
MMDevice
*
parent
,
IAudioEndpointVolume
**
ppv
)
HRESULT
AudioEndpointVolume_Create
(
MMDevice
*
parent
,
IAudioEndpointVolume
Ex
**
ppv
)
{
AEVImpl
*
This
;
*
ppv
=
NULL
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
This
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
This
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IAudioEndpointVolumeEx_iface
.
lpVtbl
=
&
AEVImpl_Vtbl
;
This
->
ref
=
1
;
*
ppv
=
(
IAudioEndpointVolume
*
)
&
This
->
IAudioEndpointVolumeEx_iface
;
*
ppv
=
&
This
->
IAudioEndpointVolumeEx_iface
;
return
S_OK
;
}
dlls/mmdevapi/devenum.c
View file @
89de040e
...
...
@@ -595,8 +595,9 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls
if
(
IsEqualIID
(
riid
,
&
IID_IAudioClient
)){
hr
=
drvs
.
pGetAudioEndpoint
(
&
This
->
devguid
,
iface
,
(
IAudioClient
**
)
ppv
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioEndpointVolume
))
hr
=
AudioEndpointVolume_Create
(
This
,
(
IAudioEndpointVolume
**
)
ppv
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioEndpointVolume
)
||
IsEqualIID
(
riid
,
&
IID_IAudioEndpointVolumeEx
))
hr
=
AudioEndpointVolume_Create
(
This
,
(
IAudioEndpointVolumeEx
**
)
ppv
);
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionManager
)
||
IsEqualIID
(
riid
,
&
IID_IAudioSessionManager2
))
{
...
...
dlls/mmdevapi/mmdevapi.h
View file @
89de040e
...
...
@@ -74,6 +74,6 @@ typedef struct MMDevice {
}
MMDevice
;
extern
HRESULT
AudioClient_Create
(
MMDevice
*
parent
,
IAudioClient
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
AudioEndpointVolume_Create
(
MMDevice
*
parent
,
IAudioEndpointVolume
**
ppv
)
DECLSPEC_HIDDEN
;
extern
HRESULT
AudioEndpointVolume_Create
(
MMDevice
*
parent
,
IAudioEndpointVolume
Ex
**
ppv
)
DECLSPEC_HIDDEN
;
extern
const
WCHAR
drv_keyW
[]
DECLSPEC_HIDDEN
;
dlls/mmdevapi/tests/mmdevenum.c
View file @
89de040e
...
...
@@ -21,6 +21,7 @@
#define COBJMACROS
#include "initguid.h"
#include "endpointvolume.h"
#include "mmdeviceapi.h"
#include "audioclient.h"
#include "audiopolicy.h"
...
...
dlls/mmdevapi/tests/render.c
View file @
89de040e
...
...
@@ -39,6 +39,7 @@
#include "mmsystem.h"
#include "audioclient.h"
#include "audiopolicy.h"
#include "endpointvolume.h"
static
const
unsigned
int
win_formats
[][
4
]
=
{
{
8000
,
8
,
1
},
{
8000
,
8
,
2
},
{
8000
,
16
,
1
},
{
8000
,
16
,
2
},
...
...
@@ -2242,6 +2243,28 @@ static void test_marshal(void)
}
static
void
test_endpointvolume
(
void
)
{
HRESULT
hr
;
IAudioEndpointVolume
*
aev
;
float
mindb
,
maxdb
,
increment
;
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioEndpointVolume
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
aev
);
ok
(
hr
==
S_OK
,
"Activation failed with %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
hr
=
IAudioEndpointVolume_GetVolumeRange
(
aev
,
&
mindb
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"GetVolumeRange should have failed with E_POINTER: 0x%08x
\n
"
,
hr
);
hr
=
IAudioEndpointVolume_GetVolumeRange
(
aev
,
&
mindb
,
&
maxdb
,
&
increment
);
ok
(
hr
==
S_OK
,
"GetVolumeRange failed: 0x%08x
\n
"
,
hr
);
trace
(
"got range: [%f,%f]/%f
\n
"
,
mindb
,
maxdb
,
increment
);
IAudioEndpointVolume_Release
(
aev
);
}
START_TEST
(
render
)
{
HRESULT
hr
;
...
...
@@ -2283,6 +2306,7 @@ START_TEST(render)
test_volume_dependence
();
test_session_creation
();
test_worst_case
();
test_endpointvolume
();
IMMDevice_Release
(
dev
);
...
...
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