2 Copyright (C) 2004 Paul Davis
3 Copyright (C) 2004 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 __coremidi_midiport_h__
21 #define __coremidi_midiport_h__
29 #include <midi++/port.h>
31 #include <CoreMIDI/CoreMIDI.h>
35 class CoreMidi_MidiPort:public Port {
37 CoreMidi_MidiPort(PortRequest & req);
38 virtual ~ CoreMidi_MidiPort();
40 virtual int selectable() const {
45 int write (byte *msg, size_t msglen, timestamp_t timestamp);
46 int read (byte *buf, size_t max, timestamp_t timestamp);
48 /* CoreMidi callback */
49 static void read_proc(const MIDIPacketList * pktlist,
50 void *refCon, void *connRefCon);
53 byte midi_buffer[1024];
54 MIDIClientRef midi_client;
55 MIDIEndpointRef midi_destination;
56 MIDIEndpointRef midi_source;
58 int Open(PortRequest & req);
60 static MIDITimeStamp MIDIGetCurrentHostTime();
65 }; /* namespace MIDI */
67 #endif // __coremidi_midiport_h__