00001 /* 00002 * @(#)ins/Destination.h 3.00 21 August 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_INS_DESTINATION_H 00018 #define TSE3_INS_DESTINATION_H 00019 00020 #include "tse3/listen/ins/Destination.h" 00021 00022 #include "tse3/Notifier.h" 00023 00024 #include <string> 00025 #include <cstddef> 00026 00027 namespace TSE3 00028 { 00029 namespace Ins 00030 { 00059 class Destination : public TSE3::Notifier<DestinationListener> 00060 { 00061 public: 00062 00068 Destination(); 00069 ~Destination(); 00070 00071 /************************************************************** 00072 * Managing the list of destinations 00073 *************************************************************/ 00074 00086 Instrument *defaultInstrument() const; 00087 00094 void setDefaultInstrument(Instrument *instrument); 00095 00107 bool allChannels(int port); 00108 00126 Instrument *port(int port); 00127 00142 void setPort(int port, Instrument *instrument); 00143 00161 Instrument *channel(int channel, int port); 00162 00179 void setChannel(int channel, int port, 00180 Instrument *instrument); 00181 00182 /************************************************************** 00183 * Managing the list of instruments 00184 *************************************************************/ 00185 00190 size_t numInstruments() const; 00191 00202 Instrument *instrument(size_t index); 00203 00211 Instrument *instrument(const std::string &title); 00212 00226 void addInstrument(Instrument *instrument); 00227 00239 void removeInstrument(Instrument *instrument); 00240 00241 private: 00242 00243 Destination(const Destination &); 00244 Destination &operator=(const Destination &); 00245 00246 class DestinationImpl *pimpl; 00247 00248 size_t index(int port, int channel) 00249 { 00250 return (port*16) + channel; 00251 } 00252 }; 00253 } 00254 } 00255 00256 #endif