00001 /* 00002 * @(#)MidiData.h 3.00 14 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_MIDIDATA_H 00018 #define TSE3_MIDIDATA_H 00019 00020 #include "tse3/listen/MidiData.h" 00021 00022 #include "tse3/Notifier.h" 00023 #include "tse3/Midi.h" 00024 #include "tse3/Playable.h" 00025 00026 #include <vector> 00027 #include <cstddef> 00028 00029 namespace TSE3 00030 { 00054 class MidiData : public Playable, 00055 public Notifier<MidiDataListener> 00056 { 00057 public: 00058 00064 size_t size() const { return data.size(); } 00065 00076 MidiEvent const &operator[](size_t n) const { return data[n]; } 00077 00087 size_t index(Clock c) const; 00088 00092 virtual PlayableIterator *iterator(Clock index); 00093 00097 virtual Clock lastClock() const; 00098 00099 protected: 00100 00105 MidiData(int noEvents); 00106 virtual ~MidiData() = 0; 00107 MidiData &operator=(const MidiData &); 00108 MidiData(const MidiData &); 00109 00110 std::vector<MidiEvent> data; 00111 00112 friend class PhraseEdit; 00113 }; 00114 } 00115 00116 #endif