2 Copyright (C) 2009 Grame
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __JackMidiDriver__
21 #define __JackMidiDriver__
23 #include "JackDriver.h"
24 #include "JackMidiPort.h"
25 #include "JackLockedEngine.h"
26 #include "ringbuffer.h"
32 \brief The base class for MIDI drivers: drivers with MIDI ports.
35 class SERVER_EXPORT JackMidiDriver
: public JackDriver
41 int fPlaybackChannels
;
43 jack_ringbuffer_t
* fRingBuffer
[DRIVER_PORT_NUM
];
45 jack_port_id_t fCapturePortList
[DRIVER_PORT_NUM
];
46 jack_port_id_t fPlaybackPortList
[DRIVER_PORT_NUM
];
48 JackMidiBuffer
* GetInputBuffer(int port_index
);
49 JackMidiBuffer
* GetOutputBuffer(int port_index
);
53 JackMidiDriver(const char* name
, const char* alias
, JackLockedEngine
* engine
, JackSynchro
* table
);
54 virtual ~JackMidiDriver();
56 virtual int Open(bool capturing
,
61 const char* capture_driver_name
,
62 const char* playback_driver_name
,
63 jack_nframes_t capture_latency
,
64 jack_nframes_t playback_latency
);
66 virtual int Process();
67 virtual int ProcessNull();