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.

115 lines
3.7 KiB

  1. // CMSVidStreamBufferRecorder.h : Declaration of the CMSVidStreamBufferRecorder
  2. #ifndef __MSVIDSTREAMBUFFERRECORDER_H_
  3. #define __MSVIDSTREAMBUFFERRECORDER_H_
  4. #include "stdafx.h"
  5. #include <map>
  6. #include <Mshtml.h>
  7. #include <activscp.h>
  8. #include <Atlctl.h>
  9. #include <Exdisp.h>
  10. #include <dvdmedia.h>
  11. #include <objectwithsiteimplsec.h>
  12. #include "segimpl.h"
  13. #include "seg.h"
  14. #include "resource.h" // main symbols
  15. #include "mslcid.h"
  16. #include "sbe.h"
  17. #include "dvdmedia.h"
  18. typedef CComQIPtr<IStreamBufferRecordControl> pqSBERecControl;
  19. /////////////////////////////////////////////////////
  20. class ATL_NO_VTABLE __declspec(uuid("CAAFDD83-CEFC-4e3d-BA03-175F17A24F91")) CMSVidStreamBufferRecordingControlBase :
  21. public CComObjectRootEx<CComSingleThreadModel>,
  22. public CComCoClass<CMSVidStreamBufferRecordingControlBase, &__uuidof(CMSVidStreamBufferRecordingControlBase)>,
  23. public IObjectWithSiteImplSec<CMSVidStreamBufferRecordingControlBase>,
  24. public ISupportErrorInfo,
  25. public IObjectSafetyImpl<CMSVidStreamBufferRecordingControlBase, INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>,
  26. public IDispatchImpl<IMSVidStreamBufferRecordingControl, &IID_IMSVidStreamBufferRecordingControl, &LIBID_MSVidCtlLib>
  27. {
  28. public:
  29. CMSVidStreamBufferRecordingControlBase()
  30. {
  31. m_Start = -1;
  32. m_Stop = -1;
  33. }
  34. virtual ~CMSVidStreamBufferRecordingControlBase(){
  35. if(!(!Recorder)){// not not'ing smart pointer, they assert if p == 0
  36. Recorder.Release();
  37. }
  38. }
  39. REGISTER_AUTOMATION_OBJECT(IDS_PROJNAME,
  40. IDS_REG_MSVIDSTREAMBUFFERRECORDINGCONTROL_PROGID,
  41. IDS_REG_MSVIDSTREAMBUFFERRECORDINGCONTROL_DESC,
  42. LIBID_MSVidCtlLib,
  43. __uuidof(CMSVidStreamBufferRecordingControlBase));
  44. DECLARE_PROTECT_FINAL_CONSTRUCT()
  45. BEGIN_COM_MAP(CMSVidStreamBufferRecordingControlBase)
  46. COM_INTERFACE_ENTRY(IDispatch)
  47. COM_INTERFACE_ENTRY(IMSVidStreamBufferRecordingControl)
  48. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  49. COM_INTERFACE_ENTRY(IObjectSafety)
  50. COM_INTERFACE_ENTRY(IObjectWithSite)
  51. END_COM_MAP()
  52. protected:
  53. pqSBERecControl Recorder;
  54. CComBSTR m_pName;
  55. REFERENCE_TIME m_Start;
  56. REFERENCE_TIME m_Stop;
  57. RecordingType m_Type;
  58. // IMSVidStreamBufferRecordingControl
  59. public:
  60. // ISupportsErrorInfo
  61. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  62. STDMETHOD(get_StartTime)(/*[out, retval]*/ long *Start) ;
  63. STDMETHOD(put_StartTime)(/*[in]*/ long Start) ;
  64. STDMETHOD(get_StopTime)(/*[out, retval]*/ long *Stop) ;
  65. STDMETHOD(put_StopTime)(/*[in]*/ long Stop) ;
  66. STDMETHOD(get_RecordingStopped)(/*[out, retval]*/ VARIANT_BOOL* Result) ;
  67. STDMETHOD(get_RecordingStarted)(/*[out, retval]*/ VARIANT_BOOL* Result) ;
  68. STDMETHOD(get_FileName)(/*[out, retval]*/ BSTR* pName);
  69. STDMETHOD(get_RecordingType)(/*[out, retval]*/ RecordingType *dwType);
  70. STDMETHOD(get_RecordingAttribute)(/*[out, retval]*/ IUnknown **pRecordingAttribute);
  71. };
  72. class ATL_NO_VTABLE __declspec(uuid("7D0B2FDE-9CA8-4b71-AE65-12193F5F52D8")) CMSVidStreamBufferRecordingControl:
  73. public CComObject<CMSVidStreamBufferRecordingControlBase>
  74. {
  75. public:
  76. CMSVidStreamBufferRecordingControl(IStreamBufferRecordControl* newVal, BSTR name, DWORD type){
  77. Recorder.Attach(newVal);
  78. m_pName.Attach(name);
  79. if(type == RECORDING_TYPE_CONTENT){
  80. m_Type = CONTENT;
  81. }
  82. else{
  83. m_Type = REFERENCE;
  84. }
  85. }
  86. virtual ~CMSVidStreamBufferRecordingControl(){}
  87. };
  88. #endif //__MSVIDSTREAMBUFFERRECORDINGCONTROL_H_