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.

99 lines
3.3 KiB

  1. //MarkTrk.h : Declaration of the marker track
  2. #ifndef __MARKTRK_H_
  3. #define __MARKTRK_H_
  4. #include "dmusici.h"
  5. #include "dmusicf.h"
  6. #include "alist.h"
  7. class CValidStartItem : public AListItem
  8. {
  9. public:
  10. CValidStartItem* GetNext(){ return (CValidStartItem*)AListItem::GetNext(); };
  11. DMUS_IO_VALID_START m_ValidStart;
  12. };
  13. class CValidStartList : public AList
  14. {
  15. public:
  16. CValidStartItem* GetHead() {return (CValidStartItem*)AList::GetHead();};
  17. CValidStartItem* RemoveHead() {return (CValidStartItem*)AList::RemoveHead();};
  18. CValidStartItem* GetItem(LONG lIndex) { return (CValidStartItem*) AList::GetItem(lIndex);};
  19. };
  20. class CPlayMarkerItem : public AListItem
  21. {
  22. public:
  23. CPlayMarkerItem* GetNext(){ return (CPlayMarkerItem*)AListItem::GetNext(); };
  24. DMUS_IO_PLAY_MARKER m_PlayMarker;
  25. };
  26. class CPlayMarkerList : public AList
  27. {
  28. public:
  29. CPlayMarkerItem* GetHead() {return (CPlayMarkerItem*)AList::GetHead();};
  30. CPlayMarkerItem* RemoveHead() {return (CPlayMarkerItem*)AList::RemoveHead();};
  31. CPlayMarkerItem* GetItem(LONG lIndex) { return (CPlayMarkerItem*) AList::GetItem(lIndex);};
  32. };
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CMarkerTrack
  35. class CMarkerTrack :
  36. public IPersistStream,
  37. public IDirectMusicTrack
  38. {
  39. public:
  40. CMarkerTrack();
  41. CMarkerTrack(CMarkerTrack *pTrack, MUSIC_TIME mtStart, MUSIC_TIME mtEnd);
  42. ~CMarkerTrack();
  43. // member variables
  44. protected:
  45. CValidStartList m_ValidStartList;
  46. CPlayMarkerList m_PlayMarkerList;
  47. long m_cRef;
  48. DWORD m_dwValidate; // used to validate state data.
  49. CRITICAL_SECTION m_CrSec;
  50. BOOL m_fCSInitialized;
  51. public:
  52. // IUnknown
  53. STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
  54. STDMETHODIMP_(ULONG) AddRef();
  55. STDMETHODIMP_(ULONG) Release();
  56. // IDirectMusicTrack methods
  57. STDMETHODIMP IsParamSupported(REFGUID rguid);
  58. STDMETHODIMP Init(IDirectMusicSegment *pSegment);
  59. STDMETHODIMP InitPlay(IDirectMusicSegmentState *pSegmentState,
  60. IDirectMusicPerformance *pPerformance,
  61. void **ppStateData,
  62. DWORD dwTrackID,
  63. DWORD dwFlags);
  64. STDMETHODIMP EndPlay(void *pStateData);
  65. STDMETHODIMP Play(void *pStateData,MUSIC_TIME mtStart,
  66. MUSIC_TIME mtEnd,MUSIC_TIME mtOffset,
  67. DWORD dwFlags,IDirectMusicPerformance* pPerf,
  68. IDirectMusicSegmentState* pSegSt,DWORD dwVirtualID);
  69. STDMETHODIMP GetParam(REFGUID rguid,MUSIC_TIME mtTime,MUSIC_TIME* pmtNext,void *pData);
  70. STDMETHODIMP SetParam(REFGUID rguid,MUSIC_TIME mtTime,void *pData);
  71. STDMETHODIMP AddNotificationType(REFGUID rguidNotification);
  72. STDMETHODIMP RemoveNotificationType(REFGUID rguidNotification);
  73. STDMETHODIMP Clone(MUSIC_TIME mtStart,MUSIC_TIME mtEnd,IDirectMusicTrack** ppTrack);
  74. // IPersist functions
  75. STDMETHODIMP GetClassID( CLSID* pClsId );
  76. // IPersistStream functions
  77. STDMETHODIMP IsDirty();
  78. STDMETHODIMP Load( IStream* pIStream );
  79. STDMETHODIMP Save( IStream* pIStream, BOOL fClearDirty );
  80. STDMETHODIMP GetSizeMax( ULARGE_INTEGER FAR* pcbSize );
  81. protected:
  82. void Construct(void);
  83. void Clear();
  84. HRESULT LoadValidStartList( CRiffParser *pParser, long lChunkSize );
  85. HRESULT LoadPlayMarkerList( CRiffParser *pParser, long lChunkSize );
  86. protected:
  87. };
  88. #endif //__MARKTRK_H_