ReactOS 0.4.15-dev-8222-g9164419
audio.c
Go to the documentation of this file.
1/*
2 * Generic Implementation of strmbase audio classes
3 *
4 * Copyright 2012 Aric Stewart, CodeWeavers
5 *
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.
10 *
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.
15 *
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
19 */
20
21#define COBJMACROS
22
23#include <assert.h>
24#include "dshow.h"
25#include "uuids.h"
26#include "vfwmsgs.h"
27#include "wine/unicode.h"
28#include "wine/strmbase.h"
29
30
31static inline BasicAudio *impl_from_IBasicAudio(IBasicAudio *iface)
32{
33 return CONTAINING_RECORD(iface, BasicAudio, IBasicAudio_iface);
34}
35
36HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl)
37{
38 pBasicAudio->IBasicAudio_iface.lpVtbl = lpVtbl;
39 BaseDispatch_Init(&pBasicAudio->baseDispatch, &IID_IBasicAudio);
40
41 return S_OK;
42}
43
44HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio)
45{
46 return BaseDispatch_Destroy(&pBasicAudio->baseDispatch);
47}
48
50{
51 BasicAudio *This = impl_from_IBasicAudio(iface);
52
53 return BaseDispatchImpl_GetTypeInfoCount(&This->baseDispatch, pctinfo);
54}
55
56HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
57{
58 BasicAudio *This = impl_from_IBasicAudio(iface);
59
60 return BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, &IID_NULL, iTInfo, lcid, ppTInfo);
61}
62
63HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
64{
65 BasicAudio *This = impl_from_IBasicAudio(iface);
66
67 return BaseDispatchImpl_GetIDsOfNames(&This->baseDispatch, riid, rgszNames, cNames, lcid, rgDispId);
68}
69
70HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
71{
72 BasicAudio *This = impl_from_IBasicAudio(iface);
73 ITypeInfo *pTypeInfo;
74 HRESULT hr;
75
76 hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo);
77 if (SUCCEEDED(hr))
78 {
79 hr = ITypeInfo_Invoke(pTypeInfo, &This->IBasicAudio_iface, dispIdMember, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
80 ITypeInfo_Release(pTypeInfo);
81 }
82
83 return hr;
84}
unsigned short WORD
Definition: ntddk_ex.h:93
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
unsigned int UINT
Definition: ndis.h:50
#define REFIID
Definition: guiddef.h:118
#define IID_NULL
Definition: guiddef.h:98
DWORD LCID
Definition: nls.h:13
HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr)
Definition: audio.c:70
static BasicAudio * impl_from_IBasicAudio(IBasicAudio *iface)
Definition: audio.c:31
HRESULT WINAPI BasicAudio_Init(BasicAudio *pBasicAudio, const IBasicAudioVtbl *lpVtbl)
Definition: audio.c:36
HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: audio.c:56
HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: audio.c:63
HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio)
Definition: audio.c:44
HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo)
Definition: audio.c:49
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo)
Definition: dispatch.c:70
HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
Definition: dispatch.c:52
HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid)
Definition: dispatch.c:30
HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This)
Definition: dispatch.c:45
HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
Definition: dispatch.c:59
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define WINAPI
Definition: msvc.h:6