From bf2d76b7bbd50918027649ca3971ccfa934fffb3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Apr 2007 17:55:37 +0000 Subject: More Jack MIDI API compatibility jacks. git-svn-id: http://svn.drobilla.net/lad/ingen@421 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/JackMidiDriver.cpp | 1 + src/libs/engine/Makefile.am | 2 +- src/libs/engine/jack_compat.c | 43 ---------------------------------- src/libs/engine/jack_compat.h | 48 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 44 deletions(-) delete mode 100644 src/libs/engine/jack_compat.c create mode 100644 src/libs/engine/jack_compat.h (limited to 'src') diff --git a/src/libs/engine/JackMidiDriver.cpp b/src/libs/engine/JackMidiDriver.cpp index 44c44725..7170753f 100644 --- a/src/libs/engine/JackMidiDriver.cpp +++ b/src/libs/engine/JackMidiDriver.cpp @@ -26,6 +26,7 @@ #include "AudioDriver.h" #include "MidiBuffer.h" #include "DuplexPort.h" +#include "jack_compat.h" #ifdef HAVE_LASH #include "LashDriver.h" #endif diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am index 2f71604b..49308afa 100644 --- a/src/libs/engine/Makefile.am +++ b/src/libs/engine/Makefile.am @@ -163,7 +163,7 @@ if WITH_JACK_MIDI libingen_la_SOURCES += \ JackMidiDriver.h \ JackMidiDriver.cpp \ - jack_compat.c + jack_compat.h endif if WITH_ALSA_MIDI diff --git a/src/libs/engine/jack_compat.c b/src/libs/engine/jack_compat.c deleted file mode 100644 index 859f8f48..00000000 --- a/src/libs/engine/jack_compat.c +++ /dev/null @@ -1,43 +0,0 @@ -/* JACK MIDI API compatibility hacks. - * Copyright (C) 2007 Nedko Arnaudov - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#if defined(HAVE_OLD_JACK_MIDI) -#define jack_midi_get_event_count(port_buf, nframes) jack_midi_port_get_info(port_buf, nframes)->event_count -#endif - -#if defined(JACK_MIDI_NEEDS_NFRAMES) - -jack_nframes_t -jack_midi_get_event_count_compat( - void * port_buffer) -{ - return jack_midi_get_event_count(port_buffer, 0); -} - -int -jack_midi_event_get_compat( - jack_midi_event_t * event, - void * port_buffer, - jack_nframes_t event_index) -{ - return jack_midi_event_get(event, port_buffer, event_index, 0); -} - -#define jack_midi_get_event_count jack_midi_get_event_count_compat -#define jack_midi_event_get jack_midi_event_get_compat - -#endif /* #if defined(HAVE_JACK_MIDI_WITH_NFRAMES) */ diff --git a/src/libs/engine/jack_compat.h b/src/libs/engine/jack_compat.h new file mode 100644 index 00000000..d7b5df64 --- /dev/null +++ b/src/libs/engine/jack_compat.h @@ -0,0 +1,48 @@ +/* JACK MIDI API compatibility hacks. + * Copyright (C) 2007 Nedko Arnaudov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef JACK_COMPAT_H +#define JACK_COMPAT_H + +#if defined(HAVE_OLD_JACK_MIDI) +#define jack_midi_get_event_count(port_buf, nframes) jack_midi_port_get_info(port_buf, nframes)->event_count +#endif + +#if defined(JACK_MIDI_NEEDS_NFRAMES) + +inline jack_nframes_t +jack_midi_get_event_count_compat( + void * port_buffer) +{ + return jack_midi_get_event_count(port_buffer, 0); +} + +inline int +jack_midi_event_get_compat( + jack_midi_event_t * event, + void * port_buffer, + jack_nframes_t event_index) +{ + return jack_midi_event_get(event, port_buffer, event_index, 0); +} + +#define jack_midi_get_event_count jack_midi_get_event_count_compat +#define jack_midi_event_get jack_midi_event_get_compat + +#endif /* #if defined(HAVE_JACK_MIDI_WITH_NFRAMES) */ + +#endif /* JACK_COMPAT_H */ -- cgit v1.2.1