Jack2 1.9.6

JackMidiDriver.h

00001 /*
00002 Copyright (C) 2009 Grame
00003 
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 
00018 */
00019 
00020 #ifndef __JackMidiDriver__
00021 #define __JackMidiDriver__
00022 
00023 #include "JackDriver.h"
00024 #include "JackMidiPort.h"
00025 #include "JackLockedEngine.h"
00026 #include "ringbuffer.h"
00027 
00028 namespace Jack
00029 {
00030 
00035 class SERVER_EXPORT JackMidiDriver : public JackDriver
00036 {
00037 
00038      protected:
00039 
00040         int fCaptureChannels;
00041         int fPlaybackChannels;
00042         
00043         jack_ringbuffer_t* fRingBuffer[DRIVER_PORT_NUM];
00044 
00045         jack_port_id_t fCapturePortList[DRIVER_PORT_NUM];
00046         jack_port_id_t fPlaybackPortList[DRIVER_PORT_NUM];
00047    
00048         JackMidiBuffer* GetInputBuffer(int port_index);
00049         JackMidiBuffer* GetOutputBuffer(int port_index);
00050  
00051     public:
00052 
00053         JackMidiDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table);
00054         virtual ~JackMidiDriver();
00055 
00056         virtual int Open(bool capturing,
00057                         bool playing,
00058                         int inchannels,
00059                         int outchannels,
00060                         bool monitor,
00061                         const char* capture_driver_name,
00062                         const char* playback_driver_name,
00063                         jack_nframes_t capture_latency,
00064                         jack_nframes_t playback_latency);
00065                         
00066         virtual int Process();
00067         virtual int ProcessNull();
00068 
00069         virtual int Attach();
00070         virtual int Detach();
00071         
00072         virtual int Read();
00073         virtual int Write();
00074  
00075 };
00076 
00077 } // end of namespace
00078 
00079 #endif