Removed some more uses of the non-standard ICOM_THIS macro.
[wine/multimedia.git] / dlls / quartz / dsoundrender.c
blob9191a7acd1ec322b70ffc0178f0b57d1290e2692
1 /*
2 * Direct Sound Audio Renderer
4 * Copyright 2004 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "config.h"
23 #include "quartz_private.h"
24 #include "control_private.h"
25 #include "pin.h"
27 #include "uuids.h"
28 #include "mmreg.h"
29 #include "vfwmsgs.h"
30 #include "fourcc.h"
31 #include "windef.h"
32 #include "winbase.h"
33 #include "dshow.h"
34 #include "evcode.h"
35 #include "strmif.h"
36 #include "dsound.h"
38 #include "wine/unicode.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
43 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
45 static const IBaseFilterVtbl DSoundRender_Vtbl;
46 static const IPinVtbl DSoundRender_InputPin_Vtbl;
47 static const IMemInputPinVtbl MemInputPin_Vtbl;
48 static const IBasicAudioVtbl IBasicAudio_Vtbl;
50 typedef struct DSoundRenderImpl
52 const IBaseFilterVtbl * lpVtbl;
53 const IBasicAudioVtbl *IBasicAudio_vtbl;
55 ULONG refCount;
56 CRITICAL_SECTION csFilter;
57 FILTER_STATE state;
58 REFERENCE_TIME rtStreamStart;
59 IReferenceClock * pClock;
60 FILTER_INFO filterInfo;
61 IMediaEventSink * pEventSink;
63 InputPin * pInputPin;
64 IPin ** ppPins;
66 LPDIRECTSOUND dsound;
67 LPDIRECTSOUNDBUFFER dsbuffer;
68 DWORD write_pos;
69 int init;
70 } DSoundRenderImpl;
72 static HRESULT DSoundRender_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
74 InputPin * pPinImpl;
76 *ppPin = NULL;
78 if (pPinInfo->dir != PINDIR_INPUT)
80 ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir);
81 return E_INVALIDARG;
84 pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl));
86 if (!pPinImpl)
87 return E_OUTOFMEMORY;
89 if (SUCCEEDED(InputPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl)))
91 pPinImpl->pin.lpVtbl = &DSoundRender_InputPin_Vtbl;
92 pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl;
94 *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl);
95 return S_OK;
97 return E_FAIL;
101 #define DSBUFFERSIZE 8192
103 static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
105 HRESULT hr;
106 WAVEFORMATEX wav_fmt;
107 AM_MEDIA_TYPE amt;
108 WAVEFORMATEX* format;
109 DSBUFFERDESC buf_desc;
110 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
112 hr = IPin_ConnectionMediaType(This->ppPins[0], &amt);
113 if (FAILED(hr)) {
114 ERR("Unable to retrieve media type\n");
115 return hr;
118 TRACE("MajorType %s\n", debugstr_guid(&amt.majortype));
119 TRACE("SubType %s\n", debugstr_guid(&amt.subtype));
120 TRACE("Format %s\n", debugstr_guid(&amt.formattype));
121 TRACE("Size %ld\n", amt.cbFormat);
123 dump_AM_MEDIA_TYPE(&amt);
125 format = (WAVEFORMATEX*)amt.pbFormat;
126 TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM);
127 TRACE("nChannels = %d\n", format->nChannels);
128 TRACE("nSamplesPerSec = %lu\n", format->nSamplesPerSec);
129 TRACE("nAvgBytesPerSec = %lu\n", format->nAvgBytesPerSec);
130 TRACE("nBlockAlign = %d\n", format->nBlockAlign);
131 TRACE("wBitsPerSample = %d\n", format->wBitsPerSample);
132 TRACE("cbSize = %d\n", format->cbSize);
134 hr = DirectSoundCreate(NULL, &This->dsound, NULL);
135 if (FAILED(hr)) {
136 ERR("Cannot create Direct Sound object\n");
137 return hr;
140 wav_fmt = *format;
141 wav_fmt.cbSize = 0;
143 memset(&buf_desc,0,sizeof(DSBUFFERDESC));
144 buf_desc.dwSize = sizeof(DSBUFFERDESC);
145 buf_desc.dwBufferBytes = DSBUFFERSIZE;
146 buf_desc.lpwfxFormat = &wav_fmt;
147 hr = IDirectSound_CreateSoundBuffer(This->dsound, &buf_desc, &This->dsbuffer, NULL);
148 if (FAILED(hr)) {
149 ERR("Can't create sound buffer !\n");
150 return hr;
153 This->write_pos = 0;
155 return hr;
158 static DWORD DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data, DWORD size)
160 HRESULT result;
161 LPBYTE lpbuf1 = NULL;
162 LPBYTE lpbuf2 = NULL;
163 DWORD dwsize1 = 0;
164 DWORD dwsize2 = 0;
165 static int init_;
166 DWORD size2;
167 DWORD play_pos,buf_free;
169 while (1)
171 result=IDirectSoundBuffer_GetCurrentPosition(This->dsbuffer, &play_pos, NULL);
172 if (result != DS_OK) {
173 ERR("Error GetCurrentPosition: %lx\n", result);
174 break;
176 if (This->write_pos < play_pos)
177 buf_free = play_pos-This->write_pos;
178 else
179 buf_free = DSBUFFERSIZE - This->write_pos + play_pos;
181 size2 = min(buf_free, size);
182 result = IDirectSoundBuffer_Lock(This->dsbuffer, This->write_pos, size2, &lpbuf1, &dwsize1, &lpbuf2, &dwsize2, 0);
183 if (result != DS_OK) {
184 ERR("Unable to lock sound buffer !\n");
185 break;
187 TRACE("write_pos=%ld, size=%ld, sz1=%ld, sz2=%ld\n", This->write_pos, size2, dwsize1, dwsize2);
189 memcpy(lpbuf1, data, dwsize1);
190 if (dwsize2) {
191 memcpy(lpbuf2, data + dwsize1, dwsize2);
194 result = IDirectSoundBuffer_Unlock(This->dsbuffer, lpbuf1, dwsize1, lpbuf2, dwsize2);
195 if (result != DS_OK)
196 ERR("Unable to unlock sound buffer !\n");
197 if (!init_)
199 result = IDirectSoundBuffer_Play(This->dsbuffer, 0, 0, DSBPLAY_LOOPING);
200 if (result != DS_OK) {
201 ERR("Can't start playing !\n");
204 size -= dwsize1 + dwsize2;
205 data += dwsize1 + dwsize2;
206 This->write_pos = (This->write_pos + dwsize1 + dwsize2) % DSBUFFERSIZE;
208 if (!size)
209 break;
210 Sleep(10);
212 return 0;
215 static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample)
217 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
218 LPBYTE pbSrcStream = NULL;
219 long cbSrcStream = 0;
220 REFERENCE_TIME tStart, tStop;
221 HRESULT hr;
223 TRACE("%p %p\n", iface, pSample);
225 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
226 if (FAILED(hr))
228 ERR("Cannot get pointer to sample data (%lx)\n", hr);
229 return hr;
232 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
233 if (FAILED(hr))
234 ERR("Cannot get sample time (%lx)\n", hr);
236 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
238 TRACE("Sample data ptr = %p, size = %ld\n", pbSrcStream, cbSrcStream);
240 #if 0 /* For debugging purpose */
242 int i;
243 for(i = 0; i < cbSrcStream; i++)
245 if ((i!=0) && !(i%16))
246 DPRINTF("\n");
247 DPRINTF("%02x ", pbSrcStream[i]);
249 DPRINTF("\n");
251 #endif
253 if (!This->init)
255 This->init = 1;
256 hr = DSoundRender_CreateSoundBuffer(iface);
257 if (FAILED(hr))
259 ERR("Unable to create DSound buffer\n");
262 DSoundRender_SendSampleData(This, pbSrcStream, cbSrcStream);
264 /* We have finished with the incoming sample, we must release it now */
265 IMediaSample_Release(pSample);
267 return S_OK;
270 static HRESULT DSoundRender_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
272 WAVEFORMATEX* format = (WAVEFORMATEX*)pmt->pbFormat;
273 TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM);
274 TRACE("nChannels = %d\n", format->nChannels);
275 TRACE("nSamplesPerSec = %ld\n", format->nAvgBytesPerSec);
276 TRACE("nAvgBytesPerSec = %ld\n", format->nAvgBytesPerSec);
277 TRACE("nBlockAlign = %d\n", format->nBlockAlign);
278 TRACE("wBitsPerSample = %d\n", format->wBitsPerSample);
280 if (IsEqualIID(&pmt->majortype, &MEDIATYPE_Audio) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_PCM))
281 return S_OK;
282 return S_FALSE;
285 HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
287 HRESULT hr;
288 PIN_INFO piInput;
289 DSoundRenderImpl * pDSoundRender;
291 TRACE("(%p, %p)\n", pUnkOuter, ppv);
293 *ppv = NULL;
295 if (pUnkOuter)
296 return CLASS_E_NOAGGREGATION;
298 pDSoundRender = CoTaskMemAlloc(sizeof(DSoundRenderImpl));
300 pDSoundRender->lpVtbl = &DSoundRender_Vtbl;
301 pDSoundRender->IBasicAudio_vtbl = &IBasicAudio_Vtbl;
302 pDSoundRender->refCount = 1;
303 InitializeCriticalSection(&pDSoundRender->csFilter);
304 pDSoundRender->state = State_Stopped;
305 pDSoundRender->pClock = NULL;
306 pDSoundRender->init = 0;
307 ZeroMemory(&pDSoundRender->filterInfo, sizeof(FILTER_INFO));
309 pDSoundRender->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
311 /* construct input pin */
312 piInput.dir = PINDIR_INPUT;
313 piInput.pFilter = (IBaseFilter *)pDSoundRender;
314 strncpyW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
315 hr = DSoundRender_InputPin_Construct(&piInput, DSoundRender_Sample, (LPVOID)pDSoundRender, DSoundRender_QueryAccept, &pDSoundRender->csFilter, (IPin **)&pDSoundRender->pInputPin);
317 if (SUCCEEDED(hr))
319 pDSoundRender->ppPins[0] = (IPin *)pDSoundRender->pInputPin;
320 *ppv = (LPVOID)pDSoundRender;
322 else
324 CoTaskMemFree(pDSoundRender->ppPins);
325 DeleteCriticalSection(&pDSoundRender->csFilter);
326 CoTaskMemFree(pDSoundRender);
329 return hr;
332 static HRESULT WINAPI DSoundRender_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
334 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
335 TRACE("(%p, %p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
337 *ppv = NULL;
339 if (IsEqualIID(riid, &IID_IUnknown))
340 *ppv = (LPVOID)This;
341 else if (IsEqualIID(riid, &IID_IPersist))
342 *ppv = (LPVOID)This;
343 else if (IsEqualIID(riid, &IID_IMediaFilter))
344 *ppv = (LPVOID)This;
345 else if (IsEqualIID(riid, &IID_IBaseFilter))
346 *ppv = (LPVOID)This;
347 else if (IsEqualIID(riid, &IID_IBaseFilter))
348 *ppv = (LPVOID)&(This->IBasicAudio_vtbl);
350 if (*ppv)
352 IUnknown_AddRef((IUnknown *)(*ppv));
353 return S_OK;
356 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
358 return E_NOINTERFACE;
361 static ULONG WINAPI DSoundRender_AddRef(IBaseFilter * iface)
363 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
364 TRACE("(%p/%p)->()\n", This, iface);
365 return InterlockedIncrement(&This->refCount);
368 static ULONG WINAPI DSoundRender_Release(IBaseFilter * iface)
370 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
371 TRACE("(%p/%p)->()\n", This, iface);
372 if (!InterlockedDecrement(&This->refCount))
374 DeleteCriticalSection(&This->csFilter);
375 if (This->pClock)
376 IReferenceClock_Release(This->pClock);
378 IPin_Release(This->ppPins[0]);
380 HeapFree(GetProcessHeap(), 0, This->ppPins);
381 This->lpVtbl = NULL;
382 This->IBasicAudio_vtbl = NULL;
384 TRACE("Destroying Audio Renderer\n");
385 CoTaskMemFree(This);
387 return 0;
389 else
390 return This->refCount;
393 /** IPersist methods **/
395 static HRESULT WINAPI DSoundRender_GetClassID(IBaseFilter * iface, CLSID * pClsid)
397 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
398 TRACE("(%p/%p)->(%p)\n", This, iface, pClsid);
400 *pClsid = CLSID_DSoundRender;
402 return S_OK;
405 /** IMediaFilter methods **/
407 static HRESULT WINAPI DSoundRender_Stop(IBaseFilter * iface)
409 HRESULT hr = S_OK;
410 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
412 TRACE("(%p/%p)->()\n", This, iface);
414 EnterCriticalSection(&This->csFilter);
416 This->state = State_Stopped;
418 LeaveCriticalSection(&This->csFilter);
420 return hr;
423 static HRESULT WINAPI DSoundRender_Pause(IBaseFilter * iface)
425 HRESULT hr = S_OK;
426 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
428 TRACE("(%p/%p)->()\n", This, iface);
430 EnterCriticalSection(&This->csFilter);
432 This->state = State_Paused;
434 LeaveCriticalSection(&This->csFilter);
436 return hr;
439 static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
441 HRESULT hr = S_OK;
442 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
444 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
446 EnterCriticalSection(&This->csFilter);
448 This->rtStreamStart = tStart;
449 This->state = State_Running;
451 LeaveCriticalSection(&This->csFilter);
453 return hr;
456 static HRESULT WINAPI DSoundRender_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
458 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
460 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, dwMilliSecsTimeout, pState);
462 EnterCriticalSection(&This->csFilter);
464 *pState = This->state;
466 LeaveCriticalSection(&This->csFilter);
468 return S_OK;
471 static HRESULT WINAPI DSoundRender_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
473 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
475 TRACE("(%p/%p)->(%p)\n", This, iface, pClock);
477 EnterCriticalSection(&This->csFilter);
479 if (This->pClock)
480 IReferenceClock_Release(This->pClock);
481 This->pClock = pClock;
482 if (This->pClock)
483 IReferenceClock_AddRef(This->pClock);
485 LeaveCriticalSection(&This->csFilter);
487 return S_OK;
490 static HRESULT WINAPI DSoundRender_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
492 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
494 TRACE("(%p/%p)->(%p)\n", This, iface, ppClock);
496 EnterCriticalSection(&This->csFilter);
498 *ppClock = This->pClock;
499 IReferenceClock_AddRef(This->pClock);
501 LeaveCriticalSection(&This->csFilter);
503 return S_OK;
506 /** IBaseFilter implementation **/
508 static HRESULT WINAPI DSoundRender_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
510 ENUMPINDETAILS epd;
511 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
513 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
515 epd.cPins = 1; /* input pin */
516 epd.ppPins = This->ppPins;
517 return IEnumPinsImpl_Construct(&epd, ppEnum);
520 static HRESULT WINAPI DSoundRender_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
522 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
524 TRACE("(%p/%p)->(%s,%p)\n", This, iface, debugstr_w(Id), ppPin);
526 FIXME("DSoundRender::FindPin(...)\n");
528 /* FIXME: critical section */
530 return E_NOTIMPL;
533 static HRESULT WINAPI DSoundRender_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
535 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
537 TRACE("(%p/%p)->(%p)\n", This, iface, pInfo);
539 strcpyW(pInfo->achName, This->filterInfo.achName);
540 pInfo->pGraph = This->filterInfo.pGraph;
542 if (pInfo->pGraph)
543 IFilterGraph_AddRef(pInfo->pGraph);
545 return S_OK;
548 static HRESULT WINAPI DSoundRender_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
550 HRESULT hr;
551 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
553 TRACE("(%p/%p)->(%p, %s)\n", This, iface, pGraph, debugstr_w(pName));
555 EnterCriticalSection(&This->csFilter);
557 if (pName)
558 strcpyW(This->filterInfo.achName, pName);
559 else
560 *This->filterInfo.achName = '\0';
561 This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
563 hr = IFilterGraph_QueryInterface(pGraph, &IID_IMediaEventSink, (LPVOID*)&This->pEventSink);
565 LeaveCriticalSection(&This->csFilter);
567 return hr;
570 static HRESULT WINAPI DSoundRender_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
572 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
573 TRACE("(%p/%p)->(%p)\n", This, iface, pVendorInfo);
574 return E_NOTIMPL;
577 static const IBaseFilterVtbl DSoundRender_Vtbl =
579 DSoundRender_QueryInterface,
580 DSoundRender_AddRef,
581 DSoundRender_Release,
582 DSoundRender_GetClassID,
583 DSoundRender_Stop,
584 DSoundRender_Pause,
585 DSoundRender_Run,
586 DSoundRender_GetState,
587 DSoundRender_SetSyncSource,
588 DSoundRender_GetSyncSource,
589 DSoundRender_EnumPins,
590 DSoundRender_FindPin,
591 DSoundRender_QueryFilterInfo,
592 DSoundRender_JoinFilterGraph,
593 DSoundRender_QueryVendorInfo
596 static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface)
598 /* FIXME: critical section */
599 InputPin* This = (InputPin*)iface;
601 TRACE("(%p/%p)->()\n", This, iface);
603 return IMediaEventSink_Notify(((DSoundRenderImpl*)This->pin.pinInfo.pFilter)->pEventSink, EC_COMPLETE, S_OK, 0);
606 static const IPinVtbl DSoundRender_InputPin_Vtbl =
608 InputPin_QueryInterface,
609 IPinImpl_AddRef,
610 InputPin_Release,
611 InputPin_Connect,
612 InputPin_ReceiveConnection,
613 IPinImpl_Disconnect,
614 IPinImpl_ConnectedTo,
615 IPinImpl_ConnectionMediaType,
616 IPinImpl_QueryPinInfo,
617 IPinImpl_QueryDirection,
618 IPinImpl_QueryId,
619 IPinImpl_QueryAccept,
620 IPinImpl_EnumMediaTypes,
621 IPinImpl_QueryInternalConnections,
622 DSoundRender_InputPin_EndOfStream,
623 InputPin_BeginFlush,
624 InputPin_EndFlush,
625 InputPin_NewSegment
628 static const IMemInputPinVtbl MemInputPin_Vtbl =
630 MemInputPin_QueryInterface,
631 MemInputPin_AddRef,
632 MemInputPin_Release,
633 MemInputPin_GetAllocator,
634 MemInputPin_NotifyAllocator,
635 MemInputPin_GetAllocatorRequirements,
636 MemInputPin_Receive,
637 MemInputPin_ReceiveMultiple,
638 MemInputPin_ReceiveCanBlock
641 /*** IUnknown methods ***/
642 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
643 REFIID riid,
644 LPVOID*ppvObj) {
645 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
647 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
649 return DSoundRender_QueryInterface((IBaseFilter*)This, riid, ppvObj);
652 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
653 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
655 TRACE("(%p/%p)->()\n", This, iface);
657 return DSoundRender_AddRef((IBaseFilter*)This);
660 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
661 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
663 TRACE("(%p/%p)->()\n", This, iface);
665 return DSoundRender_Release((IBaseFilter*)This);
668 /*** IDispatch methods ***/
669 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
670 UINT*pctinfo) {
671 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
673 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
675 return S_OK;
678 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
679 UINT iTInfo,
680 LCID lcid,
681 ITypeInfo**ppTInfo) {
682 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
684 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
686 return S_OK;
689 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
690 REFIID riid,
691 LPOLESTR*rgszNames,
692 UINT cNames,
693 LCID lcid,
694 DISPID*rgDispId) {
695 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
697 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
699 return S_OK;
702 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
703 DISPID dispIdMember,
704 REFIID riid,
705 LCID lcid,
706 WORD wFlags,
707 DISPPARAMS*pDispParams,
708 VARIANT*pVarResult,
709 EXCEPINFO*pExepInfo,
710 UINT*puArgErr) {
711 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
713 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
715 return S_OK;
718 /*** IBasicAudio methods ***/
719 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
720 long lVolume) {
721 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
723 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
725 return S_OK;
728 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
729 long *plVolume) {
730 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
732 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
734 return S_OK;
737 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
738 long lBalance) {
739 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
741 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
743 return S_OK;
746 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
747 long *plBalance) {
748 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
750 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
752 return S_OK;
755 static const IBasicAudioVtbl IBasicAudio_Vtbl =
757 Basicaudio_QueryInterface,
758 Basicaudio_AddRef,
759 Basicaudio_Release,
760 Basicaudio_GetTypeInfoCount,
761 Basicaudio_GetTypeInfo,
762 Basicaudio_GetIDsOfNames,
763 Basicaudio_Invoke,
764 Basicaudio_put_Volume,
765 Basicaudio_get_Volume,
766 Basicaudio_put_Balance,
767 Basicaudio_get_Balance