00001 /* 00002 * @(#)app/Record.h 1.00 18 June 2000 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_APPLICATION_RECORD_H 00018 #define TSE3_APPLICATION_RECORD_H 00019 00020 #include "tse3/listen/app/Record.h" 00021 00022 #include "tse3/Notifier.h" 00023 #include "tse3/Midi.h" 00024 #include "tse3/listen/Transport.h" 00025 00026 #include <string> 00027 00028 namespace TSE3 00029 { 00030 class PhraseEdit; 00031 class Track; 00032 class Song; 00033 class Transport; 00034 class MidiScheduler; 00035 00036 namespace Cmd 00037 { 00038 class CommandHistory; 00039 }; 00040 00041 namespace App 00042 { 00065 class Record : public TSE3::Listener<TransportListener>, 00066 public TSE3::Notifier<RecordListener> 00067 { 00068 public: 00069 00077 Record(TSE3::Transport *transport); 00078 00082 ~Record(); 00083 00106 void start(TSE3::Song *p, TSE3::Track *t); 00107 00132 void stop(); 00133 00138 TSE3::Clock startTime() const { return _startTime; } 00139 00144 TSE3::Clock endTime() const { return _endTime; } 00145 00150 TSE3::PhraseEdit *phraseEdit() const { return _phraseEdit; } 00151 00177 void insertPhrase(const std::string &title, 00178 bool replacePhrase, 00179 bool insertPart, 00180 int insertAction, 00181 TSE3::Cmd::CommandHistory *history = 0); 00182 00194 void reset(); 00195 00199 void Transport_Status(TSE3::Transport *, int status); 00200 00201 protected: 00202 00203 TSE3::Transport *_transport; 00204 00205 TSE3::PhraseEdit *_phraseEdit; 00206 TSE3::Song *_song; 00207 TSE3::Track *_track; 00208 00209 TSE3::Clock _startTime; 00210 TSE3::Clock _endTime; 00211 bool recording; 00212 }; 00213 } 00214 } 00215 00216 #endif