00001 /* 00002 * @(#)Track.h 3.00 17 May 1999 00003 * 00004 * Copyright (c) 2000 Pete Goodliffe (pete@cthree.org) 00005 * 00006 * This file is part of TSE3 - the Trax Sequencer Engine version 3.00. 00007 * 00008 * This library is modifiable/redistributable under the terms of the GNU 00009 * General Public License. 00010 * 00011 * You should have received a copy of the GNU General Public License along 00012 * with this program; see the file COPYING. If not, write to the Free Software 00013 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00014 * 00015 */ 00016 00017 #ifndef TSE3_TRACK_H 00018 #define TSE3_TRACK_H 00019 00020 #include "tse3/listen/Track.h" 00021 00022 #include "tse3/Notifier.h" 00023 #include "tse3/Playable.h" 00024 #include "tse3/Serializable.h" 00025 #include "tse3/listen/Part.h" 00026 #include "tse3/listen/DisplayParams.h" 00027 00028 #include <string> 00029 #include <cstddef> 00030 00031 namespace TSE3 00032 { 00033 class Song; 00034 class MidiFilter; 00035 class MidiParams; 00036 00072 class Track : public Listener<PartListener>, 00073 public Listener<DisplayParamsListener>, 00074 public Playable, 00075 public Serializable, 00076 public Notifier<TrackListener> 00077 { 00078 00079 public: 00080 00081 Track(); 00082 virtual ~Track(); 00083 00090 const std::string &title() const; 00091 00098 void setTitle(const std::string &s); 00099 00106 MidiFilter *filter(); 00107 00113 MidiParams *params(); 00114 00120 DisplayParams *displayParams(); 00121 00129 Song *parent() const; 00130 00136 size_t size() const; 00137 00148 Part *operator[](size_t n) const; 00149 00164 Part *insert(Clock start, Clock end); 00165 00186 void insert(Part *part); 00187 00199 void remove(Part *part); 00200 00211 void remove(size_t index); 00212 00221 size_t numPartsBetween(Clock start, Clock end); 00222 00226 int operator<(const Track &t) const; 00227 00237 size_t index(Clock c) const; 00238 00246 size_t index(Part *part) const; 00247 00251 virtual void Notifier_Deleted(Part *); 00252 00256 virtual PlayableIterator *iterator(Clock index); 00257 00261 virtual Clock lastClock() const; 00262 00266 virtual void save(std::ostream &o, int i) const; 00267 00271 virtual void load(std::istream &in, SerializableLoadInfo &info); 00272 00276 virtual void DisplayParams_Altered(DisplayParams *); 00277 00282 friend class Song; 00283 00284 private: 00285 00286 Track &operator=(const Track &); 00287 Track(const Track &); 00288 00300 void setParentSong(Song *parent); 00301 00316 void prvInsertPart(Part *part); 00317 00318 class TrackImpl *pimpl; 00319 }; 00320 } 00321 00322 #endif