From 542ba5fc717facafe9de075cec17fa115472bc1b Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 8 Feb 2015 11:38:17 +0100
Subject: mmdevapi: Improve AEV_SetMasterVolumeLevel and
 AEV_GetMasterVolumeLevel stubs.

---
 dlls/mmdevapi/audiovolume.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/dlls/mmdevapi/audiovolume.c b/dlls/mmdevapi/audiovolume.c
index e6f94a1..4f915ed 100644
--- a/dlls/mmdevapi/audiovolume.c
+++ b/dlls/mmdevapi/audiovolume.c
@@ -43,6 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
 typedef struct AEVImpl {
     IAudioEndpointVolumeEx IAudioEndpointVolumeEx_iface;
     LONG ref;
+    float level;
 } AEVImpl;
 
 static inline AEVImpl *impl_from_IAudioEndpointVolumeEx(IAudioEndpointVolumeEx *iface)
@@ -120,9 +121,13 @@ static HRESULT WINAPI AEV_GetChannelCount(IAudioEndpointVolumeEx *iface, UINT *c
 
 static HRESULT WINAPI AEV_SetMasterVolumeLevel(IAudioEndpointVolumeEx *iface, float leveldb, const GUID *ctx)
 {
-    TRACE("(%p)->(%f,%s)\n", iface, leveldb, debugstr_guid(ctx));
-    FIXME("stub\n");
-    return E_NOTIMPL;
+    AEVImpl *This = impl_from_IAudioEndpointVolumeEx(iface);
+
+    FIXME("(%p)->(%f,%s): stub\n", iface, leveldb, debugstr_guid(ctx));
+
+    This->level = leveldb;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *iface, float level, const GUID *ctx)
@@ -134,11 +139,16 @@ static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *ifa
 
 static HRESULT WINAPI AEV_GetMasterVolumeLevel(IAudioEndpointVolumeEx *iface, float *leveldb)
 {
-    TRACE("(%p)->(%p)\n", iface, leveldb);
+    AEVImpl *This = impl_from_IAudioEndpointVolumeEx(iface);
+
+    FIXME("(%p)->(%p): stub\n", iface, leveldb);
+
     if (!leveldb)
         return E_POINTER;
-    FIXME("stub\n");
-    return E_NOTIMPL;
+
+    *leveldb = This->level;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI AEV_GetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *iface, float *level)
@@ -288,6 +298,7 @@ HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolume **ppv)
         return E_OUTOFMEMORY;
     This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
     This->ref = 1;
+    This->level = 1.0f;
 
     *ppv = (IAudioEndpointVolume*)&This->IAudioEndpointVolumeEx_iface;
     return S_OK;
-- 
2.4.2

