2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS BDA Proxy
4 * FILE: dll/directx/msvidctl/tuningspace.cpp
5 * PURPOSE: ITuningRequest interface
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
11 class CTuneRequest
: public IDVBTuneRequest
14 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
16 STDMETHODIMP_(ULONG
) AddRef()
18 InterlockedIncrement(&m_Ref
);
21 STDMETHODIMP_(ULONG
) Release()
23 InterlockedDecrement(&m_Ref
);
26 OutputDebugStringW(L
"CTuneRequest::Release : delete\n");
29 swprintf(Buffer
, L
"CTuneRequest::Release : m_TuningSpace %p delete\n", m_TuningSpace
);
30 OutputDebugStringW(Buffer
);
33 m_TuningSpace
->Release();
41 HRESULT STDMETHODCALLTYPE
GetTypeInfoCount(UINT
*pctinfo
);
42 HRESULT STDMETHODCALLTYPE
GetTypeInfo(UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
);
43 HRESULT STDMETHODCALLTYPE
GetIDsOfNames(REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
);
44 HRESULT STDMETHODCALLTYPE
Invoke(DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
);
46 //ITuneRequest methods
47 HRESULT STDMETHODCALLTYPE
get_TuningSpace(ITuningSpace
**TuningSpace
);
48 HRESULT STDMETHODCALLTYPE
get_Components(IComponents
**Components
);
49 HRESULT STDMETHODCALLTYPE
Clone(ITuneRequest
**NewTuneRequest
);
50 HRESULT STDMETHODCALLTYPE
get_Locator(ILocator
**Locator
);
51 HRESULT STDMETHODCALLTYPE
put_Locator(ILocator
*Locator
);
53 //IDVBTuneRequest methods
54 HRESULT STDMETHODCALLTYPE
get_ONID(long *ONID
);
55 HRESULT STDMETHODCALLTYPE
put_ONID(long ONID
);
56 HRESULT STDMETHODCALLTYPE
get_TSID(long *TSID
);
57 HRESULT STDMETHODCALLTYPE
put_TSID(long TSID
);
58 HRESULT STDMETHODCALLTYPE
get_SID(long *SID
);
59 HRESULT STDMETHODCALLTYPE
put_SID(long SID
);
61 CTuneRequest(ITuningSpace
* TuningSpace
) : m_Ref(0), m_ONID(-1), m_TSID(-1), m_SID(-1), m_Locator(0), m_TuningSpace(TuningSpace
)
63 m_TuningSpace
->AddRef();
66 CTuneRequest(ITuningSpace
* TuningSpace
, LONG ONID
, LONG TSID
, LONG SID
, ILocator
* Locator
) : m_Ref(1), m_ONID(ONID
), m_TSID(TSID
), m_SID(SID
), m_Locator(Locator
), m_TuningSpace(TuningSpace
)
71 m_TuningSpace
->AddRef();
74 virtual ~CTuneRequest(){};
82 ITuningSpace
* m_TuningSpace
;
88 CTuneRequest::QueryInterface(
92 if (IsEqualGUID(refiid
, IID_IUnknown
))
94 *Output
= PVOID(this);
95 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
99 if (IsEqualGUID(refiid
, IID_ITuneRequest
))
101 *Output
= (ITuneRequest
*)this;
102 reinterpret_cast<ITuneRequest
*>(*Output
)->AddRef();
106 if (IsEqualGUID(refiid
, IID_IDVBTuneRequest
))
108 *Output
= (IDVBTuneRequest
*)this;
109 reinterpret_cast<IDVBTuneRequest
*>(*Output
)->AddRef();
113 WCHAR Buffer
[MAX_PATH
];
115 StringFromCLSID(refiid
, &lpstr
);
116 swprintf(Buffer
, L
"CTuneRequest::QueryInterface: NoInterface for %s", lpstr
);
117 OutputDebugStringW(Buffer
);
118 CoTaskMemFree(lpstr
);
121 return E_NOINTERFACE
;
124 //-------------------------------------------------------------------
129 CTuneRequest::GetTypeInfoCount(UINT
*pctinfo
)
131 OutputDebugStringW(L
"CTuneRequest::GetTypeInfoCount : NotImplemented\n");
137 CTuneRequest::GetTypeInfo(UINT iTInfo
, LCID lcid
, ITypeInfo
**ppTInfo
)
139 OutputDebugStringW(L
"CTuneRequest::GetTypeInfo : NotImplemented\n");
144 CTuneRequest::GetIDsOfNames(REFIID riid
, LPOLESTR
*rgszNames
, UINT cNames
, LCID lcid
, DISPID
*rgDispId
)
146 OutputDebugStringW(L
"CTuneRequest::GetIDsOfNames : NotImplemented\n");
151 CTuneRequest::Invoke(DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
*pDispParams
, VARIANT
*pVarResult
, EXCEPINFO
*pExcepInfo
, UINT
*puArgErr
)
153 OutputDebugStringW(L
"CTuneRequest::Invoke : NotImplemented\n");
157 //-------------------------------------------------------------------
158 // ITuneRequest interface
163 CTuneRequest::get_TuningSpace(ITuningSpace
**TuningSpace
)
165 #ifdef MSVIDCTL_TRACE
166 OutputDebugStringW(L
"CTuneRequest::get_TuningSpace\n");
169 *TuningSpace
= m_TuningSpace
;
170 m_TuningSpace
->AddRef();
177 CTuneRequest::get_Components(IComponents
**Components
)
179 OutputDebugStringW(L
"CTuneRequest::get_Components : NotImplemented\n");
185 CTuneRequest::Clone(ITuneRequest
**NewTuneRequest
)
187 #ifdef MSVIDCTL_TRACE
189 swprintf(Buffer
, L
"CTuneRequest::Clone %p\n", NewTuneRequest
);
190 OutputDebugStringW(Buffer
);
193 *NewTuneRequest
= new CTuneRequest(m_TuningSpace
, m_ONID
, m_TSID
, m_SID
, m_Locator
);
195 if (!*NewTuneRequest
)
196 return E_OUTOFMEMORY
;
203 CTuneRequest::get_Locator(ILocator
**Locator
)
205 OutputDebugStringW(L
"CTuneRequest::get_Locator : NotImplemented\n");
211 CTuneRequest::put_Locator(ILocator
*Locator
)
213 OutputDebugStringW(L
"CTuneRequest::put_Locator : stub\n");
219 //-------------------------------------------------------------------
220 // IDVBTuneRequest interface
225 CTuneRequest::get_ONID(long *ONID
)
227 #ifdef MSVIDCTL_TRACE
228 OutputDebugStringW(L
"CTuneRequest::get_ONID\n");
237 CTuneRequest::put_ONID(long ONID
)
239 #ifdef MSVIDCTL_TRACE
241 swprintf(Buffer
, L
"CTuneRequest::put_ONID : %lu\n", ONID
);
242 OutputDebugStringW(Buffer
);
251 CTuneRequest::get_TSID(long *TSID
)
253 #ifdef MSVIDCTL_TRACE
254 OutputDebugStringW(L
"CTuneRequest::get_TSID\n");
263 CTuneRequest::put_TSID(long TSID
)
265 #ifdef MSVIDCTL_TRACE
267 swprintf(Buffer
, L
"CTuneRequest::put_TSID : %lu\n", TSID
);
268 OutputDebugStringW(Buffer
);
277 CTuneRequest::get_SID(long *SID
)
279 #ifdef MSVIDCTL_TRACE
280 OutputDebugStringW(L
"CTuneRequest::get_SID\n");
289 CTuneRequest::put_SID(long SID
)
291 #ifdef MSVIDCTL_TRACE
293 swprintf(Buffer
, L
"CTuneRequest::put_SID : %lu\n", SID
);
294 OutputDebugStringW(Buffer
);
303 CTuneRequest_fnConstructor(
305 ITuningSpace
* TuningSpace
,
309 // construct device control
310 CTuneRequest
* request
= new CTuneRequest(TuningSpace
);
312 #ifdef MSVIDCTL_TRACE
313 WCHAR Buffer
[MAX_PATH
];
315 StringFromCLSID(riid
, &lpstr
);
316 swprintf(Buffer
, L
"CTuneRequest_fnConstructor riid %s pUnknown %p\n", lpstr
, pUnknown
);
317 OutputDebugStringW(Buffer
);
321 return E_OUTOFMEMORY
;
323 if (FAILED(request
->QueryInterface(riid
, ppv
)))
327 return E_NOINTERFACE
;