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.

213 lines
5.9 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) 1998-1999 Microsoft Corporation
  6. //
  7. // File: motiftrk.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // MotifTrk.h : Declaration of the CMotifTrack
  11. #ifndef __MOTIFTRACK_H_
  12. #define __MOTIFTRACK_H_
  13. //#include "resource.h" // main symbols
  14. #include "Ptrntrk.h"
  15. struct MotifTrackInfo : public PatternTrackInfo
  16. {
  17. MotifTrackInfo();
  18. MotifTrackInfo(const MotifTrackInfo* pInfo, MUSIC_TIME mtStart, MUSIC_TIME mtEnd)
  19. : PatternTrackInfo(pInfo, mtStart, mtEnd),
  20. m_pPattern(NULL)
  21. {
  22. m_dwPatternTag = DMUS_PATTERN_MOTIF;
  23. if (pInfo)
  24. {
  25. m_pPattern = pInfo->m_pPattern;
  26. InitTrackVariations(m_pPattern);
  27. if (m_pPattern) m_pPattern->AddRef();
  28. }
  29. }
  30. ~MotifTrackInfo();
  31. virtual HRESULT STDMETHODCALLTYPE Init(
  32. /*[in]*/ IDirectMusicSegment* pSegment
  33. );
  34. virtual HRESULT STDMETHODCALLTYPE InitPlay(
  35. /*[in]*/ IDirectMusicTrack* pParentrack,
  36. /*[in]*/ IDirectMusicSegmentState* pSegmentState,
  37. /*[in]*/ IDirectMusicPerformance* pPerformance,
  38. /*[out]*/ void** ppStateData,
  39. /*[in]*/ DWORD dwTrackID,
  40. /*[in]*/ DWORD dwFlags
  41. );
  42. CDirectMusicPattern* m_pPattern; // The motif's pattern
  43. };
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CMotifTrack
  46. class CMotifTrack :
  47. public IMotifTrack,
  48. public IDirectMusicTrack8,
  49. public IPersistStream
  50. {
  51. public:
  52. CMotifTrack();
  53. CMotifTrack(const CMotifTrack& rTrack, MUSIC_TIME mtStart, MUSIC_TIME mtEnd);
  54. ~CMotifTrack();
  55. // IUnknown
  56. //
  57. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  58. virtual STDMETHODIMP_(ULONG) AddRef();
  59. virtual STDMETHODIMP_(ULONG) Release();
  60. // IMotifTrack
  61. public:
  62. // IMotifTrack Methods
  63. HRESULT STDMETHODCALLTYPE Init(
  64. /*[in]*/ IDirectMusicSegment* pSegment
  65. );
  66. HRESULT STDMETHODCALLTYPE InitPlay(
  67. /*[in]*/ IDirectMusicSegmentState* pSegmentState,
  68. /*[in]*/ IDirectMusicPerformance* pPerformance,
  69. /*[out]*/ void** ppStateData,
  70. /*[in]*/ DWORD dwTrackID,
  71. /*[in]*/ DWORD dwFlags
  72. );
  73. HRESULT STDMETHODCALLTYPE EndPlay(
  74. /*[in]*/ void* pStateData
  75. );
  76. HRESULT STDMETHODCALLTYPE Play(
  77. /*[in]*/ void* pStateData,
  78. /*[in]*/ MUSIC_TIME mtStart,
  79. /*[in]*/ MUSIC_TIME mtEnd,
  80. /*[in]*/ MUSIC_TIME mtOffset,
  81. DWORD dwFlags,
  82. IDirectMusicPerformance* pPerf,
  83. IDirectMusicSegmentState* pSegState,
  84. DWORD dwVirtualID
  85. );
  86. HRESULT STDMETHODCALLTYPE GetPriority(
  87. /*[out]*/ DWORD* pPriority
  88. );
  89. HRESULT STDMETHODCALLTYPE GetParam(
  90. REFGUID rCommandGuid,
  91. MUSIC_TIME mtTime,
  92. MUSIC_TIME* pmtNext,
  93. void *pData);
  94. HRESULT STDMETHODCALLTYPE SetParam(
  95. /* [in] */ REFGUID pCommandGuid,
  96. /* [in] */ MUSIC_TIME mtTime,
  97. /* [out] */ void __RPC_FAR *pData);
  98. HRESULT STDMETHODCALLTYPE AddNotificationType(
  99. /* [in] */ REFGUID pGuidNotify
  100. );
  101. HRESULT STDMETHODCALLTYPE RemoveNotificationType(
  102. /* [in] */ REFGUID pGuidNotify
  103. );
  104. HRESULT STDMETHODCALLTYPE Clone(
  105. MUSIC_TIME mtStart,
  106. MUSIC_TIME mtEnd,
  107. IDirectMusicTrack** ppTrack);
  108. HRESULT STDMETHODCALLTYPE IsParamSupported(
  109. /*[in]*/ REFGUID pGuid
  110. );
  111. // IDirectMusicTrack8 Methods
  112. STDMETHODIMP PlayEx(void* pStateData,REFERENCE_TIME rtStart,
  113. REFERENCE_TIME rtEnd,REFERENCE_TIME rtOffset,
  114. DWORD dwFlags,IDirectMusicPerformance* pPerf,
  115. IDirectMusicSegmentState* pSegSt,DWORD dwVirtualID) ;
  116. STDMETHODIMP GetParamEx(REFGUID rguidType,REFERENCE_TIME rtTime,
  117. REFERENCE_TIME* prtNext,void* pParam,void * pStateData, DWORD dwFlags) ;
  118. STDMETHODIMP SetParamEx(REFGUID rguidType,REFERENCE_TIME rtTime,void* pParam, void * pStateData, DWORD dwFlags) ;
  119. STDMETHODIMP Compose(IUnknown* pContext,
  120. DWORD dwTrackGroup,
  121. IDirectMusicTrack** ppResultTrack) ;
  122. STDMETHODIMP Join(IDirectMusicTrack* pNewTrack,
  123. MUSIC_TIME mtJoin,
  124. IUnknown* pContext,
  125. DWORD dwTrackGroup,
  126. IDirectMusicTrack** ppResultTrack) ;
  127. // IPersist methods
  128. HRESULT STDMETHODCALLTYPE GetClassID( LPCLSID pclsid );
  129. // IPersistStream methods
  130. HRESULT STDMETHODCALLTYPE IsDirty();
  131. HRESULT STDMETHODCALLTYPE Save( LPSTREAM pStream, BOOL fClearDirty );
  132. HRESULT STDMETHODCALLTYPE GetSizeMax( ULARGE_INTEGER* /*pcbSize*/ );
  133. HRESULT STDMETHODCALLTYPE Load( LPSTREAM pStream );
  134. HRESULT STDMETHODCALLTYPE SetTrack(IUnknown *pStyle, void* pPattern);
  135. // IMotifTrack data members
  136. protected:
  137. // new internal play method
  138. HRESULT STDMETHODCALLTYPE Play(
  139. /*[in]*/ void* pStateData,
  140. /*[in]*/ MUSIC_TIME mtStart,
  141. /*[in]*/ MUSIC_TIME mtEnd,
  142. /*[in]*/ MUSIC_TIME mtOffset,
  143. REFERENCE_TIME rtOffset,
  144. DWORD dwFlags,
  145. IDirectMusicPerformance* pPerf,
  146. IDirectMusicSegmentState* pSegState,
  147. DWORD dwVirtualID,
  148. BOOL fClockTime
  149. );
  150. // attributes
  151. long m_cRef;
  152. CRITICAL_SECTION m_CriticalSection; // for load and playback
  153. BOOL m_fCSInitialized;
  154. PatternTrackInfo* m_pTrackInfo;
  155. BYTE m_bRequiresSave;
  156. };
  157. struct MotifTrackState : public PatternTrackState
  158. {
  159. MotifTrackState();
  160. ~MotifTrackState();
  161. // methods
  162. HRESULT Play(
  163. /*[in]*/ MUSIC_TIME mtStart,
  164. /*[in]*/ MUSIC_TIME mtEnd,
  165. /*[in]*/ MUSIC_TIME mtOffset,
  166. REFERENCE_TIME rtOffset,
  167. IDirectMusicPerformance* pPerformance,
  168. DWORD dwFlags,
  169. BOOL fClockTime
  170. );
  171. // attributes
  172. MUSIC_TIME m_mtMotifStart; // When the motif started relative to
  173. // its primary segment
  174. };
  175. #endif //__MOTIFTRACK_H_