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.

169 lines
5.0 KiB

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