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.

79 lines
2.3 KiB

  1. // Copyright (c) 1998-1999 Microsoft Corporation
  2. //////////////////////////////////////////////////////////////////////
  3. // TrkList.h
  4. #include "alist.h"
  5. #include "dmusici.h"
  6. #include "debug.h"
  7. #define ASSERT assert
  8. #ifndef __TRACKLIST_H_
  9. #define __TRACKLIST_H_
  10. #define TRACKINTERNAL_START_PADDED 0x1
  11. #define TRACKINTERNAL_END_PADDED 0x2
  12. class CSegment;
  13. class CTrack : public AListItem
  14. {
  15. public:
  16. CTrack();
  17. ~CTrack();
  18. CTrack* GetNext()
  19. {
  20. return (CTrack*)AListItem::GetNext();
  21. };
  22. bool Less(CTrack* pCTrack)
  23. {
  24. // Give the sysex track priority over any other track at the same position,
  25. // and the band track priority over any track but the sysex track.
  26. return
  27. ( m_dwPosition < pCTrack->m_dwPosition ||
  28. (m_dwPosition == pCTrack->m_dwPosition &&
  29. m_guidClassID == CLSID_DirectMusicSysExTrack) ||
  30. (m_dwPosition == pCTrack->m_dwPosition &&
  31. m_guidClassID == CLSID_DirectMusicBandTrack &&
  32. pCTrack->m_guidClassID != CLSID_DirectMusicSysExTrack) );
  33. }
  34. public:
  35. CLSID m_guidClassID; // Class ID of track.
  36. IDirectMusicTrack* m_pTrack; // Standard track interface.
  37. IDirectMusicTrack8* m_pTrack8; // Extra DX8 functions.
  38. void* m_pTrackState; // state pointer returned by IDirectMusicTrack::InitPerformance
  39. BOOL m_bDone;
  40. DWORD m_dwVirtualID; // only valid inside segment states
  41. DWORD m_dwGroupBits;
  42. DWORD m_dwPriority; // Track priority, to order the composition process.
  43. DWORD m_dwPosition; // Track position, to determine the Play order.
  44. DWORD m_dwFlags; // DMUS_TRACKCONFIG_ flags.
  45. DWORD m_dwInternalFlags; // TRACKINTERNAL_ flags.
  46. };
  47. class CTrackList : public AList
  48. {
  49. public:
  50. CTrack* GetHead()
  51. {
  52. return (CTrack*)AList::GetHead();
  53. };
  54. CTrack* RemoveHead()
  55. {
  56. return (CTrack*)AList::RemoveHead();
  57. };
  58. CTrack* GetItem(LONG lIndex)
  59. {
  60. return (CTrack*) AList::GetItem(lIndex);
  61. };
  62. void Clear(void)
  63. {
  64. CTrack* pTrack;
  65. while( pTrack = RemoveHead() )
  66. {
  67. delete pTrack;
  68. }
  69. }
  70. HRESULT CreateCopyWithBlankState(CTrackList* pTrackList);
  71. };
  72. #endif // __TRACKLIST_H_