midiport.h File Reference

#include <jack/types.h>
#include <stdlib.h>

Go to the source code of this file.

Data Structures

struct  _jack_midi_event
struct  _jack_midi_port_info

Typedefs

typedef unsigned char jack_midi_data_t
typedef _jack_midi_event jack_midi_event_t
typedef _jack_midi_port_info jack_midi_port_info_t

Functions

jack_midi_port_info_tjack_midi_port_get_info (void *port_buffer, jack_nframes_t nframes)
int jack_midi_event_get (jack_midi_event_t *event, void *port_buffer, jack_nframes_t event_idx, jack_nframes_t nframes)
void jack_midi_reset_new_port (void *port_buffer, jack_nframes_t nframes)
void jack_midi_clear_buffer (void *port_buffer, jack_nframes_t nframes)
jack_midi_data_tjack_midi_event_reserve (void *port_buffer, jack_nframes_t time, size_t data_size, jack_nframes_t nframes)
int jack_midi_event_write (void *port_buffer, jack_nframes_t time, jack_midi_data_t *data, size_t data_size, jack_nframes_t nframes)
jack_midi_data_t jack_midi_get_status_before_event_n (void *port_buffer, jack_nframes_t event_index, jack_nframes_t nframes)
jack_nframes_t jack_midi_get_lost_event_count (void *port_buffer, jack_nframes_t nframes)


Typedef Documentation

typedef unsigned char jack_midi_data_t
 

Type for raw event data contained in jack_midi_event_t.

typedef struct _jack_midi_event jack_midi_event_t
 

typedef struct _jack_midi_port_info jack_midi_port_info_t
 


Function Documentation

void jack_midi_clear_buffer void *  port_buffer,
jack_nframes_t  nframes
 

Clear an event buffer.

This should be called at the beginning of each process cycle before calling jack_midi_event_reserve or jack_midi_event_write. This function may not be called on an input port's buffer.

Parameters:
port_buffer Port buffer to clear (must be an output port buffer).
nframes Number of valid frames this cycle.

int jack_midi_event_get jack_midi_event_t event,
void *  port_buffer,
jack_nframes_t  event_idx,
jack_nframes_t  nframes
 

Get a MIDI event from an event port buffer.

The MIDI event returned is guaranteed to be a complete MIDI event (i.e. clients do not have to deal with running status as the status byte of the event will always be present).

Parameters:
event Event structure to store retrieved event in.
port_buffer Port buffer from which to retrieve event.
event_index Index of event to retrieve.
nframes Number of valid frames this cycle.
Returns:
0 on success, ENODATA if buffer is empty.

jack_midi_data_t* jack_midi_event_reserve void *  port_buffer,
jack_nframes_t  time,
size_t  data_size,
jack_nframes_t  nframes
 

Allocate space for an event to be written to an event port buffer.

Clients are to write the actual event data to be written starting at the pointer returned by this function. Clients must not write more than data_size bytes into this buffer.

Parameters:
port_buffer Buffer to write event to.
time Sample offset of event.
data_size Length of event's raw data in bytes.
nframes Number of valid frames this event.
Returns:
Pointer to the beginning of the reserved event's data buffer, or NULL on error (ie not enough space).

int jack_midi_event_write void *  port_buffer,
jack_nframes_t  time,
jack_midi_data_t data,
size_t  data_size,
jack_nframes_t  nframes
 

Write an event into an event port buffer.

This function is simply a wrapper for jack_midi_event_reserve which writes the event data into the space reserved in the buffer.

Parameters:
port_buffer Buffer to write event to.
time Sample offset of event.
data Message data to be written.
data_size Length of data in bytes.
nframes Number of valid frames this event.
Returns:
0 on success, ENOBUFS if there's not enough space in buffer for event.

jack_nframes_t jack_midi_get_lost_event_count void *  port_buffer,
jack_nframes_t  nframes
 

Get the number of events that could not be written to port_buffer.

This function returning a non-zero value implies port_buffer is full. Currently the only way this can happen is if events are lost on port mixdown.

Parameters:
port_buffer Port to receive count for.
nframes Number of valid frames this cycle.
Returns:
Number of events that could not be written to port_buffer.

jack_midi_data_t jack_midi_get_status_before_event_n void *  port_buffer,
jack_nframes_t  event_index,
jack_nframes_t  nframes
 

return the last status byte in the stream before event n

jack_midi_port_info_t* jack_midi_port_get_info void *  port_buffer,
jack_nframes_t  nframes
 

void jack_midi_reset_new_port void *  port_buffer,
jack_nframes_t  nframes
 

Initialise the port state. This must be used after port_buffer is allocated


Generated on Sat May 27 01:46:58 2006 for JACK-AUDIO-CONNECTION-KIT by  doxygen 1.4.6