00001 #ifndef __CMidiSequence__ 00002 #define __CMidiSequence__ 00003 00004 // =========================================================================== 00005 00006 #include <Collections/TCountedPointerArray.hpp> 00007 #include <Basics/CSystemString.hpp> 00008 #include "CMidiTrack.hpp" 00009 #include "../Music/CTimeSignature.hpp" 00010 using Exponent::Collections::TCountedPointerArray; 00011 using Exponent::Basics::CSystemString; 00012 using Exponent::Midi::CMidiTrack; 00013 using Exponent::Music::CTimeSignature; 00014 00015 // =========================================================================== 00016 00017 namespace Exponent 00018 { 00019 namespace Midi 00020 { 00046 class CMidiSequence : public CCountedObject 00047 { 00049 EXPONENT_CLASS_DECLARATION; 00052 // =========================================================================== 00053 00054 public: 00055 00056 // =========================================================================== 00057 00062 CMidiSequence(const double sampleRate); 00063 00067 virtual ~CMidiSequence(); 00068 00069 // =========================================================================== 00070 00075 void addTrack(CMidiTrack *track); 00076 00081 void setSampleRate(const double sampleRate); 00082 00087 void setTempo(const double tempo); 00088 00093 void setTimeSignature(const CTimeSignature &timeSignature); 00094 00095 // =========================================================================== 00096 00101 double getSampleRate() const { return m_sampleRate; } 00102 00107 double getTempo() const { return m_tempo; } 00108 00113 const CTimeSignature &getTimeSignature() const { return m_timeSignature; } 00114 00119 long getNumberOfTracks() const { return m_tracks.getArraySize(); } 00120 00126 const CMidiTrack *getTrackAtIndex(const long index) const; 00127 00133 CMidiTrack *getMutableTrackAtIndex(const long index); 00134 00135 // =========================================================================== 00136 00140 void compact(); 00141 00142 // =========================================================================== 00143 00144 protected: 00145 00146 // =========================================================================== 00147 00148 TCountedPointerArray<CMidiTrack> m_tracks; 00149 double m_tempo; 00150 CTimeSignature m_timeSignature; 00151 double m_sampleRate; 00152 }; 00153 } 00154 } 00155 #endif // End of CMidiSequence.hpp