1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS WDM Streaming ActiveMovie Proxy 4 * FILE: dll/directx/ksproxy/basicaudio.cpp 5 * PURPOSE: IBasicAudio interface 6 * 7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) 8 */ 9 #include "precomp.h" 10 11 class CKsBasicAudio : public IBasicAudio, 12 public IDistributorNotify 13 { 14 public: 15 STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface); 16 17 STDMETHODIMP_(ULONG) AddRef() 18 { 19 InterlockedIncrement(&m_Ref); 20 return m_Ref; 21 } 22 STDMETHODIMP_(ULONG) Release() 23 { 24 InterlockedDecrement(&m_Ref); 25 26 if (!m_Ref) 27 { 28 delete this; 29 return 0; 30 } 31 return m_Ref; 32 } 33 34 // IDistributorNotify methods 35 HRESULT STDMETHODCALLTYPE Stop(); 36 HRESULT STDMETHODCALLTYPE Pause(); 37 HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME tStart); 38 HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock *pClock); 39 HRESULT STDMETHODCALLTYPE NotifyGraphChange(); 40 41 // IDispatch methods 42 HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo); 43 HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo); 44 HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId); 45 HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr); 46 47 48 // IBasicAudio methods 49 HRESULT STDMETHODCALLTYPE put_Volume(long lVolume); 50 HRESULT STDMETHODCALLTYPE get_Volume(long *plVolume); 51 HRESULT STDMETHODCALLTYPE put_Balance(long lBalance); 52 HRESULT STDMETHODCALLTYPE get_Balance(long *plBalance); 53 54 55 CKsBasicAudio() : m_Ref(0){} 56 virtual ~CKsBasicAudio(){} 57 58 protected: 59 LONG m_Ref; 60 }; 61 62 HRESULT 63 STDMETHODCALLTYPE 64 CKsBasicAudio::QueryInterface( 65 IN REFIID refiid, 66 OUT PVOID* Output) 67 { 68 if (IsEqualGUID(refiid, IID_IUnknown)) 69 { 70 *Output = PVOID(this); 71 reinterpret_cast<IUnknown*>(*Output)->AddRef(); 72 return NOERROR; 73 } 74 if (IsEqualGUID(refiid, IID_IDistributorNotify)) 75 { 76 *Output = (IDistributorNotify*)(this); 77 reinterpret_cast<IDistributorNotify*>(*Output)->AddRef(); 78 return NOERROR; 79 } 80 81 if (IsEqualGUID(refiid, IID_IBasicAudio)) 82 { 83 *Output = (IBasicAudio*)(this); 84 reinterpret_cast<IBasicAudio*>(*Output)->AddRef(); 85 return NOERROR; 86 } 87 88 return E_NOINTERFACE; 89 } 90 91 //------------------------------------------------------------------- 92 // IDistributorNotify interface 93 // 94 95 96 HRESULT 97 STDMETHODCALLTYPE 98 CKsBasicAudio::Stop() 99 { 100 #ifdef KSPROXY_TRACE 101 OutputDebugStringW(L"UNIMPLEMENTED\n"); 102 #endif 103 return E_NOTIMPL; 104 } 105 106 HRESULT 107 STDMETHODCALLTYPE 108 CKsBasicAudio::Pause() 109 { 110 #ifdef KSPROXY_TRACE 111 OutputDebugStringW(L"UNIMPLEMENTED\n"); 112 #endif 113 114 return E_NOTIMPL; 115 } 116 117 HRESULT 118 STDMETHODCALLTYPE 119 CKsBasicAudio::Run( 120 REFERENCE_TIME tStart) 121 { 122 #ifdef KSPROXY_TRACE 123 OutputDebugStringW(L"UNIMPLEMENTED\n"); 124 #endif 125 126 return E_NOTIMPL; 127 } 128 129 HRESULT 130 STDMETHODCALLTYPE 131 CKsBasicAudio::SetSyncSource( 132 IReferenceClock *pClock) 133 { 134 #ifdef KSPROXY_TRACE 135 OutputDebugStringW(L"UNIMPLEMENTED\n"); 136 #endif 137 return E_NOTIMPL; 138 } 139 140 HRESULT 141 STDMETHODCALLTYPE 142 CKsBasicAudio::NotifyGraphChange() 143 { 144 #ifdef KSPROXY_TRACE 145 OutputDebugStringW(L"UNIMPLEMENTED\n"); 146 #endif 147 148 return E_NOTIMPL; 149 } 150 151 //------------------------------------------------------------------- 152 // IDispatch interface 153 // 154 155 HRESULT 156 STDMETHODCALLTYPE 157 CKsBasicAudio::GetTypeInfoCount( 158 UINT *pctinfo) 159 { 160 #ifdef KSPROXY_TRACE 161 OutputDebugStringW(L"UNIMPLEMENTED\n"); 162 #endif 163 164 return E_NOTIMPL; 165 } 166 167 HRESULT 168 STDMETHODCALLTYPE 169 CKsBasicAudio::GetTypeInfo( 170 UINT iTInfo, 171 LCID lcid, 172 ITypeInfo **ppTInfo) 173 { 174 #ifdef KSPROXY_TRACE 175 OutputDebugStringW(L"UNIMPLEMENTED\n"); 176 #endif 177 return E_NOTIMPL; 178 } 179 180 HRESULT 181 STDMETHODCALLTYPE 182 CKsBasicAudio::GetIDsOfNames( 183 REFIID riid, 184 LPOLESTR *rgszNames, 185 UINT cNames, 186 LCID lcid, 187 DISPID *rgDispId) 188 { 189 #ifdef KSPROXY_TRACE 190 OutputDebugStringW(L"UNIMPLEMENTED\n"); 191 #endif 192 193 return E_NOTIMPL; 194 } 195 196 HRESULT 197 STDMETHODCALLTYPE 198 CKsBasicAudio::Invoke( 199 DISPID dispIdMember, 200 REFIID riid, 201 LCID lcid, 202 WORD wFlags, 203 DISPPARAMS *pDispParams, 204 VARIANT *pVarResult, 205 EXCEPINFO *pExcepInfo, 206 UINT *puArgErr) 207 { 208 #ifdef KSPROXY_TRACE 209 OutputDebugStringW(L"UNIMPLEMENTED\n"); 210 #endif 211 212 return E_NOTIMPL; 213 } 214 215 //------------------------------------------------------------------- 216 // IBasicAudio interface 217 // 218 219 HRESULT 220 STDMETHODCALLTYPE 221 CKsBasicAudio::put_Volume( 222 long lVolume) 223 { 224 #ifdef KSPROXY_TRACE 225 OutputDebugStringW(L"UNIMPLEMENTED\n"); 226 #endif 227 228 return E_NOTIMPL; 229 } 230 231 232 HRESULT 233 STDMETHODCALLTYPE 234 CKsBasicAudio::get_Volume( 235 long *plVolume) 236 { 237 #ifdef KSPROXY_TRACE 238 OutputDebugStringW(L"UNIMPLEMENTED\n"); 239 #endif 240 241 return E_NOTIMPL; 242 } 243 244 245 HRESULT 246 STDMETHODCALLTYPE 247 CKsBasicAudio::put_Balance( 248 long lBalance) 249 { 250 #ifdef KSPROXY_TRACE 251 OutputDebugStringW(L"UNIMPLEMENTED\n"); 252 #endif 253 254 return E_NOTIMPL; 255 } 256 257 258 HRESULT 259 STDMETHODCALLTYPE 260 CKsBasicAudio::get_Balance( 261 long *plBalance) 262 { 263 #ifdef KSPROXY_TRACE 264 OutputDebugStringW(L"UNIMPLEMENTED\n"); 265 #endif 266 267 return E_NOTIMPL; 268 } 269 270 HRESULT 271 WINAPI 272 CKsBasicAudio_Constructor( 273 IUnknown * pUnkOuter, 274 REFIID riid, 275 LPVOID * ppv) 276 { 277 #ifdef KSPROXY_TRACE 278 OutputDebugStringW(L"CKsBasicAudio_Constructor\n"); 279 #endif 280 281 CKsBasicAudio * handler = new CKsBasicAudio(); 282 283 if (!handler) 284 return E_OUTOFMEMORY; 285 286 if (FAILED(handler->QueryInterface(riid, ppv))) 287 { 288 /* not supported */ 289 delete handler; 290 return E_NOINTERFACE; 291 } 292 293 return NOERROR; 294 } 295