strmbase: Implement BasicAudio.
[wine/multimedia.git] / dlls / strmbase / audio.c
blobbe995830054478a6e776765a3233956224b3125b
1 /*
2 * Generic Implementation of strmbase audio classes
4 * Copyright 2012 Aric Stewart, CodeWeavers
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define COBJMACROS
23 #include <assert.h>
24 #include "dshow.h"
25 #include "uuids.h"
26 #include "vfwmsgs.h"
27 #include "wine/debug.h"
28 #include "wine/unicode.h"
29 #include "wine/strmbase.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
33 static inline BasicAudio *impl_from_IBasicAudio(IBasicAudio *iface)
35 return CONTAINING_RECORD(iface, BasicAudio, IBasicAudio_iface);
38 HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl)
40 pBasicAudio->IBasicAudio_iface.lpVtbl = lpVtbl;
41 BaseDispatch_Init(&pBasicAudio->baseDispatch, &IID_IBasicAudio);
43 return S_OK;
46 HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio)
48 return BaseDispatch_Destroy(&pBasicAudio->baseDispatch);
51 HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo)
53 BasicAudio *This = impl_from_IBasicAudio(iface);
55 return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo);
58 HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
60 BasicAudio *This = impl_from_IBasicAudio(iface);
62 return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo);
65 HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
67 BasicAudio *This = impl_from_IBasicAudio(iface);
69 return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId);
72 HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
74 BasicAudio *This = impl_from_IBasicAudio(iface);
75 HRESULT hr = S_OK;
76 ITypeInfo *pTypeInfo;
78 hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo);
79 if (SUCCEEDED(hr))
81 hr = ITypeInfo_Invoke(pTypeInfo, &This->IBasicAudio_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
82 ITypeInfo_Release(pTypeInfo);
85 return hr;