//------------------------------------------------------------------------- // Filename: mididevice.hh // Version: $Id: mididevice.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: MIDI device virtual base class // Created at: Sat May 22 19:10:55 1999 // Modified by: Erik Mouw // Modified at: Wed May 26 11:29:59 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: mididevice.hh,v 1.1.2.2 1999/06/09 10:14:03 erik Exp $" #ifndef musica_mididevice_hh #define musica_mididevice_hh // FIXME: this is also defined in sequence.hh! static const int numMidiChannels = 17; static const int minMidiChannel = 0; static const int maxMidiChannel = 15; static const int invalidMidiChannel = 16; static const int numMaxMidiPrograms = 128; class midiDevice { protected: const char *type; char *name; public: midiDevice(const char *theName); virtual ~midiDevice(void); const char *getName(void) { return(name); }; const char *getType(void) { return(type); }; // virtual base functions virtual bool open(void) = 0; virtual bool close(void) = 0; virtual void noteOn(int channel, int key, int velocity) = 0; virtual void noteOff(int channel, int key, int velocity) = 0; virtual void keyPressure(int channel, int key, int pressure) = 0; virtual void channelPressure(int channel, int pressure) = 0; virtual void pitchBend(int channel, int fine, int coarse) = 0; virtual void controlChange(int channel, int controller, int value) = 0; virtual void programChange(int channel, int program) = 0; virtual void allNoteOff(void) = 0; virtual void systemReset(void) = 0; }; #endif