update the website url
[gmidimonitor.git] / jack_compat.h
blobf3523cc20e65ca4162fe0196ca8dce7b547d0456
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
4 * This file is part of gmidimonitor
6 * Copyright (C) 2007,2008,2011 Nedko Arnaudov <nedko@arnaudov.name>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *****************************************************************************/
23 #if defined(JACK_MIDI_NEEDS_NFRAMES)
25 jack_nframes_t
26 jack_midi_get_event_count_compat(
27 void * port_buffer)
29 #if defined(HAVE_OLD_JACK_MIDI)
30 return jack_midi_port_get_info(port_buffer, 0)->event_count;
31 #else
32 return jack_midi_get_event_count(port_buffer, 0);
33 #endif
36 #define jack_midi_get_event_count jack_midi_get_event_count_compat
38 int
39 jack_midi_event_get_compat(
40 jack_midi_event_t * event,
41 void * port_buffer,
42 jack_nframes_t event_index)
44 return jack_midi_event_get(event, port_buffer, event_index, 0);
47 #define jack_midi_event_get jack_midi_event_get_compat
49 #else
51 #if defined(HAVE_OLD_JACK_MIDI)
52 #error "Old (0.102.20) JACK MIDI API needs nframes (autotools probably gone mad)"
53 #endif
55 #endif /* #if defined(JACK_MIDI_NEEDS_NFRAMES) */