00001 /* 00002 * @(#)Song.h 3.00 26 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_SONG_H 00018 #define TSE3_SONG_H 00019 00020 #include "tse3/listen/Song.h" 00021 00022 #include "tse3/Notifier.h" 00023 #include "tse3/Playable.h" 00024 #include "tse3/Serializable.h" 00025 #include "tse3/listen/Track.h" 00026 00027 #include <string> 00028 #include <cstddef> 00029 00030 namespace TSE3 00031 { 00032 class TempoTrack; 00033 class TimeSigTrack; 00034 class KeySigTrack; 00035 class PhraseList; 00036 class FlagTrack; 00037 00072 class Song : public Playable, 00073 public Listener<TrackListener>, 00074 public Serializable, 00075 public Notifier<SongListener> 00076 { 00077 public: 00078 00082 static const int defaultNoTracks = 16; 00083 00091 Song(int noTracks = defaultNoTracks); 00092 virtual ~Song(); 00093 00099 PhraseList *phraseList(); 00100 00106 TempoTrack *tempoTrack(); 00107 00113 TimeSigTrack *timeSigTrack(); 00114 00120 KeySigTrack *keySigTrack(); 00121 00127 FlagTrack *flagTrack(); 00128 00135 const std::string &title() const; 00136 00143 void setTitle(const std::string &s); 00144 00151 const std::string &author() const; 00152 00159 void setAuthor(const std::string &s); 00160 00167 const std::string ©right() const; 00168 00175 void setCopyright(const std::string &s); 00176 00183 const std::string &date() const; 00184 00191 void setDate(const std::string &s); 00192 00198 size_t size() const; 00199 00210 Track *operator[](size_t n) const; 00211 00219 size_t index(Track *track) const; 00220 00233 Track *insert(int n = -1); 00234 00250 void insert(Track *track, int n = -1); 00251 00258 void remove(size_t n); 00259 00265 void remove(Track *track); 00266 00277 int soloTrack() const; 00278 00285 void setSoloTrack(int t); 00286 00300 bool repeat() const; 00301 00308 void setRepeat(bool status); 00309 00319 Clock from() const; 00320 00327 void setFrom(Clock from); 00328 00338 Clock to() const; 00339 00346 void setTo(Clock to); 00347 00351 virtual void Track_PartInserted(Track *, Part *); 00352 00356 virtual void Track_PartRemoved(Track *, Part *); 00357 00361 virtual void Notifier_Deleted(Track *); 00362 00366 virtual PlayableIterator *iterator(Clock index); 00367 00373 virtual Clock lastClock() const; 00374 00384 virtual void save(std::ostream &o, int i) const; 00385 00395 virtual void load(std::istream &in, SerializableLoadInfo &info); 00396 00397 private: 00398 00399 Song &operator=(const Song &); 00400 Song(const Song &); 00401 00402 void recalculateLastClock() const; 00403 00404 class SongImpl *pimpl; 00405 }; 00406 } 00407 00408 #endif