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.

165 lines
4.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) 1998-1999 Microsoft Corporation
  6. //
  7. // File: cmmdtrk.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // CommandTrack.h : Declaration of the CCommandTrack
  11. #ifndef __COMMANDTRACK_H_
  12. #define __COMMANDTRACK_H_
  13. #include "tlist.h"
  14. #include "dmsect.h"
  15. #include "dmusici.h"
  16. // Don't think I currently need Command state data...
  17. typedef DWORD CommandStateData;
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CCommandTrack
  20. class CCommandTrack :
  21. //public ICommandTrack,
  22. public IDirectMusicTrack8,
  23. public IPersistStream
  24. {
  25. public:
  26. CCommandTrack();
  27. CCommandTrack(const CCommandTrack& rTrack, MUSIC_TIME mtStart, MUSIC_TIME mtEnd);
  28. ~CCommandTrack();
  29. // IUnknown
  30. //
  31. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  32. virtual STDMETHODIMP_(ULONG) AddRef();
  33. virtual STDMETHODIMP_(ULONG) Release();
  34. // ICommandTrack
  35. public:
  36. // ICommandTrack Methods
  37. HRESULT STDMETHODCALLTYPE Init(
  38. /*[in]*/ IDirectMusicSegment* pSegment
  39. );
  40. HRESULT STDMETHODCALLTYPE InitPlay(
  41. /*[in]*/ IDirectMusicSegmentState* pSegmentState,
  42. /*[in]*/ IDirectMusicPerformance* pPerformance,
  43. /*[out]*/ void** ppStateData,
  44. /*[in]*/ DWORD dwTrackID,
  45. /*[in]*/ DWORD dwFlags
  46. );
  47. HRESULT STDMETHODCALLTYPE EndPlay(
  48. /*[in]*/ void* pStateData
  49. );
  50. HRESULT STDMETHODCALLTYPE Play(
  51. /*[in]*/ void* pStateData,
  52. /*[in]*/ MUSIC_TIME mtStart,
  53. /*[in]*/ MUSIC_TIME mtEnd,
  54. /*[in]*/ MUSIC_TIME mtOffset,
  55. DWORD dwFlags,
  56. IDirectMusicPerformance* pPerf,
  57. IDirectMusicSegmentState* pSegState,
  58. DWORD dwVirtualID
  59. );
  60. HRESULT STDMETHODCALLTYPE GetPriority(
  61. /*[out]*/ DWORD* pPriority
  62. );
  63. HRESULT STDMETHODCALLTYPE GetParam(
  64. REFGUID pCommandGuid,
  65. MUSIC_TIME mtTime,
  66. MUSIC_TIME* pmtNext,
  67. void *pData);
  68. HRESULT STDMETHODCALLTYPE SetParam(
  69. /* [in] */ REFGUID pCommandGuid,
  70. /* [in] */ MUSIC_TIME mtTime,
  71. /* [out] */ void __RPC_FAR *pData);
  72. HRESULT STDMETHODCALLTYPE AddNotificationType(
  73. /* [in] */ REFGUID pGuidNotify
  74. );
  75. HRESULT STDMETHODCALLTYPE RemoveNotificationType(
  76. /* [in] */ REFGUID pGuidNotify
  77. );
  78. HRESULT STDMETHODCALLTYPE Clone(
  79. MUSIC_TIME mtStart,
  80. MUSIC_TIME mtEnd,
  81. IDirectMusicTrack** ppTrack);
  82. HRESULT STDMETHODCALLTYPE IsParamSupported(
  83. /*[in]*/ REFGUID pGuid
  84. );
  85. // IDirectMusicTrack8 Methods
  86. STDMETHODIMP PlayEx(void* pStateData,REFERENCE_TIME rtStart,
  87. REFERENCE_TIME rtEnd,REFERENCE_TIME rtOffset,
  88. DWORD dwFlags,IDirectMusicPerformance* pPerf,
  89. IDirectMusicSegmentState* pSegSt,DWORD dwVirtualID) ;
  90. STDMETHODIMP GetParamEx(REFGUID rguidType,REFERENCE_TIME rtTime,
  91. REFERENCE_TIME* prtNext,void* pParam,void * pStateData, DWORD dwFlags) ;
  92. STDMETHODIMP SetParamEx(REFGUID rguidType,REFERENCE_TIME rtTime,void* pParam, void * pStateData, DWORD dwFlags) ;
  93. STDMETHODIMP Compose(IUnknown* pContext,
  94. DWORD dwTrackGroup,
  95. IDirectMusicTrack** ppResultTrack) ;
  96. STDMETHODIMP Join(IDirectMusicTrack* pNewTrack,
  97. MUSIC_TIME mtJoin,
  98. IUnknown* pContext,
  99. DWORD dwTrackGroup,
  100. IDirectMusicTrack** ppResultTrack) ;
  101. // IPersist methods
  102. HRESULT STDMETHODCALLTYPE GetClassID( LPCLSID pclsid );
  103. // IPersistStream methods
  104. HRESULT STDMETHODCALLTYPE IsDirty();
  105. HRESULT STDMETHODCALLTYPE Save( LPSTREAM pStream, BOOL fClearDirty );
  106. HRESULT STDMETHODCALLTYPE GetSizeMax( ULARGE_INTEGER* /*pcbSize*/ );
  107. HRESULT STDMETHODCALLTYPE Load( LPSTREAM pStream );
  108. // CommandTrack members
  109. protected:
  110. void Clear();
  111. HRESULT SendNotification(DWORD dwCommand,
  112. MUSIC_TIME mtTime,
  113. IDirectMusicPerformance* pPerf,
  114. IDirectMusicSegmentState* pSegState,
  115. DWORD dwFlags);
  116. HRESULT GetParam2(
  117. MUSIC_TIME mtTime,
  118. MUSIC_TIME* pmtNext,
  119. DMUS_COMMAND_PARAM_2* pCommandParam);
  120. HRESULT GetParamNext(
  121. MUSIC_TIME mtTime,
  122. MUSIC_TIME* pmtNext,
  123. DMUS_COMMAND_PARAM_2* pCommandParam);
  124. HRESULT SetParamNext(
  125. MUSIC_TIME mtTime,
  126. DMUS_COMMAND_PARAM_2* pCommandParam);
  127. long m_cRef;
  128. TList<DMCommand> m_CommandList;
  129. CRITICAL_SECTION m_CriticalSection; // for load and GetParam
  130. BOOL m_fCSInitialized;
  131. DMUS_COMMAND_PARAM_2* m_pNextCommand;
  132. BYTE m_bRequiresSave;
  133. BOOL m_fNotifyCommand;
  134. };
  135. #endif //__COMMANDTRACK_H_