//------------------------------------------------------------------------- // Filename: program2device.hh // Version: $Id: program2device.hh,v 1.1.2.2 1999/06/09 10:14:03 erik Exp $ // Copyright: Copyright (C) 1999, Erik Mouw (J.A.K.Mouw@its.tudelft.nl) // Author: Erik Mouw // Description: Map a program to a certain device // Created at: Sun May 23 15:57:12 1999 // Modified by: Erik Mouw // Modified at: Wed Jun 9 12:10:54 1999 //------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #ident "$Id: program2device.hh,v 1.1.2.2 1999/06/09 10:14:03 erik Exp $" #ifndef musica_program2device_hh #define musica_program2device_hh #include "mididevice.hh" class midiProgram2Device : virtual public midiDevice { protected: // each track has a current program int channelMap[numMidiChannels]; // and each program has a device on which it is played best // for example: a piano is best played on a Roland digital piano midiDevice *deviceMap[numMaxMidiPrograms]; public: midiProgram2Device(const char *theName); virtual ~midiProgram2Device(void); void setDevice(int program, midiDevice *device); void setAllDevices(midiDevice *device); midiDevice *getDevice(int program); // fill in virtual functions virtual bool open(void); virtual bool close(void); virtual void noteOn(int channel, int key, int velocity); virtual void noteOff(int channel, int key, int velocity); virtual void keyPressure(int channel, int key, int pressure); virtual void channelPressure(int channel, int pressure); virtual void pitchBend(int channel, int fine, int coarse); virtual void controlChange(int channel, int controller, int value); virtual void programChange(int channel, int program); virtual void allNoteOff(void); virtual void systemReset(void); }; #endif