00001 /* 00002 * @(#)FlagTrack.h 3.00 19 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_FLAGTRACK_H 00018 #define TSE3_FLAGTRACK_H 00019 00020 #include "tse3/listen/FlagTrack.h" 00021 00022 #include "tse3/Notifier.h" 00023 #include "tse3/Serializable.h" 00024 #include "tse3/EventTrack.h" 00025 00026 #include <string> 00027 00028 namespace TSE3 00029 { 00043 class Flag 00044 { 00045 public: 00046 00050 Flag() {} 00051 00057 Flag(const std::string &t) : _title(t) {} 00058 00062 const std::string &title() const { return _title; } 00063 00064 int operator==(const Flag &f) const 00065 { 00066 return _title == f._title; 00067 } 00068 00069 private: 00070 00071 std::string _title; 00072 }; 00073 00093 class FlagTrack : public EventTrack<Flag>, 00094 public Serializable 00095 { 00096 public: 00097 00101 FlagTrack(); 00102 00103 virtual ~FlagTrack(); 00104 00108 virtual PlayableIterator *iterator(Clock index); 00109 00113 virtual Clock lastClock() const; 00114 00118 virtual void save(std::ostream &o, int i) const; 00119 00123 virtual void load(std::istream &i, SerializableLoadInfo &info); 00124 00125 private: 00126 00127 FlagTrack &operator=(const FlagTrack &); 00128 FlagTrack(const FlagTrack &); 00129 00133 void loadEvents(std::istream &i, int filePPQN); 00134 }; 00135 } 00136 00137 #endif