2 Copyright (C) 2006 Paul Davis
3 Written by Dave Robillard
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 $Id: jack.h 4 2005-05-13 20:47:18Z taybin $
22 #ifndef __jack_midiport_h__
23 #define __jack_midiport_h__
31 #include <jack/jack.h>
32 #include <jack/midiport.h>
33 #include <midi++/port.h>
39 class JACK_MidiPort : public Port
42 JACK_MidiPort (PortRequest &req, jack_client_t* jack_client);
43 virtual ~JACK_MidiPort ();
45 /* No select(2)/poll(2)-based I/O */
46 virtual int selectable() const { return -1; }
48 virtual void cycle_start(nframes_t nframes);
50 static std::string typestring;
53 std::string get_typestring () const {
59 int write(byte *msg, size_t msglen, timestamp_t timestamp);
60 int read(byte *buf, size_t max, timestamp_t timestamp);
63 int create_ports(PortRequest &req);
65 jack_client_t* _jack_client;
66 jack_port_t* _jack_input_port;
67 jack_port_t* _jack_output_port;
68 nframes_t _last_read_index;
72 } /* namespace MIDI */
74 #endif // __jack_midiport_h__