ReactOS 0.4.15-dev-7918-g2a2556c
audiovolume.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "wine/debug.h"
#include "ole2.h"
#include "mmdeviceapi.h"
#include "mmsystem.h"
#include "dsound.h"
#include "audioclient.h"
#include "endpointvolume.h"
#include "audiopolicy.h"
#include "mmdevapi.h"
Include dependency graph for audiovolume.c:

Go to the source code of this file.

Classes

struct  AEVImpl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct AEVImpl AEVImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (mmdevapi)
 
static AEVImplimpl_from_IAudioEndpointVolumeEx (IAudioEndpointVolumeEx *iface)
 
static void AudioEndpointVolume_Destroy (AEVImpl *This)
 
static HRESULT WINAPI AEV_QueryInterface (IAudioEndpointVolumeEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AEV_AddRef (IAudioEndpointVolumeEx *iface)
 
static ULONG WINAPI AEV_Release (IAudioEndpointVolumeEx *iface)
 
static HRESULT WINAPI AEV_RegisterControlChangeNotify (IAudioEndpointVolumeEx *iface, IAudioEndpointVolumeCallback *notify)
 
static HRESULT WINAPI AEV_UnregisterControlChangeNotify (IAudioEndpointVolumeEx *iface, IAudioEndpointVolumeCallback *notify)
 
static HRESULT WINAPI AEV_GetChannelCount (IAudioEndpointVolumeEx *iface, UINT *count)
 
static HRESULT WINAPI AEV_SetMasterVolumeLevel (IAudioEndpointVolumeEx *iface, float leveldb, const GUID *ctx)
 
static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar (IAudioEndpointVolumeEx *iface, float level, const GUID *ctx)
 
static HRESULT WINAPI AEV_GetMasterVolumeLevel (IAudioEndpointVolumeEx *iface, float *leveldb)
 
static HRESULT WINAPI AEV_GetMasterVolumeLevelScalar (IAudioEndpointVolumeEx *iface, float *level)
 
static HRESULT WINAPI AEV_SetChannelVolumeLevel (IAudioEndpointVolumeEx *iface, UINT chan, float leveldb, const GUID *ctx)
 
static HRESULT WINAPI AEV_SetChannelVolumeLevelScalar (IAudioEndpointVolumeEx *iface, UINT chan, float level, const GUID *ctx)
 
static HRESULT WINAPI AEV_GetChannelVolumeLevel (IAudioEndpointVolumeEx *iface, UINT chan, float *leveldb)
 
static HRESULT WINAPI AEV_GetChannelVolumeLevelScalar (IAudioEndpointVolumeEx *iface, UINT chan, float *level)
 
static HRESULT WINAPI AEV_SetMute (IAudioEndpointVolumeEx *iface, BOOL mute, const GUID *ctx)
 
static HRESULT WINAPI AEV_GetMute (IAudioEndpointVolumeEx *iface, BOOL *mute)
 
static HRESULT WINAPI AEV_GetVolumeStepInfo (IAudioEndpointVolumeEx *iface, UINT *stepsize, UINT *stepcount)
 
static HRESULT WINAPI AEV_VolumeStepUp (IAudioEndpointVolumeEx *iface, const GUID *ctx)
 
static HRESULT WINAPI AEV_VolumeStepDown (IAudioEndpointVolumeEx *iface, const GUID *ctx)
 
static HRESULT WINAPI AEV_QueryHardwareSupport (IAudioEndpointVolumeEx *iface, DWORD *mask)
 
static HRESULT WINAPI AEV_GetVolumeRange (IAudioEndpointVolumeEx *iface, float *mindb, float *maxdb, float *inc)
 
static HRESULT WINAPI AEV_GetVolumeRangeChannel (IAudioEndpointVolumeEx *iface, UINT chan, float *mindb, float *maxdb, float *inc)
 
HRESULT AudioEndpointVolume_Create (MMDevice *parent, IAudioEndpointVolumeEx **ppv)
 

Variables

static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file audiovolume.c.

Typedef Documentation

◆ AEVImpl

Function Documentation

◆ AEV_AddRef()

static ULONG WINAPI AEV_AddRef ( IAudioEndpointVolumeEx iface)
static

Definition at line 76 of file audiovolume.c.

77{
80 TRACE("(%p) new ref %u\n", This, ref);
81 return ref;
82}
#define InterlockedIncrement
Definition: armddk.h:53
static AEVImpl * impl_from_IAudioEndpointVolumeEx(IAudioEndpointVolumeEx *iface)
Definition: audiovolume.c:48
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ AEV_GetChannelCount()

static HRESULT WINAPI AEV_GetChannelCount ( IAudioEndpointVolumeEx iface,
UINT count 
)
static

Definition at line 112 of file audiovolume.c.

113{
114 TRACE("(%p)->(%p)\n", iface, count);
115 if (!count)
116 return E_POINTER;
117 FIXME("stub\n");
118 return E_NOTIMPL;
119}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define E_POINTER
Definition: winerror.h:2365

◆ AEV_GetChannelVolumeLevel()

static HRESULT WINAPI AEV_GetChannelVolumeLevel ( IAudioEndpointVolumeEx iface,
UINT  chan,
float leveldb 
)
static

Definition at line 179 of file audiovolume.c.

180{
181 TRACE("(%p)->(%u,%p)\n", iface, chan, leveldb);
182 if (!leveldb)
183 return E_POINTER;
184 FIXME("stub\n");
185 return E_NOTIMPL;
186}

◆ AEV_GetChannelVolumeLevelScalar()

static HRESULT WINAPI AEV_GetChannelVolumeLevelScalar ( IAudioEndpointVolumeEx iface,
UINT  chan,
float level 
)
static

Definition at line 188 of file audiovolume.c.

189{
190 TRACE("(%p)->(%u,%p)\n", iface, chan, level);
191 if (!level)
192 return E_POINTER;
193 FIXME("stub\n");
194 return E_NOTIMPL;
195}
GLint level
Definition: gl.h:1546

◆ AEV_GetMasterVolumeLevel()

static HRESULT WINAPI AEV_GetMasterVolumeLevel ( IAudioEndpointVolumeEx iface,
float leveldb 
)
static

Definition at line 142 of file audiovolume.c.

143{
145
146 TRACE("(%p)->(%p)\n", iface, leveldb);
147
148 if (!leveldb)
149 return E_POINTER;
150
151 *leveldb = This->master_vol;
152
153 return S_OK;
154}
#define S_OK
Definition: intsafe.h:52

◆ AEV_GetMasterVolumeLevelScalar()

static HRESULT WINAPI AEV_GetMasterVolumeLevelScalar ( IAudioEndpointVolumeEx iface,
float level 
)
static

Definition at line 156 of file audiovolume.c.

157{
158 TRACE("(%p)->(%p)\n", iface, level);
159 if (!level)
160 return E_POINTER;
161 FIXME("stub\n");
162 return E_NOTIMPL;
163}

◆ AEV_GetMute()

static HRESULT WINAPI AEV_GetMute ( IAudioEndpointVolumeEx iface,
BOOL mute 
)
static

Definition at line 211 of file audiovolume.c.

212{
214
215 TRACE("(%p)->(%p)\n", iface, mute);
216
217 if (!mute)
218 return E_POINTER;
219
220 *mute = This->mute;
221
222 return S_OK;
223}

◆ AEV_GetVolumeRange()

static HRESULT WINAPI AEV_GetVolumeRange ( IAudioEndpointVolumeEx iface,
float mindb,
float maxdb,
float inc 
)
static

Definition at line 257 of file audiovolume.c.

258{
259 TRACE("(%p)->(%p,%p,%p)\n", iface, mindb, maxdb, inc);
260
261 if (!mindb || !maxdb || !inc)
262 return E_POINTER;
263
264 *mindb = -100.f;
265 *maxdb = 0.f;
266 *inc = 1.f;
267
268 return S_OK;
269}

◆ AEV_GetVolumeRangeChannel()

static HRESULT WINAPI AEV_GetVolumeRangeChannel ( IAudioEndpointVolumeEx iface,
UINT  chan,
float mindb,
float maxdb,
float inc 
)
static

Definition at line 271 of file audiovolume.c.

272{
273 TRACE("(%p)->(%p,%p,%p)\n", iface, mindb, maxdb, inc);
274 if (!mindb || !maxdb || !inc)
275 return E_POINTER;
276 FIXME("stub\n");
277 return E_NOTIMPL;
278}

◆ AEV_GetVolumeStepInfo()

static HRESULT WINAPI AEV_GetVolumeStepInfo ( IAudioEndpointVolumeEx iface,
UINT stepsize,
UINT stepcount 
)
static

Definition at line 225 of file audiovolume.c.

226{
227 TRACE("(%p)->(%p,%p)\n", iface, stepsize, stepcount);
228 if (!stepsize && !stepcount)
229 return E_POINTER;
230 FIXME("stub\n");
231 return E_NOTIMPL;
232}

◆ AEV_QueryHardwareSupport()

static HRESULT WINAPI AEV_QueryHardwareSupport ( IAudioEndpointVolumeEx iface,
DWORD mask 
)
static

Definition at line 248 of file audiovolume.c.

249{
250 TRACE("(%p)->(%p)\n", iface, mask);
251 if (!mask)
252 return E_POINTER;
253 FIXME("stub\n");
254 return E_NOTIMPL;
255}
GLenum GLint GLuint mask
Definition: glext.h:6028

◆ AEV_QueryInterface()

static HRESULT WINAPI AEV_QueryInterface ( IAudioEndpointVolumeEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 58 of file audiovolume.c.

59{
61 TRACE("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
62 if (!ppv)
63 return E_POINTER;
64 *ppv = NULL;
66 IsEqualIID(riid, &IID_IAudioEndpointVolume) ||
67 IsEqualIID(riid, &IID_IAudioEndpointVolumeEx)) {
68 *ppv = &This->IAudioEndpointVolumeEx_iface;
69 }
70 else
71 return E_NOINTERFACE;
72 IUnknown_AddRef((IUnknown *)*ppv);
73 return S_OK;
74}
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ AEV_RegisterControlChangeNotify()

static HRESULT WINAPI AEV_RegisterControlChangeNotify ( IAudioEndpointVolumeEx iface,
IAudioEndpointVolumeCallback notify 
)
static

Definition at line 94 of file audiovolume.c.

95{
96 TRACE("(%p)->(%p)\n", iface, notify);
97 if (!notify)
98 return E_POINTER;
99 FIXME("stub\n");
100 return S_OK;
101}
int notify
Definition: msacm.c:1366

◆ AEV_Release()

static ULONG WINAPI AEV_Release ( IAudioEndpointVolumeEx iface)
static

Definition at line 84 of file audiovolume.c.

85{
88 TRACE("(%p) new ref %u\n", This, ref);
89 if (!ref)
91 return ref;
92}
#define InterlockedDecrement
Definition: armddk.h:52
static void AudioEndpointVolume_Destroy(AEVImpl *This)
Definition: audiovolume.c:53

◆ AEV_SetChannelVolumeLevel()

static HRESULT WINAPI AEV_SetChannelVolumeLevel ( IAudioEndpointVolumeEx iface,
UINT  chan,
float  leveldb,
const GUID ctx 
)
static

Definition at line 165 of file audiovolume.c.

166{
167 TRACE("(%p)->(%f,%s)\n", iface, leveldb, debugstr_guid(ctx));
168 FIXME("stub\n");
169 return E_NOTIMPL;
170}

◆ AEV_SetChannelVolumeLevelScalar()

static HRESULT WINAPI AEV_SetChannelVolumeLevelScalar ( IAudioEndpointVolumeEx iface,
UINT  chan,
float  level,
const GUID ctx 
)
static

Definition at line 172 of file audiovolume.c.

173{
174 TRACE("(%p)->(%u,%f,%s)\n", iface, chan, level, debugstr_guid(ctx));
175 FIXME("stub\n");
176 return E_NOTIMPL;
177}

◆ AEV_SetMasterVolumeLevel()

static HRESULT WINAPI AEV_SetMasterVolumeLevel ( IAudioEndpointVolumeEx iface,
float  leveldb,
const GUID ctx 
)
static

Definition at line 121 of file audiovolume.c.

122{
124
125 TRACE("(%p)->(%f,%s)\n", iface, leveldb, debugstr_guid(ctx));
126
127 if(leveldb < -100.f || leveldb > 0.f)
128 return E_INVALIDARG;
129
130 This->master_vol = leveldb;
131
132 return S_OK;
133}
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ AEV_SetMasterVolumeLevelScalar()

static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar ( IAudioEndpointVolumeEx iface,
float  level,
const GUID ctx 
)
static

Definition at line 135 of file audiovolume.c.

136{
137 TRACE("(%p)->(%f,%s)\n", iface, level, debugstr_guid(ctx));
138 FIXME("stub\n");
139 return E_NOTIMPL;
140}

◆ AEV_SetMute()

static HRESULT WINAPI AEV_SetMute ( IAudioEndpointVolumeEx iface,
BOOL  mute,
const GUID ctx 
)
static

Definition at line 197 of file audiovolume.c.

198{
200 HRESULT ret;
201
202 TRACE("(%p)->(%u,%s)\n", iface, mute, debugstr_guid(ctx));
203
204 ret = This->mute == mute ? S_FALSE : S_OK;
205
206 This->mute = mute;
207
208 return ret;
209}
int ret
#define S_FALSE
Definition: winerror.h:2357

◆ AEV_UnregisterControlChangeNotify()

static HRESULT WINAPI AEV_UnregisterControlChangeNotify ( IAudioEndpointVolumeEx iface,
IAudioEndpointVolumeCallback notify 
)
static

Definition at line 103 of file audiovolume.c.

104{
105 TRACE("(%p)->(%p)\n", iface, notify);
106 if (!notify)
107 return E_POINTER;
108 FIXME("stub\n");
109 return S_OK;
110}

◆ AEV_VolumeStepDown()

static HRESULT WINAPI AEV_VolumeStepDown ( IAudioEndpointVolumeEx iface,
const GUID ctx 
)
static

Definition at line 241 of file audiovolume.c.

242{
243 TRACE("(%p)->(%s)\n", iface, debugstr_guid(ctx));
244 FIXME("stub\n");
245 return E_NOTIMPL;
246}

◆ AEV_VolumeStepUp()

static HRESULT WINAPI AEV_VolumeStepUp ( IAudioEndpointVolumeEx iface,
const GUID ctx 
)
static

Definition at line 234 of file audiovolume.c.

235{
236 TRACE("(%p)->(%s)\n", iface, debugstr_guid(ctx));
237 FIXME("stub\n");
238 return E_NOTIMPL;
239}

◆ AudioEndpointVolume_Create()

HRESULT AudioEndpointVolume_Create ( MMDevice parent,
IAudioEndpointVolumeEx **  ppv 
)

Definition at line 305 of file audiovolume.c.

306{
307 AEVImpl *This;
308
309 *ppv = NULL;
311 if (!This)
312 return E_OUTOFMEMORY;
313 This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
314 This->ref = 1;
315
316 *ppv = &This->IAudioEndpointVolumeEx_iface;
317 return S_OK;
318}
static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl
Definition: audiovolume.c:280
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by MMDevice_Activate().

◆ AudioEndpointVolume_Destroy()

static void AudioEndpointVolume_Destroy ( AEVImpl This)
static

Definition at line 53 of file audiovolume.c.

54{
56}
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by AEV_Release().

◆ impl_from_IAudioEndpointVolumeEx()

static AEVImpl * impl_from_IAudioEndpointVolumeEx ( IAudioEndpointVolumeEx iface)
inlinestatic

Definition at line 48 of file audiovolume.c.

49{
50 return CONTAINING_RECORD(iface, AEVImpl, IAudioEndpointVolumeEx_iface);
51}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by AEV_AddRef(), AEV_GetMasterVolumeLevel(), AEV_GetMute(), AEV_QueryInterface(), AEV_Release(), AEV_SetMasterVolumeLevel(), and AEV_SetMute().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( mmdevapi  )

Variable Documentation

◆ AEVImpl_Vtbl

const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI AEV_SetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *iface, float level, const GUID *ctx)
Definition: audiovolume.c:135
static HRESULT WINAPI AEV_RegisterControlChangeNotify(IAudioEndpointVolumeEx *iface, IAudioEndpointVolumeCallback *notify)
Definition: audiovolume.c:94
static HRESULT WINAPI AEV_GetVolumeStepInfo(IAudioEndpointVolumeEx *iface, UINT *stepsize, UINT *stepcount)
Definition: audiovolume.c:225
static HRESULT WINAPI AEV_VolumeStepUp(IAudioEndpointVolumeEx *iface, const GUID *ctx)
Definition: audiovolume.c:234
static ULONG WINAPI AEV_AddRef(IAudioEndpointVolumeEx *iface)
Definition: audiovolume.c:76
static HRESULT WINAPI AEV_GetVolumeRangeChannel(IAudioEndpointVolumeEx *iface, UINT chan, float *mindb, float *maxdb, float *inc)
Definition: audiovolume.c:271
static HRESULT WINAPI AEV_VolumeStepDown(IAudioEndpointVolumeEx *iface, const GUID *ctx)
Definition: audiovolume.c:241
static HRESULT WINAPI AEV_GetChannelCount(IAudioEndpointVolumeEx *iface, UINT *count)
Definition: audiovolume.c:112
static HRESULT WINAPI AEV_GetMute(IAudioEndpointVolumeEx *iface, BOOL *mute)
Definition: audiovolume.c:211
static HRESULT WINAPI AEV_SetChannelVolumeLevel(IAudioEndpointVolumeEx *iface, UINT chan, float leveldb, const GUID *ctx)
Definition: audiovolume.c:165
static HRESULT WINAPI AEV_QueryInterface(IAudioEndpointVolumeEx *iface, REFIID riid, void **ppv)
Definition: audiovolume.c:58
static HRESULT WINAPI AEV_GetChannelVolumeLevel(IAudioEndpointVolumeEx *iface, UINT chan, float *leveldb)
Definition: audiovolume.c:179
static HRESULT WINAPI AEV_GetMasterVolumeLevelScalar(IAudioEndpointVolumeEx *iface, float *level)
Definition: audiovolume.c:156
static HRESULT WINAPI AEV_UnregisterControlChangeNotify(IAudioEndpointVolumeEx *iface, IAudioEndpointVolumeCallback *notify)
Definition: audiovolume.c:103
static ULONG WINAPI AEV_Release(IAudioEndpointVolumeEx *iface)
Definition: audiovolume.c:84
static HRESULT WINAPI AEV_SetMasterVolumeLevel(IAudioEndpointVolumeEx *iface, float leveldb, const GUID *ctx)
Definition: audiovolume.c:121
static HRESULT WINAPI AEV_GetVolumeRange(IAudioEndpointVolumeEx *iface, float *mindb, float *maxdb, float *inc)
Definition: audiovolume.c:257
static HRESULT WINAPI AEV_QueryHardwareSupport(IAudioEndpointVolumeEx *iface, DWORD *mask)
Definition: audiovolume.c:248
static HRESULT WINAPI AEV_GetChannelVolumeLevelScalar(IAudioEndpointVolumeEx *iface, UINT chan, float *level)
Definition: audiovolume.c:188
static HRESULT WINAPI AEV_SetMute(IAudioEndpointVolumeEx *iface, BOOL mute, const GUID *ctx)
Definition: audiovolume.c:197
static HRESULT WINAPI AEV_GetMasterVolumeLevel(IAudioEndpointVolumeEx *iface, float *leveldb)
Definition: audiovolume.c:142
static HRESULT WINAPI AEV_SetChannelVolumeLevelScalar(IAudioEndpointVolumeEx *iface, UINT chan, float level, const GUID *ctx)
Definition: audiovolume.c:172

Definition at line 280 of file audiovolume.c.

Referenced by AudioEndpointVolume_Create().