00001 /* 00002 * @(#)Panic.h 3.00 21 June 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_PANIC_H 00018 #define TSE3_PANIC_H 00019 00020 #include "tse3/listen/Panic.h" 00021 00022 #include "tse3/Notifier.h" 00023 #include "tse3/Midi.h" 00024 #include "tse3/Playable.h" 00025 #include "tse3/Serializable.h" 00026 00027 namespace TSE3 00028 { 00047 class Panic : public Playable, 00048 public Notifier<PanicListener> 00049 { 00050 public: 00051 00058 Panic(); 00059 virtual ~Panic(); 00060 00072 bool status() const { return _status; } 00073 00080 void setStatus(bool s); 00081 00088 int port() const { return _port; } 00089 00096 void setPort(int port); 00097 00098 /* 00099 * Various MIDI protocol reset messages 00100 */ 00101 00108 bool midiReset() const { return _midi; } 00109 00116 void setMidiReset(bool s); 00117 00124 bool gmReset() const { return _gm; } 00125 00132 void setGmReset(bool s); 00133 00140 bool gsReset() const { return _gs; } 00141 00148 void setGsReset(bool s); 00149 00156 bool xgReset() const { return _xg; } 00157 00164 void setXgReset(bool s); 00165 00173 bool gsIDMask(size_t device) const; 00174 00181 void setGsIDMask(size_t device, bool s); 00182 00190 bool xgIDMask(size_t device) const; 00191 00198 void setXgIDMask(size_t device, bool s); 00199 00200 /* 00201 * MIDI protocol messages. 00202 */ 00203 00210 bool allNotesOff() { return _allNotesOff; } 00211 00218 void setAllNotesOff(bool s); 00219 00226 bool allNotesOffManually() { return _allNotesOffManually; } 00227 00235 void setAllNotesOffManually(bool s); 00236 00243 bool allModsOff() { return _allModsOff; } 00244 00251 void setAllModsOff(bool s); 00252 00259 bool allPitchOff() { return _allPitchOff; } 00260 00267 void setAllPitchOff(bool s); 00268 00275 bool allCtrlOff() { return _allCtrlOff; } 00276 00283 void setAllCtrlOff(bool s); 00284 00291 bool liftSustain() { return _liftSustain; } 00292 00299 void setLiftSustain(bool s); 00300 00304 virtual PlayableIterator *iterator(Clock index); 00305 00309 virtual Clock lastClock() const; 00310 00311 protected: 00312 00313 bool _status; 00314 00315 int _port; 00316 00317 // Various MIDI protocol resets 00318 bool _midi, _gm, _gs, _xg; 00319 unsigned int gsMask, xgMask; 00320 00321 // MIDI protocol messages 00322 bool _allNotesOff; 00323 bool _allNotesOffManually; 00324 bool _allModsOff; 00325 bool _allPitchOff; 00326 bool _allCtrlOff; 00327 bool _liftSustain; 00328 00329 private: 00330 00331 Panic &operator=(const Panic &); 00332 Panic(const Panic &); 00333 }; 00334 } 00335 00336 #endif