Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.9 KiB

  1. // Copyright (c) 1999-2002 Microsoft Corporation. All Rights Reserved.
  2. #pragma once
  3. #ifndef _MSVIDSTREAMBUFFERSOURCECP_H_
  4. #define _MSVIDSTREAMBUFFERSOURCECP_H_
  5. #include "fileplaybackcp.h"
  6. template <class T, const IID* piid = &IID_IMSVidStreamBufferSourceEvent, class CDV = CComDynamicUnkArray>
  7. class CProxy_StreamBufferSourceEvent : public CProxy_FilePlaybackEvent<T, piid, CDV>
  8. {
  9. public:
  10. void Fire_CertificateFailure() { Fire_VoidMethod(eventidSourceCertificateFailure); }
  11. void Fire_CertificateSuccess() { Fire_VoidMethod(eventidSourceCertificateSuccess); }
  12. void Fire_RatingsBlocked() { Fire_VoidMethod(eventidRatingsBlocked); }
  13. void Fire_RatingsUnblocked() { Fire_VoidMethod(eventidRatingsUnlocked); }
  14. void Fire_RatingsChanged() { Fire_VoidMethod(eventidRatingsChanged); }
  15. void Fire_StaleDataRead() { Fire_VoidMethod(eventidStaleDataRead); }
  16. void Fire_ContentBecomingStale() { Fire_VoidMethod(eventidContentBecomingStale); }
  17. void Fire_StaleFilesDeleted() { Fire_VoidMethod(eventidStaleFileDeleted); }
  18. void Fire_TimeHole(long lParam1, long lParam2){
  19. T* pT = static_cast<T*>(this);
  20. int nConnectionIndex;
  21. CComVariant* pvars = new CComVariant[2];
  22. int nConnections = m_vec.GetSize();
  23. for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
  24. {
  25. pT->Lock();
  26. CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
  27. pT->Unlock();
  28. IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
  29. if (pDispatch != NULL)
  30. {
  31. pvars[1] = lParam1;
  32. pvars[0] = lParam2;
  33. DISPPARAMS disp = { pvars, NULL, 2, 0 };
  34. pDispatch->Invoke(eventidDVDNotify, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
  35. }
  36. }
  37. delete[] pvars;
  38. }
  39. };
  40. #endif