Source code of Windows XP (NT5)
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.

156 lines
4.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) 1998-1999 Microsoft Corporation
  6. //
  7. // File: spsttrk.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // SPstTrk.h : Declaration of the CSPstTrk
  11. #ifndef __SPSTTRK_H_
  12. #define __SPSTTRK_H_
  13. #include "dmusici.h"
  14. #include "DMCompos.h"
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CSPstTrk
  17. class CSPstTrk :
  18. public IPersistStream,
  19. public IDirectMusicTrack8
  20. {
  21. public:
  22. CSPstTrk();
  23. CSPstTrk(const CSPstTrk& rTrack, MUSIC_TIME mtStart, MUSIC_TIME mtEnd);
  24. ~CSPstTrk();
  25. // ISPstTrk
  26. public:
  27. // IUnknown
  28. //
  29. virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  30. virtual STDMETHODIMP_(ULONG) AddRef();
  31. virtual STDMETHODIMP_(ULONG) Release();
  32. // ICommandTrack Methods
  33. HRESULT STDMETHODCALLTYPE Init(
  34. /*[in]*/ IDirectMusicSegment* pSegment
  35. );
  36. HRESULT STDMETHODCALLTYPE InitPlay(
  37. /*[in]*/ IDirectMusicSegmentState* pSegmentState,
  38. /*[in]*/ IDirectMusicPerformance* pPerformance,
  39. /*[out]*/ void** ppStateData,
  40. /*[in]*/ DWORD dwTrackID,
  41. /*[in]*/ DWORD dwFlags
  42. );
  43. HRESULT STDMETHODCALLTYPE EndPlay(
  44. /*[in]*/ void* pStateData
  45. );
  46. HRESULT STDMETHODCALLTYPE Play(
  47. /*[in]*/ void* pStateData,
  48. /*[in]*/ MUSIC_TIME mtStart,
  49. /*[in]*/ MUSIC_TIME mtEnd,
  50. /*[in]*/ MUSIC_TIME mtOffset,
  51. DWORD dwFlags,
  52. IDirectMusicPerformance* pPerf,
  53. IDirectMusicSegmentState* pSegState,
  54. DWORD dwVirtualID
  55. );
  56. HRESULT STDMETHODCALLTYPE GetPriority(
  57. /*[out]*/ DWORD* pPriority
  58. );
  59. HRESULT STDMETHODCALLTYPE GetParam(
  60. REFGUID rCommandGuid,
  61. MUSIC_TIME mtTime,
  62. MUSIC_TIME* pmtNext,
  63. void* pData
  64. );
  65. HRESULT STDMETHODCALLTYPE SetParam(
  66. /* [in] */ REFGUID rCommandGuid,
  67. /* [in] */ MUSIC_TIME mtTime,
  68. /* [out] */ void __RPC_FAR *pData);
  69. HRESULT STDMETHODCALLTYPE AddNotificationType(
  70. /* [in] */ REFGUID rGuidNotify
  71. );
  72. HRESULT STDMETHODCALLTYPE RemoveNotificationType(
  73. /* [in] */ REFGUID rGuidNotify
  74. );
  75. HRESULT STDMETHODCALLTYPE Clone(
  76. MUSIC_TIME mtStart,
  77. MUSIC_TIME mtEnd,
  78. IDirectMusicTrack** ppTrack);
  79. // IDirectMusicCommon Methods
  80. HRESULT STDMETHODCALLTYPE GetName(
  81. /*[out]*/ BSTR* pbstrName
  82. );
  83. HRESULT STDMETHODCALLTYPE IsParamSupported(
  84. /*[in]*/ REFGUID rGuid
  85. );
  86. // IPersist methods
  87. HRESULT STDMETHODCALLTYPE GetClassID( LPCLSID pclsid );
  88. // IPersistStream methods
  89. HRESULT STDMETHODCALLTYPE IsDirty();
  90. HRESULT STDMETHODCALLTYPE Save( LPSTREAM pStream, BOOL fClearDirty );
  91. HRESULT STDMETHODCALLTYPE GetSizeMax( ULARGE_INTEGER* /*pcbSize*/ );
  92. HRESULT STDMETHODCALLTYPE Load( LPSTREAM pStream );
  93. // IDirectMusicTrack8 Methods
  94. STDMETHODIMP PlayEx(void* pStateData,REFERENCE_TIME rtStart,
  95. REFERENCE_TIME rtEnd,REFERENCE_TIME rtOffset,
  96. DWORD dwFlags,IDirectMusicPerformance* pPerf,
  97. IDirectMusicSegmentState* pSegSt,DWORD dwVirtualID) ;
  98. STDMETHODIMP GetParamEx(REFGUID rguidType,REFERENCE_TIME rtTime,
  99. REFERENCE_TIME* prtNext,void* pParam,void * pStateData, DWORD dwFlags) ;
  100. STDMETHODIMP SetParamEx(REFGUID rguidType,REFERENCE_TIME rtTime,void* pParam, void * pStateData, DWORD dwFlags) ;
  101. STDMETHODIMP Compose(IUnknown* pContext,
  102. DWORD dwTrackGroup,
  103. IDirectMusicTrack** ppResultTrack) ;
  104. STDMETHODIMP Join(IDirectMusicTrack* pNewTrack,
  105. MUSIC_TIME mtJoin,
  106. IUnknown* pContext,
  107. DWORD dwTrackGroup,
  108. IDirectMusicTrack** ppResultTrack) ;
  109. protected:
  110. // internal methods
  111. HRESULT SendNotification(MUSIC_TIME mtTime,
  112. IDirectMusicPerformance* pPerf,
  113. IDirectMusicSegment* pSegment,
  114. IDirectMusicSegmentState* pSegState,
  115. DWORD dwFlags);
  116. void Clear();
  117. // attributes
  118. long m_cRef;
  119. TList<DMSignPostStruct> m_SignPostList;
  120. CRITICAL_SECTION m_CriticalSection; // for load and SetParam
  121. BOOL m_fCSInitialized;
  122. IDirectMusicPerformance* m_pPerformance; // is this necessary?
  123. CDMCompos* m_pComposer; // for Segment Recompose on loop
  124. // IDirectMusicSegment* m_pSegment;
  125. BOOL m_fNotifyRecompose;
  126. BYTE m_bRequiresSave;
  127. };
  128. #endif //__SPSTTRK_H_