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.

159 lines
4.7 KiB

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