1 /* JACK MIDI API compatibility hacks.
2 * Copyright (C) 2007 Nedko Arnaudov <nedko@arnaudov.name>
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; version 2 of the License
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 #define JACK_MIDI_NEEDS_NFRAMES
23 #if defined(JACK_MIDI_NEEDS_NFRAMES)
26 jack_midi_get_event_count_compat(
29 #if defined(HAVE_OLD_JACK_MIDI)
30 return jack_midi_port_get_info(port_buffer, 0)->event_count;
32 return jack_midi_get_event_count(port_buffer, 0);
36 #define jack_midi_get_event_count jack_midi_get_event_count_compat
39 jack_midi_event_get_compat(
40 jack_midi_event_t * event,
42 jack_nframes_t event_index)
44 return jack_midi_event_get(event, port_buffer, event_index, 0);
48 jack_midi_event_write_compat(void *port_buffer,
50 const jack_midi_data_t *data,
53 return jack_midi_event_write (port_buffer, time, data, data_size, 0);
57 jack_midi_clear_buffer_compat(void* buf)
59 jack_midi_clear_buffer (buf, 0);
62 #define jack_midi_event_get jack_midi_event_get_compat
63 #define jack_midi_event_write jack_midi_event_write_compat
64 #define jack_midi_clear_buffer jack_midi_clear_buffer_compat
68 #if defined(HAVE_OLD_JACK_MIDI)
69 #error "Old (0.102.20) JACK MIDI API needs nframes (autotools probably gone mad)"
72 #endif /* #if defined(JACK_MIDI_NEEDS_NFRAMES) */
74 #endif /* JACK_COMPAT_H */