LV2_MIDI | Helper functions

lv2-midifunctions.h File Reference

This file contains static helper functions for the LV2 MIDI datatype extension. More...

#include <string.h>
#include "lv2-miditype.h"

Go to the source code of this file.

Data Structures

struct  LV2_MIDIState
 This structure contains information about a MIDI port buffer, the current period size, and the position in the MIDI data buffer that we are currently reading from or writing to. More...

Functions

static double lv2midi_get_event (LV2_MIDIState *state, double *timestamp, uint32_t *size, unsigned char **data)
 This function reads one event from the port associated with the state parameter and writes its timestamp, size and a pointer to its data bytes into the parameters timestamp, size and data, respectively.
static double lv2midi_step (LV2_MIDIState *state)
 This function advances the read/write position in state to the next event and returns its timestamp, or the frame_count member of state is there are no more events.
static int lv2midi_put_event (LV2_MIDIState *state, double timestamp, uint32_t size, const unsigned char *data)
 This function writes one MIDI event to the port buffer associated with state.


Detailed Description

This file contains static helper functions for the LV2 MIDI datatype extension.


Function Documentation

static double lv2midi_get_event ( LV2_MIDIState state,
double *  timestamp,
uint32_t *  size,
unsigned char **  data 
) [static]

This function reads one event from the port associated with the state parameter and writes its timestamp, size and a pointer to its data bytes into the parameters timestamp, size and data, respectively.

It does not advance the read position in the MIDI data buffer, two subsequent calls to lv2midi_get_event() will read the same event.

The function returns the timestamp for the read event, or the frame_count member of state if there are no more events in the buffer.

static int lv2midi_put_event ( LV2_MIDIState state,
double  timestamp,
uint32_t  size,
const unsigned char *  data 
) [static]

This function writes one MIDI event to the port buffer associated with state.

It returns 0 when the event was written successfully to the buffer, and -1 when there was not enough room. The read/write position is advanced automatically.

static double lv2midi_step ( LV2_MIDIState state  )  [static]

This function advances the read/write position in state to the next event and returns its timestamp, or the frame_count member of state is there are no more events.


Generated on Thu Feb 8 12:45:15 2007 by  doxygen 1.5.1