]> git.0d.be Git - jack_mixer.git/blob - jack_compat.h
Fix new output channel not creating from dialog
[jack_mixer.git] / jack_compat.h
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*****************************************************************************
3  *
4  *   This file is part of jack_nuke
5  *
6  *   Copyright (C) 2007 Nedko Arnaudov <nedko@arnaudov.name>
7  *
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
11  *
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.
16  *
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.
20  *
21  *****************************************************************************/
22
23 #if defined(JACK_MIDI_NEEDS_NFRAMES)
24
25 jack_nframes_t
26 jack_midi_get_event_count_compat(
27   void * port_buffer)
28 {
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
34 }
35
36 #define jack_midi_get_event_count jack_midi_get_event_count_compat
37
38 int
39 jack_midi_event_get_compat(
40   jack_midi_event_t * event,
41   void * port_buffer,
42   jack_nframes_t event_index)
43 {
44   return jack_midi_event_get(event, port_buffer, event_index, 0);
45 }
46
47 #define jack_midi_event_get jack_midi_event_get_compat
48
49 void
50 jack_midi_clear_buffer_compat(
51   void * port_buffer)
52 {
53   jack_midi_clear_buffer(port_buffer, 0);
54 }
55
56 #define jack_midi_clear_buffer jack_midi_clear_buffer_compat
57
58 #else
59
60 #if defined(HAVE_OLD_JACK_MIDI)
61 #error "Old (0.102.20) JACK MIDI API needs nframes (autotools probably gone mad)"
62 #endif
63
64 #endif  /* #if defined(JACK_MIDI_NEEDS_NFRAMES) */