|
|
@@ -1,16 +1,20 @@ |
|
|
/* |
|
|
/* |
|
|
Copyright (C) 2004 Ian Esten |
|
|
Copyright (C) 2004 Ian Esten |
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
|
|
This program is free software; you can redistribute it and/or modify |
|
|
it under the terms of the GNU Lesser General Public License as published by |
|
|
it under the terms of the GNU Lesser General Public License as published by |
|
|
the Free Software Foundation; either version 2.1 of the License, or |
|
|
the Free Software Foundation; either version 2.1 of the License, or |
|
|
(at your option) any later version. |
|
|
(at your option) any later version. |
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
|
|
This program is distributed in the hope that it will be useful, |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
GNU Lesser General Public License for more details. |
|
|
GNU Lesser General Public License for more details. |
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License |
|
|
You should have received a copy of the GNU Lesser General Public License |
|
|
along with this program; if not, write to the Free Software |
|
|
along with this program; if not, write to the Free Software |
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -26,14 +30,6 @@ extern "C" { |
|
|
#include <jack/eventport.h> |
|
|
#include <jack/eventport.h> |
|
|
#include <stdlib.h> |
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Type for raw event data contained in @ref jack_midi_event_t. */ |
|
|
|
|
|
typedef jack_event_data_t jack_midi_data_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** A Jack MIDI event. */ |
|
|
|
|
|
typedef jack_event_t jack_midi_event_t; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @defgroup MIDIAPI Reading and writing MIDI data |
|
|
* @defgroup MIDIAPI Reading and writing MIDI data |
|
|
* @{ |
|
|
* @{ |
|
|
@@ -44,7 +40,9 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* @param port_buffer Port buffer from which to retrieve event. |
|
|
* @param port_buffer Port buffer from which to retrieve event. |
|
|
* @return number of events inside @a port_buffer |
|
|
* @return number of events inside @a port_buffer |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_get_event_count jack_event_get_count |
|
|
|
|
|
|
|
|
uint32_t |
|
|
|
|
|
jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Get a MIDI event from an event port buffer. |
|
|
/** Get a MIDI event from an event port buffer. |
|
|
* |
|
|
* |
|
|
@@ -68,7 +66,10 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* @param event_index Index of event to retrieve. |
|
|
* @param event_index Index of event to retrieve. |
|
|
* @return 0 on success, ENODATA if buffer is empty. |
|
|
* @return 0 on success, ENODATA if buffer is empty. |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_event_get jack_event_get |
|
|
|
|
|
|
|
|
int |
|
|
|
|
|
jack_midi_event_get(jack_midi_event_t *event, |
|
|
|
|
|
void *port_buffer, |
|
|
|
|
|
uint32_t event_index) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Clear an event buffer. |
|
|
/** Clear an event buffer. |
|
|
@@ -79,7 +80,8 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* |
|
|
* |
|
|
* @param port_buffer Port buffer to clear (must be an output port buffer). |
|
|
* @param port_buffer Port buffer to clear (must be an output port buffer). |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_clear_buffer jack_event_clear_buffer |
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
/** Reset an event buffer (from data allocated outside of JACK). |
|
|
/** Reset an event buffer (from data allocated outside of JACK). |
|
|
* |
|
|
* |
|
|
@@ -91,7 +93,8 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* |
|
|
* |
|
|
* @param port_buffer Port buffer to reset. |
|
|
* @param port_buffer Port buffer to reset. |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_reset_buffer jack_event_reset_buffer |
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
jack_midi_reset_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_DEPRECATED_EXPORT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Get the size of the largest event that can be stored by the port. |
|
|
/** Get the size of the largest event that can be stored by the port. |
|
|
@@ -101,7 +104,8 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* |
|
|
* |
|
|
* @param port_buffer Port buffer to check size of. |
|
|
* @param port_buffer Port buffer to check size of. |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_max_event_size jack_event_max_size |
|
|
|
|
|
|
|
|
size_t |
|
|
|
|
|
jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Allocate space for an event to be written to an event port buffer. |
|
|
/** Allocate space for an event to be written to an event port buffer. |
|
|
@@ -123,7 +127,10 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* @return Pointer to the beginning of the reserved event's data buffer, or |
|
|
* @return Pointer to the beginning of the reserved event's data buffer, or |
|
|
* NULL on error (ie not enough space). |
|
|
* NULL on error (ie not enough space). |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_event_reserve jack_event_reserve |
|
|
|
|
|
|
|
|
jack_midi_data_t* |
|
|
|
|
|
jack_midi_event_reserve(void *port_buffer, |
|
|
|
|
|
jack_nframes_t time, |
|
|
|
|
|
size_t data_size) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Write an event into an event port buffer. |
|
|
/** Write an event into an event port buffer. |
|
|
@@ -147,7 +154,11 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* @param data_size Length of @a data in bytes. |
|
|
* @param data_size Length of @a data in bytes. |
|
|
* @return 0 on success, ENOBUFS if there's not enough space in buffer for event. |
|
|
* @return 0 on success, ENOBUFS if there's not enough space in buffer for event. |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_event_write jack_event_write |
|
|
|
|
|
|
|
|
int |
|
|
|
|
|
jack_midi_event_write(void *port_buffer, |
|
|
|
|
|
jack_nframes_t time, |
|
|
|
|
|
const jack_midi_data_t *data, |
|
|
|
|
|
size_t data_size) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Get the number of events that could not be written to @a port_buffer. |
|
|
/** Get the number of events that could not be written to @a port_buffer. |
|
|
@@ -158,7 +169,8 @@ typedef jack_event_t jack_midi_event_t; |
|
|
* @param port_buffer Port to receive count for. |
|
|
* @param port_buffer Port to receive count for. |
|
|
* @returns Number of events that could not be written to @a port_buffer. |
|
|
* @returns Number of events that could not be written to @a port_buffer. |
|
|
*/ |
|
|
*/ |
|
|
#define jack_midi_get_lost_event_count jack_event_get_lost_count |
|
|
|
|
|
|
|
|
uint32_t |
|
|
|
|
|
jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; |
|
|
|
|
|
|
|
|
/*@}*/ |
|
|
/*@}*/ |
|
|
|
|
|
|
|
|
@@ -168,3 +180,4 @@ typedef jack_event_t jack_midi_event_t; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __JACK_MIDIPORT_H */ |
|
|
#endif /* __JACK_MIDIPORT_H */ |
|
|
|
|
|
|