ALSA project - the C library reference

Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions
RawMidi Interface

## Macros
#define | SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001
#define | SND_RAWMIDI_APPEND
#define | SND_RAWMIDI_NONBLOCK
#define | SND_RAWMIDI_SYNC
#define | SND_RAWMIDI_INFO_UMP 0x00000008
#define | SND_RAWMIDI_INFO_STREAM_INACTIVE 0x00000010
#define | SNDRV_RAWMIDI_INFO_STREAM_INACTIVE SND_RAWMIDI_INFO_STREAM_INACTIVE
#define | snd_rawmidi_info_alloca(ptr)
| allocate an invalid snd_rawmidi_info_t using standard alloca
#define | snd_rawmidi_params_alloca(ptr)
| allocate an invalid snd_rawmidi_params_t using standard alloca
#define | snd_rawmidi_status_alloca(ptr)
| allocate an invalid snd_rawmidi_status_t using standard alloca
#define | SND_UMP_MAX_GROUPS 16
#define | SND_UMP_MAX_BLOCKS 32
#define | SND_UMP_EP_INFO_STATIC_BLOCKS 0x01
#define | SND_UMP_EP_INFO_PROTO_MIDI_MASK 0x0300
#define | SND_UMP_EP_INFO_PROTO_MIDI1 0x0100
#define | SND_UMP_EP_INFO_PROTO_MIDI2 0x0200
#define | SND_UMP_EP_INFO_PROTO_JRTS_MASK 0x0003
#define | SND_UMP_EP_INFO_PROTO_JRTS_TX 0x0001
#define | SND_UMP_EP_INFO_PROTO_JRTS_RX 0x0002
#define | SND_UMP_EP_INFO_DEFAULT_VERSION 0x0101
#define | snd_ump_endpoint_info_alloca(ptr)
| allocate an invalid snd_ump_endpoint_info_t using standard alloca
#define | SND_UMP_BLOCK_IS_MIDI1 (1U << 0)
#define | SND_UMP_BLOCK_IS_LOWSPEED (1U << 1)
#define | SND_UMP_BLOCK_INFO_DEFAULT_MIDI_CI_VERSION 0x01
#define | snd_ump_block_info_alloca(ptr)
| allocate an invalid snd_ump_block_info_t using standard alloca

## Typedefs
typedef struct _snd_rawmidi_info | snd_rawmidi_info_t
typedef struct _snd_rawmidi_params | snd_rawmidi_params_t
typedef struct _snd_rawmidi_status | snd_rawmidi_status_t
typedef struct _snd_rawmidi | snd_rawmidi_t
typedef struct _snd_ump | snd_ump_t
typedef struct snd_ump_endpoint_info | snd_ump_endpoint_info_t
typedef struct snd_ump_block_info | snd_ump_block_info_t

## Enumerations
enum | snd_rawmidi_stream_t { SND_RAWMIDI_STREAM_OUTPUT = 0 , SND_RAWMIDI_STREAM_INPUT , SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT }
enum | snd_rawmidi_type_t { SND_RAWMIDI_TYPE_HW , SND_RAWMIDI_TYPE_SHM , SND_RAWMIDI_TYPE_INET , SND_RAWMIDI_TYPE_VIRTUAL }
enum | snd_rawmidi_clock_t { SND_RAWMIDI_CLOCK_NONE = 0 , SND_RAWMIDI_CLOCK_REALTIME = 1 , SND_RAWMIDI_CLOCK_MONOTONIC = 2 , SND_RAWMIDI_CLOCK_MONOTONIC_RAW = 3 }
enum | snd_rawmidi_read_mode_t { SND_RAWMIDI_READ_STANDARD = 0 , SND_RAWMIDI_READ_TSTAMP = 1 }
enum | _snd_ump_direction { SND_UMP_DIR_INPUT = 0x01 , SND_UMP_DIR_OUTPUT = 0x02 , SND_UMP_DIR_BIDIRECTION = 0x03 }
enum | _snd_ump_block_ui_hint { SND_UMP_BLOCK_UI_HINT_UNKNOWN = 0x00 , SND_UMP_BLOCK_UI_HINT_RECEIVER = 0x01 , SND_UMP_BLOCK_UI_HINT_SENDER = 0x02 , SND_UMP_BLOCK_UI_HINT_BOTH = 0x03 }

## Functions
int | snd_rawmidi_open (snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, const char *name, int mode)
| Opens a new connection to the RawMidi interface.
int | snd_rawmidi_open_lconf (snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, const char *name, int mode, snd_config_t *lconf)
| Opens a new connection to the RawMidi interface using local configuration.
int | snd_rawmidi_close (snd_rawmidi_t *rmidi)
| close RawMidi handle
int | snd_rawmidi_poll_descriptors_count (snd_rawmidi_t *rmidi)
| get count of poll descriptors for RawMidi handle
int | snd_rawmidi_poll_descriptors (snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space)
| get poll descriptors
int | snd_rawmidi_poll_descriptors_revents (snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent)
| get returned events from poll descriptors
int | snd_rawmidi_nonblock (snd_rawmidi_t *rmidi, int nonblock)
| set nonblock mode
size_t | snd_rawmidi_info_sizeof (void)
| get size of the snd_rawmidi_info_t structure in bytes
int | snd_rawmidi_info_malloc (snd_rawmidi_info_t **ptr)
| allocate a new snd_rawmidi_info_t structure
void | snd_rawmidi_info_free (snd_rawmidi_info_t *obj)
| frees the snd_rawmidi_info_t structure
void | snd_rawmidi_info_copy (snd_rawmidi_info_t *dst, const snd_rawmidi_info_t *src)
| copy one snd_rawmidi_info_t structure to another
unsigned int | snd_rawmidi_info_get_device (const snd_rawmidi_info_t *obj)
| get rawmidi device number
unsigned int | snd_rawmidi_info_get_subdevice (const snd_rawmidi_info_t *obj)
| get rawmidi subdevice number
snd_rawmidi_stream_t | snd_rawmidi_info_get_stream (const snd_rawmidi_info_t *obj)
| get rawmidi stream identification
int | snd_rawmidi_info_get_card (const snd_rawmidi_info_t *obj)
| get rawmidi card number
unsigned int | snd_rawmidi_info_get_flags (const snd_rawmidi_info_t *obj)
| get rawmidi flags
const char * | snd_rawmidi_info_get_id (const snd_rawmidi_info_t *obj)
| get rawmidi hardware driver identifier
const char * | snd_rawmidi_info_get_name (const snd_rawmidi_info_t *obj)
| get rawmidi hardware driver name
const char * | snd_rawmidi_info_get_subdevice_name (const snd_rawmidi_info_t *obj)
| get rawmidi subdevice name
unsigned int | snd_rawmidi_info_get_subdevices_count (const snd_rawmidi_info_t *obj)
| get rawmidi count of subdevices
unsigned int | snd_rawmidi_info_get_subdevices_avail (const snd_rawmidi_info_t *obj)
| get rawmidi available count of subdevices
int | snd_rawmidi_info_get_tied_device (const snd_rawmidi_info_t *obj)
| get the tied device number for the given rawmidi device
void | snd_rawmidi_info_set_device (snd_rawmidi_info_t *obj, unsigned int val)
| set rawmidi device number
void | snd_rawmidi_info_set_subdevice (snd_rawmidi_info_t *obj, unsigned int val)
| set rawmidi subdevice number
void | snd_rawmidi_info_set_stream (snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val)
| set rawmidi stream identifier
int | snd_rawmidi_info (snd_rawmidi_t *rmidi, snd_rawmidi_info_t *info)
| get information about RawMidi handle
size_t | snd_rawmidi_params_sizeof (void)
| get size of the snd_rawmidi_params_t structure in bytes
int | snd_rawmidi_params_malloc (snd_rawmidi_params_t **ptr)
| allocate the snd_rawmidi_params_t structure
void | snd_rawmidi_params_free (snd_rawmidi_params_t *obj)
| frees the snd_rawmidi_params_t structure
void | snd_rawmidi_params_copy (snd_rawmidi_params_t *dst, const snd_rawmidi_params_t *src)
| copy one snd_rawmidi_params_t structure to another
int | snd_rawmidi_params_set_buffer_size (snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val)
| set rawmidi I/O ring buffer size
size_t | snd_rawmidi_params_get_buffer_size (const snd_rawmidi_params_t *params)
| get rawmidi I/O ring buffer size
int | snd_rawmidi_params_set_avail_min (snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val)
| set minimum available bytes in rawmidi I/O ring buffer for wakeup
size_t | snd_rawmidi_params_get_avail_min (const snd_rawmidi_params_t *params)
| get minimum available bytes in rawmidi I/O ring buffer for wakeup
int | snd_rawmidi_params_set_no_active_sensing (snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, int val)
| set no-active-sensing action on snd_rawmidi_close()
int | snd_rawmidi_params_get_no_active_sensing (const snd_rawmidi_params_t *params)
| get no-active-sensing action status
int | snd_rawmidi_params_set_read_mode (const snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params, snd_rawmidi_read_mode_t val)
| set read mode
snd_rawmidi_read_mode_t | snd_rawmidi_params_get_read_mode (const snd_rawmidi_params_t *params)
| get current read mode
int | snd_rawmidi_params_set_clock_type (const snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params, snd_rawmidi_clock_t val)
| sets clock type for tstamp type framing
snd_rawmidi_clock_t | snd_rawmidi_params_get_clock_type (const snd_rawmidi_params_t *params)
| get current clock type (for tstamp type framing)
int | snd_rawmidi_params (snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params)
| set parameters about rawmidi stream
int | snd_rawmidi_params_current (snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params)
| get current parameters about rawmidi stream
size_t | snd_rawmidi_status_sizeof (void)
| get size of the snd_rawmidi_status_t structure in bytes
int | snd_rawmidi_status_malloc (snd_rawmidi_status_t **ptr)
| allocate the snd_rawmidi_status_t structure
void | snd_rawmidi_status_free (snd_rawmidi_status_t *obj)
| frees the snd_rawmidi_status_t structure
void | snd_rawmidi_status_copy (snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src)
| copy one snd_rawmidi_status_t structure to another
void | snd_rawmidi_status_get_tstamp (const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr)
| get the start timestamp
size_t | snd_rawmidi_status_get_avail (const snd_rawmidi_status_t *obj)
| get current available bytes in the rawmidi I/O ring buffer
size_t | snd_rawmidi_status_get_xruns (const snd_rawmidi_status_t *obj)
| get count of xruns
int | snd_rawmidi_status (snd_rawmidi_t *rmidi, snd_rawmidi_status_t *status)
| get status of rawmidi stream
int | snd_rawmidi_drain (snd_rawmidi_t *rmidi)
| drain all bytes in the rawmidi I/O ring buffer
int | snd_rawmidi_drop (snd_rawmidi_t *rmidi)
| drop all bytes in the rawmidi I/O ring buffer immediately
ssize_t | snd_rawmidi_write (snd_rawmidi_t *rmidi, const void *buffer, size_t size)
| write MIDI bytes to MIDI stream
ssize_t | snd_rawmidi_read (snd_rawmidi_t *rmidi, void *buffer, size_t size)
| read MIDI bytes from MIDI stream
ssize_t | snd_rawmidi_tread (snd_rawmidi_t *rmidi, struct timespec *tstamp, void *buffer, size_t size)
| read MIDI bytes from MIDI stream with timestamp
const char * | snd_rawmidi_name (snd_rawmidi_t *rmidi)
| get identifier of RawMidi handle
snd_rawmidi_type_t | snd_rawmidi_type (snd_rawmidi_t *rmidi)
| get type of RawMidi handle
snd_rawmidi_stream_t | snd_rawmidi_stream (snd_rawmidi_t *rawmidi)
| get stream (direction) of RawMidi handle
int | snd_ump_open (snd_ump_t **inputp, snd_ump_t **outputp, const char *name, int mode)
| Opens a new connection to the UMP interface.
int | snd_ump_close (snd_ump_t *ump)
| close UMP handle
snd_rawmidi_t * | snd_ump_rawmidi (snd_ump_t *ump)
| get RawMidi instance associated with the UMP handle
const char * | snd_ump_name (snd_ump_t *ump)
| get identifier of UMP handle
int | snd_ump_poll_descriptors_count (snd_ump_t *ump)
| get count of poll descriptors for UMP handle
int | snd_ump_poll_descriptors (snd_ump_t *ump, struct pollfd *pfds, unsigned int space)
| get poll descriptors
int | snd_ump_poll_descriptors_revents (snd_ump_t *ump, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
| get returned events from poll descriptors
int | snd_ump_nonblock (snd_ump_t *ump, int nonblock)
| set nonblock mode
int | snd_ump_rawmidi_info (snd_ump_t *ump, snd_rawmidi_info_t *info)
| get information about associated RawMidi handle
int | snd_ump_rawmidi_params (snd_ump_t *ump, snd_rawmidi_params_t *params)
| set parameters about associated RawMidi stream
int | snd_ump_rawmidi_params_current (snd_ump_t *ump, snd_rawmidi_params_t *params)
| get current parameters about associated RawMidi stream
int | snd_ump_rawmidi_status (snd_ump_t *ump, snd_rawmidi_status_t *status)
| get status of associated RawMidi stream
int | snd_ump_drop (snd_ump_t *ump)
| drop all packets in the rawmidi I/O ring buffer immediately
int | snd_ump_drain (snd_ump_t *ump)
| drain all packets in the UMP I/O ring buffer
ssize_t | snd_ump_write (snd_ump_t *ump, const void *buffer, size_t size)
| write UMP packets to UMP stream
ssize_t | snd_ump_read (snd_ump_t *ump, void *buffer, size_t size)
| read UMP packets from UMP stream
ssize_t | snd_ump_tread (snd_ump_t *ump, struct timespec *tstamp, void *buffer, size_t size)
| read UMP packets from UMP stream with timestamp
size_t | snd_ump_endpoint_info_sizeof (void)
| get size of the snd_ump_endpoint_info_t structure in bytes
int | snd_ump_endpoint_info_malloc (snd_ump_endpoint_info_t **info)
| allocate the snd_ump_endpoint_info_t structure
void | snd_ump_endpoint_info_free (snd_ump_endpoint_info_t *info)
| frees the snd_ump_endpoint_info_t structure
void | snd_ump_endpoint_info_clear (snd_ump_endpoint_info_t *info)
| clears the snd_ump_endpoint_info_t structure
void | snd_ump_endpoint_info_copy (snd_ump_endpoint_info_t *dst, const snd_ump_endpoint_info_t *src)
| copy one snd_ump_endpoint_info_t structure to another
int | snd_ump_endpoint_info_get_card (const snd_ump_endpoint_info_t *info)
| get card number of UMP endpoint
int | snd_ump_endpoint_info_get_device (const snd_ump_endpoint_info_t *info)
| get device number of UMP endpoint
unsigned int | snd_ump_endpoint_info_get_flags (const snd_ump_endpoint_info_t *info)
| get UMP endpoint info flags
unsigned int | snd_ump_endpoint_info_get_protocol_caps (const snd_ump_endpoint_info_t *info)
| get UMP endpoint protocol capability bits
unsigned int | snd_ump_endpoint_info_get_protocol (const snd_ump_endpoint_info_t *info)
| get the current UMP endpoint protocol
unsigned int | snd_ump_endpoint_info_get_num_blocks (const snd_ump_endpoint_info_t *info)
| get the number of UMP blocks belonging to the endpoint
unsigned int | snd_ump_endpoint_info_get_version (const snd_ump_endpoint_info_t *info)
| get UMP version number
unsigned int | snd_ump_endpoint_info_get_manufacturer_id (const snd_ump_endpoint_info_t *info)
| get UMP manufacturer ID
unsigned int | snd_ump_endpoint_info_get_family_id (const snd_ump_endpoint_info_t *info)
| get UMP family ID
unsigned int | snd_ump_endpoint_info_get_model_id (const snd_ump_endpoint_info_t *info)
| get UMP model ID
const unsigned char * | snd_ump_endpoint_info_get_sw_revision (const snd_ump_endpoint_info_t *info)
| get UMP software revision
const char * | snd_ump_endpoint_info_get_name (const snd_ump_endpoint_info_t *info)
| get UMP endpoint name string
const char * | snd_ump_endpoint_info_get_product_id (const snd_ump_endpoint_info_t *info)
| get UMP endpoint product ID string
int | snd_ump_endpoint_info (snd_ump_t *ump, snd_ump_endpoint_info_t *info)
| get endpoint information about UMP handle
void | snd_ump_endpoint_info_set_card (snd_ump_endpoint_info_t *info, unsigned int card)
| set card number of UMP endpoint
void | snd_ump_endpoint_info_set_device (snd_ump_endpoint_info_t *info, unsigned int device)
| set device number of UMP endpoint
void | snd_ump_endpoint_info_set_flags (snd_ump_endpoint_info_t *info, unsigned int flags)
| set info flags of UMP endpoint
void | snd_ump_endpoint_info_set_protocol_caps (snd_ump_endpoint_info_t *info, unsigned int caps)
| set protocol capability bits of UMP endpoint
void | snd_ump_endpoint_info_set_protocol (snd_ump_endpoint_info_t *info, unsigned int protocols)
| set the current protocol of UMP endpoint
void | snd_ump_endpoint_info_set_num_blocks (snd_ump_endpoint_info_t *info, unsigned int num_blocks)
| set the number of UMP blocks of UMP endpoint
void | snd_ump_endpoint_info_set_version (snd_ump_endpoint_info_t *info, unsigned int version)
| set the UMP version number of UMP endpoint
void | snd_ump_endpoint_info_set_manufacturer_id (snd_ump_endpoint_info_t *info, unsigned int id)
| set the UMP manufacturer ID of UMP endpoint
void | snd_ump_endpoint_info_set_family_id (snd_ump_endpoint_info_t *info, unsigned int id)
| set the UMP family ID of UMP endpoint
void | snd_ump_endpoint_info_set_model_id (snd_ump_endpoint_info_t *info, unsigned int id)
| set the UMP model ID of UMP endpoint
void | snd_ump_endpoint_info_set_sw_revision (snd_ump_endpoint_info_t *info, const unsigned char *id)
| set the UMP software revision of UMP endpoint
void | snd_ump_endpoint_info_set_name (snd_ump_endpoint_info_t *info, const char *name)
| set the name of UMP endpoint
void | snd_ump_endpoint_info_set_product_id (snd_ump_endpoint_info_t *info, const char *id)
| set the product ID string of UMP endpoint
size_t | snd_ump_block_info_sizeof (void)
| get size of the snd_ump_block_info_t structure in bytes
int | snd_ump_block_info_malloc (snd_ump_block_info_t **info)
| allocate the snd_ump_block_info_t structure
void | snd_ump_block_info_free (snd_ump_block_info_t *info)
| frees the snd_ump_block_info_t structure
void | snd_ump_block_info_clear (snd_ump_block_info_t *info)
| clears the snd_ump_block_info_t structure
void | snd_ump_block_info_copy (snd_ump_block_info_t *dst, const snd_ump_block_info_t *src)
| copy one snd_ump_block_info_t structure to another
int | snd_ump_block_info_get_card (const snd_ump_block_info_t *info)
| get card number of UMP block
int | snd_ump_block_info_get_device (const snd_ump_block_info_t *info)
| get device number of UMP block
unsigned int | snd_ump_block_info_get_block_id (const snd_ump_block_info_t *info)
| get UMP block ID
unsigned int | snd_ump_block_info_get_active (const snd_ump_block_info_t *info)
| get UMP block activeness
unsigned int | snd_ump_block_info_get_flags (const snd_ump_block_info_t *info)
| get UMP block information flags
unsigned int | snd_ump_block_info_get_direction (const snd_ump_block_info_t *info)
| get UMP block direction
unsigned int | snd_ump_block_info_get_first_group (const snd_ump_block_info_t *info)
| get first UMP group ID belonging to the block
unsigned int | snd_ump_block_info_get_num_groups (const snd_ump_block_info_t *info)
| get number of UMP groups belonging to the block
unsigned int | snd_ump_block_info_get_midi_ci_version (const snd_ump_block_info_t *info)
| get MIDI-CI version number
unsigned int | snd_ump_block_info_get_sysex8_streams (const snd_ump_block_info_t *info)
| get number of supported SysEx8 streams
unsigned int | snd_ump_block_info_get_ui_hint (const snd_ump_block_info_t *info)
| get UI hint of the given UMP block
const char * | snd_ump_block_info_get_name (const snd_ump_block_info_t *info)
| get the name string of UMP block
int | snd_ump_block_info (snd_ump_t *ump, snd_ump_block_info_t *info)
| get UMP block information
void | snd_ump_block_info_set_card (snd_ump_block_info_t *info, unsigned int card)
| set card number to snd_ump_block_info_t structure
void | snd_ump_block_info_set_device (snd_ump_block_info_t *info, unsigned int device)
| set device number to snd_ump_block_info_t structure
void | snd_ump_block_info_set_block_id (snd_ump_block_info_t *info, unsigned int id)
| set UMP block ID to snd_ump_block_info_t structure
void | snd_ump_block_info_set_active (snd_ump_block_info_t *info, unsigned int active)
| set activeness to snd_ump_block_info_t structure
void | snd_ump_block_info_set_flags (snd_ump_block_info_t *info, unsigned int flags)
| set UMP block information flags to snd_ump_block_info_t structure
void | snd_ump_block_info_set_direction (snd_ump_block_info_t *info, unsigned int direction)
| set UMP block direction to snd_ump_block_info_t structure
void | snd_ump_block_info_set_first_group (snd_ump_block_info_t *info, unsigned int first_group)
| set first UMP group to snd_ump_block_info_t structure
void | snd_ump_block_info_set_num_groups (snd_ump_block_info_t *info, unsigned int num_groups)
| set number of UMP groups to snd_ump_block_info_t structure
void | snd_ump_block_info_set_midi_ci_version (snd_ump_block_info_t *info, unsigned int version)
| set MIDI-CI version number to snd_ump_block_info_t structure
void | snd_ump_block_info_set_sysex8_streams (snd_ump_block_info_t *info, unsigned int streams)
| set number of supported SysEx8 streams to snd_ump_block_info_t structure
void | snd_ump_block_info_set_ui_hint (snd_ump_block_info_t *info, unsigned int hint)
| set UI Hint to snd_ump_block_info_t structure
void | snd_ump_block_info_set_name (snd_ump_block_info_t *info, const char *name)
| set the name string to snd_ump_block_info_t structure

## Detailed Description

The RawMidi Interface. See RawMidi interface page for more details.

The RawMidi Interface. See RawMidi interface page for more details.

## Macro Definition Documentation

## ◆ SND_RAWMIDI_APPEND

#define SND_RAWMIDI_APPEND

Append (flag to open mode)

## ◆ SND_RAWMIDI_DLSYM_VERSION

#define SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001

dlsym version for interface entry callback

## ◆ snd_rawmidi_info_alloca

#define snd_rawmidi_info_alloca | ( |  | ptr | ) |

allocate an invalid snd_rawmidi_info_t using standard alloca

Parameters

  ptr | returned pointer

## ◆ SND_RAWMIDI_INFO_STREAM_INACTIVE

#define SND_RAWMIDI_INFO_STREAM_INACTIVE 0x00000010

the selected substream is inactive

## ◆ SND_RAWMIDI_INFO_UMP

#define SND_RAWMIDI_INFO_UMP 0x00000008

rawmidi info bit flags rawmidi is UMP

## ◆ SND_RAWMIDI_NONBLOCK

#define SND_RAWMIDI_NONBLOCK

Non blocking mode (flag to open mode)

## ◆ snd_rawmidi_params_alloca

#define snd_rawmidi_params_alloca | ( |  | ptr | ) |

allocate an invalid snd_rawmidi_params_t using standard alloca

Parameters

  ptr | returned pointer

## ◆ snd_rawmidi_status_alloca

#define snd_rawmidi_status_alloca | ( |  | ptr | ) |

allocate an invalid snd_rawmidi_status_t using standard alloca

Parameters

  ptr | returned pointer

## ◆ SND_RAWMIDI_SYNC

#define SND_RAWMIDI_SYNC

Write sync mode (Flag to open mode)

## ◆ snd_ump_block_info_alloca

#define snd_ump_block_info_alloca | ( |  | ptr | ) |

allocate an invalid snd_ump_block_info_t using standard alloca

Parameters

  ptr | returned pointer

## ◆ SND_UMP_BLOCK_INFO_DEFAULT_MIDI_CI_VERSION

#define SND_UMP_BLOCK_INFO_DEFAULT_MIDI_CI_VERSION 0x01

Default MIDI CI version passed to UMP Block info

## ◆ SND_UMP_BLOCK_IS_LOWSPEED

#define SND_UMP_BLOCK_IS_LOWSPEED (1U << 1)

Bit flag for 31.25Kbps B/W MIDI1 port in UMP Block info flags

## ◆ SND_UMP_BLOCK_IS_MIDI1

#define SND_UMP_BLOCK_IS_MIDI1 (1U << 0)

Bit flag for MIDI 1.0 port w/o restrict in UMP Block info flags

## ◆ snd_ump_endpoint_info_alloca

#define snd_ump_endpoint_info_alloca | ( |  | ptr | ) |

allocate an invalid snd_ump_endpoint_info_t using standard alloca

Parameters

  ptr | returned pointer

## ◆ SND_UMP_EP_INFO_DEFAULT_VERSION

#define SND_UMP_EP_INFO_DEFAULT_VERSION 0x0101

Default version passed to UMP Endpoint info

## ◆ SND_UMP_EP_INFO_PROTO_JRTS_MASK

#define SND_UMP_EP_INFO_PROTO_JRTS_MASK 0x0003

Bitmask for UMP Jitter-reduction timestamp

## ◆ SND_UMP_EP_INFO_PROTO_JRTS_RX

#define SND_UMP_EP_INFO_PROTO_JRTS_RX 0x0002

Bit flag for JRTS in Receive

## ◆ SND_UMP_EP_INFO_PROTO_JRTS_TX

#define SND_UMP_EP_INFO_PROTO_JRTS_TX 0x0001

Bit flag for JRTS in Transmit

## ◆ SND_UMP_EP_INFO_PROTO_MIDI1

#define SND_UMP_EP_INFO_PROTO_MIDI1 0x0100

Bit flag for MIDI 1.0 protocol

## ◆ SND_UMP_EP_INFO_PROTO_MIDI2

#define SND_UMP_EP_INFO_PROTO_MIDI2 0x0200

Bit flag for MIDI 2.0 protocol

## ◆ SND_UMP_EP_INFO_PROTO_MIDI_MASK

#define SND_UMP_EP_INFO_PROTO_MIDI_MASK 0x0300

Bitmask for UMP EP MIDI protocols

## ◆ SND_UMP_EP_INFO_STATIC_BLOCKS

#define SND_UMP_EP_INFO_STATIC_BLOCKS 0x01

UMP EP holds only static blocks

## ◆ SND_UMP_MAX_BLOCKS

#define SND_UMP_MAX_BLOCKS 32

Max number of UMP Blocks

## ◆ SND_UMP_MAX_GROUPS

#define SND_UMP_MAX_GROUPS 16

Max number of UMP Groups

## ◆ SNDRV_RAWMIDI_INFO_STREAM_INACTIVE

#define SNDRV_RAWMIDI_INFO_STREAM_INACTIVE SND_RAWMIDI_INFO_STREAM_INACTIVE

compatibility alias for SND_RAWMIDI_INFO_STREAM_INACTIVE

## Typedef Documentation

## ◆ snd_rawmidi_info_t

typedef struct _snd_rawmidi_info snd_rawmidi_info_t

RawMidi information container

## ◆ snd_rawmidi_params_t

typedef struct _snd_rawmidi_params snd_rawmidi_params_t

RawMidi settings container

## ◆ snd_rawmidi_status_t

typedef struct _snd_rawmidi_status snd_rawmidi_status_t

RawMidi status container

## ◆ snd_rawmidi_t

typedef struct _snd_rawmidi snd_rawmidi_t

RawMidi handle

## ◆ snd_ump_block_info_t

typedef struct snd_ump_block_info snd_ump_block_info_t

UMP Block information container

## ◆ snd_ump_endpoint_info_t

typedef struct snd_ump_endpoint_info snd_ump_endpoint_info_t

UMP Endpoint information container

## ◆ snd_ump_t

typedef struct _snd_ump snd_ump_t

UMP (Endpoint) RawMIDI device

## Enumeration Type Documentation

## ◆ _snd_ump_block_ui_hint

enum _snd_ump_block_ui_hint

UMP block user-interface hint

Enumerator
SND_UMP_BLOCK_UI_HINT_UNKNOWN | Unknown or undeclared
SND_UMP_BLOCK_UI_HINT_RECEIVER | Primarily a receiver or a destination for MIDI messages
SND_UMP_BLOCK_UI_HINT_SENDER | Primarily a sender or a source of MIDI messages
SND_UMP_BLOCK_UI_HINT_BOTH | Both a sender and receiver of MIDI messages

## ◆ _snd_ump_direction

enum _snd_ump_direction

UMP direction

Enumerator
SND_UMP_DIR_INPUT | Input only
SND_UMP_DIR_OUTPUT | Output only
SND_UMP_DIR_BIDIRECTION | Bidirectional

## ◆ snd_rawmidi_clock_t

enum snd_rawmidi_clock_t

Type of clock used with rawmidi timestamp

## ◆ snd_rawmidi_read_mode_t

enum snd_rawmidi_read_mode_t

Select the read mode (standard or with timestamps)

## ◆ snd_rawmidi_stream_t

enum snd_rawmidi_stream_t

RawMidi stream (direction)

Enumerator
SND_RAWMIDI_STREAM_OUTPUT | Output stream
SND_RAWMIDI_STREAM_INPUT | Input stream

## ◆ snd_rawmidi_type_t

enum snd_rawmidi_type_t

RawMidi type

Enumerator
SND_RAWMIDI_TYPE_HW | Kernel level RawMidi
SND_RAWMIDI_TYPE_SHM | Shared memory client RawMidi (not yet implemented)
SND_RAWMIDI_TYPE_INET | INET client RawMidi (not yet implemented)
SND_RAWMIDI_TYPE_VIRTUAL | Virtual (sequencer) RawMidi

## Function Documentation

## ◆ snd_rawmidi_close()

int snd_rawmidi_close | ( | snd_rawmidi_t * | rawmidi | ) |

close RawMidi handle

Parameters

  rawmidi | RawMidi handle

Returns
  0 on success otherwise a negative error code

Closes the specified RawMidi handle and frees all associated resources.

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_drain()

int snd_rawmidi_drain | ( | snd_rawmidi_t * | rawmidi | ) |

drain all bytes in the rawmidi I/O ring buffer

Parameters

  rawmidi | RawMidi handle

Returns
  0 on success otherwise a negative error code

Waits until all MIDI bytes are not drained (sent) to the hardware device.

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_drop()

int snd_rawmidi_drop | ( | snd_rawmidi_t * | rawmidi | ) |

drop all bytes in the rawmidi I/O ring buffer immediately

Parameters

  rawmidi | RawMidi handle

Returns
  0 on success otherwise a negative error code

## ◆ snd_rawmidi_info()

int snd_rawmidi_info | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_info_t * | info )

get information about RawMidi handle

Parameters

  rawmidi | RawMidi handle
  info | pointer to a snd_rawmidi_info_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_rawmidi_info_copy()

void snd_rawmidi_info_copy | ( | snd_rawmidi_info_t * | dst,
|  | const snd_rawmidi_info_t * | src )

copy one snd_rawmidi_info_t structure to another

Parameters

  dst | destination snd_rawmidi_info_t structure
  src | source snd_rawmidi_info_t structure

## ◆ snd_rawmidi_info_free()

void snd_rawmidi_info_free | ( | snd_rawmidi_info_t * | info | ) |

frees the snd_rawmidi_info_t structure

Parameters

  info | pointer to the snd_rawmidi_info_t structure to free

Frees the given snd_rawmidi_params_t structure using the standard free C library function.

## ◆ snd_rawmidi_info_get_card()

int snd_rawmidi_info_get_card | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi card number

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi card number

## ◆ snd_rawmidi_info_get_device()

unsigned int snd_rawmidi_info_get_device | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi device number

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi device number

## ◆ snd_rawmidi_info_get_flags()

unsigned int snd_rawmidi_info_get_flags | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi flags

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi flags

## ◆ snd_rawmidi_info_get_id()

const char * snd_rawmidi_info_get_id | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi hardware driver identifier

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi hardware driver identifier

## ◆ snd_rawmidi_info_get_name()

const char * snd_rawmidi_info_get_name | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi hardware driver name

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi hardware driver name

## ◆ snd_rawmidi_info_get_stream()

snd_rawmidi_stream_t snd_rawmidi_info_get_stream | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi stream identification

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi stream identification

## ◆ snd_rawmidi_info_get_subdevice()

unsigned int snd_rawmidi_info_get_subdevice | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi subdevice number

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi subdevice number

## ◆ snd_rawmidi_info_get_subdevice_name()

const char * snd_rawmidi_info_get_subdevice_name | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi subdevice name

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi subdevice name

## ◆ snd_rawmidi_info_get_subdevices_avail()

unsigned int snd_rawmidi_info_get_subdevices_avail | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi available count of subdevices

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi available count of subdevices

## ◆ snd_rawmidi_info_get_subdevices_count()

unsigned int snd_rawmidi_info_get_subdevices_count | ( | const snd_rawmidi_info_t * | info | ) |

get rawmidi count of subdevices

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  rawmidi count of subdevices

## ◆ snd_rawmidi_info_get_tied_device()

int snd_rawmidi_info_get_tied_device | ( | const snd_rawmidi_info_t * | info | ) |

get the tied device number for the given rawmidi device

Parameters

  info | pointer to a snd_rawmidi_info_t structure

Returns
  the device number for the tied device, or -1 if untied / unknown.

This function is useful for UMP rawmidi devices where each of them may have the mirroring legacy rawmidi device. Those are shown as "tied".

## ◆ snd_rawmidi_info_malloc()

int snd_rawmidi_info_malloc | ( | snd_rawmidi_info_t ** | info | ) |

allocate a new snd_rawmidi_info_t structure

Parameters

  info | returned pointer

Returns
  0 on success otherwise a negative error code if fails

Allocates a new snd_rawmidi_params_t structure using the standard malloc C library function.

## ◆ snd_rawmidi_info_set_device()

void snd_rawmidi_info_set_device | ( | snd_rawmidi_info_t * | info,
|  | unsigned int | val )

set rawmidi device number

Parameters

  info | pointer to a snd_rawmidi_info_t structure
  val | device number

## ◆ snd_rawmidi_info_set_stream()

void snd_rawmidi_info_set_stream | ( | snd_rawmidi_info_t * | info,
|  | snd_rawmidi_stream_t | val )

set rawmidi stream identifier

Parameters

  info | pointer to a snd_rawmidi_info_t structure
  val | rawmidi stream identifier

## ◆ snd_rawmidi_info_set_subdevice()

void snd_rawmidi_info_set_subdevice | ( | snd_rawmidi_info_t * | info,
|  | unsigned int | val )

set rawmidi subdevice number

Parameters

  info | pointer to a snd_rawmidi_info_t structure
  val | subdevice number

## ◆ snd_rawmidi_info_sizeof()

size_t snd_rawmidi_info_sizeof | ( | void |  | ) |

get size of the snd_rawmidi_info_t structure in bytes

Returns
  size of the snd_rawmidi_info_t structure in bytes

## ◆ snd_rawmidi_name()

const char * snd_rawmidi_name | ( | snd_rawmidi_t * | rawmidi | ) |

get identifier of RawMidi handle

Parameters

  rawmidi | a RawMidi handle

Returns
  ascii identifier of RawMidi handle

Returns the ASCII identifier of given RawMidi handle. It's the same identifier specified in snd_rawmidi_open().

## ◆ snd_rawmidi_nonblock()

int snd_rawmidi_nonblock | ( | snd_rawmidi_t * | rawmidi,
|  | int | nonblock )

set nonblock mode

Parameters

  rawmidi | RawMidi handle
  nonblock | 0 = block, 1 = nonblock mode

Returns
  0 on success otherwise a negative error code

The nonblock mode cannot be used when the stream is in SND_RAWMIDI_APPEND state.

## ◆ snd_rawmidi_open()

int snd_rawmidi_open | ( | snd_rawmidi_t ** | inputp,
|  | snd_rawmidi_t ** | outputp,
|  | const char * | name,
|  | int | mode )

Opens a new connection to the RawMidi interface.

Parameters

  inputp | Returned input handle (NULL if not wanted)
  outputp | Returned output handle (NULL if not wanted)
  name | ASCII identifier of the RawMidi handle
  mode | Open mode

Returns
  0 on success otherwise a negative error code

Opens a new connection to the RawMidi interface specified with an ASCII identifier and mode.

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_open_lconf()

int snd_rawmidi_open_lconf | ( | snd_rawmidi_t ** | inputp,
|  | snd_rawmidi_t ** | outputp,
|  | const char * | name,
|  | int | mode,
|  | snd_config_t * | lconf )

Opens a new connection to the RawMidi interface using local configuration.

Parameters

  inputp | Returned input handle (NULL if not wanted)
  outputp | Returned output handle (NULL if not wanted)
  name | ASCII identifier of the RawMidi handle
  mode | Open mode
  lconf | Local configuration

Returns
  0 on success otherwise a negative error code

Opens a new connection to the RawMidi interface specified with an ASCII identifier and mode.

## ◆ snd_rawmidi_params()

int snd_rawmidi_params | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params )

set parameters about rawmidi stream

Parameters

  rawmidi | RawMidi handle
  params | pointer to a snd_rawmidi_params_t structure to be filled

Returns
  0 on success otherwise a negative error code

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_params_copy()

void snd_rawmidi_params_copy | ( | snd_rawmidi_params_t * | dst,
|  | const snd_rawmidi_params_t * | src )

copy one snd_rawmidi_params_t structure to another

Parameters

  dst | destination snd_rawmidi_params_t structure
  src | source snd_rawmidi_params_t structure

## ◆ snd_rawmidi_params_current()

int snd_rawmidi_params_current | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params )

get current parameters about rawmidi stream

Parameters

  rawmidi | RawMidi handle
  params | pointer to a snd_rawmidi_params_t structure to be filled

Returns
  0 on success otherwise a negative error code

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_params_free()

void snd_rawmidi_params_free | ( | snd_rawmidi_params_t * | params | ) |

frees the snd_rawmidi_params_t structure

Parameters

  params | pointer to the snd_rawmidi_params_t structure to free

Frees the given snd_rawmidi_params_t structure using the standard free C library function.

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_params_get_avail_min()

size_t snd_rawmidi_params_get_avail_min | ( | const snd_rawmidi_params_t * | params | ) |

get minimum available bytes in rawmidi I/O ring buffer for wakeup

Parameters

  params | pointer to snd_rawmidi_params_t structure

Returns
  minimum available bytes

## ◆ snd_rawmidi_params_get_buffer_size()

size_t snd_rawmidi_params_get_buffer_size | ( | const snd_rawmidi_params_t * | params | ) |

get rawmidi I/O ring buffer size

Parameters

  params | pointer to a snd_rawmidi_params_t structure

Returns
  size of rawmidi I/O ring buffer in bytes

## ◆ snd_rawmidi_params_get_clock_type()

snd_rawmidi_clock_t snd_rawmidi_params_get_clock_type | ( | const snd_rawmidi_params_t * | params | ) |

get current clock type (for tstamp type framing)

Parameters

  params | pointer to snd_rawmidi_params_t structure

Returns
  the current clock type (one of the SND_RAWMIDI_CLOCK_* constants)

## ◆ snd_rawmidi_params_get_no_active_sensing()

int snd_rawmidi_params_get_no_active_sensing | ( | const snd_rawmidi_params_t * | params | ) |

get no-active-sensing action status

Parameters

  params | pointer to snd_rawmidi_params_t structure

Returns
  the current status (0 = enable, 1 = disable the active sensing message)

## ◆ snd_rawmidi_params_get_read_mode()

snd_rawmidi_read_mode_t snd_rawmidi_params_get_read_mode | ( | const snd_rawmidi_params_t * | params | ) |

get current read mode

Parameters

  params | pointer to snd_rawmidi_params_t structure

Returns
  the current read mode (see enum)

## ◆ snd_rawmidi_params_malloc()

int snd_rawmidi_params_malloc | ( | snd_rawmidi_params_t ** | params | ) |

allocate the snd_rawmidi_params_t structure

Parameters

  params | returned pointer

Returns
  0 on success otherwise a negative error code if fails

Allocates a new snd_rawmidi_params_t structure using the standard malloc C library function.

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_params_set_avail_min()

int snd_rawmidi_params_set_avail_min | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params,
|  | size_t | val )

set minimum available bytes in rawmidi I/O ring buffer for wakeup

Parameters

  rawmidi | RawMidi handle
  params | pointer to a snd_rawmidi_params_t structure
  val | desired value

## ◆ snd_rawmidi_params_set_buffer_size()

int snd_rawmidi_params_set_buffer_size | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params,
|  | size_t | val )

set rawmidi I/O ring buffer size

Parameters

  rawmidi | RawMidi handle
  params | pointer to a snd_rawmidi_params_t structure
  val | size in bytes

Returns
  0 on success otherwise a negative error code

## ◆ snd_rawmidi_params_set_clock_type()

int snd_rawmidi_params_set_clock_type | ( | const snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params,
|  | snd_rawmidi_clock_t | val )

sets clock type for tstamp type framing

Parameters

  rawmidi | RawMidi handle
  params | pointer to snd_rawmidi_params_t structure
  val | one of the SND_RAWMIDI_CLOCK_* constants

Returns
  0 on success, otherwise a negative error code.

Notable error codes: -EINVAL - "val" is invalid -ENOTSUP - Kernel is too old to support framing.

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_params_set_no_active_sensing()

int snd_rawmidi_params_set_no_active_sensing | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params,
|  | int | val )

set no-active-sensing action on snd_rawmidi_close()

Parameters

  rawmidi | RawMidi handle
  params | pointer to snd_rawmidi_params_t structure
  val | value: 0 = enable to send the active sensing message, 1 = disable

Returns
  0 on success otherwise a negative error code

## ◆ snd_rawmidi_params_set_read_mode()

int snd_rawmidi_params_set_read_mode | ( | const snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_params_t * | params,
|  | snd_rawmidi_read_mode_t | val )

set read mode

Parameters

  rawmidi | RawMidi handle
  params | pointer to snd_rawmidi_params_t structure
  val | type of read_mode

Returns
  0 on success, otherwise a negative error code.

Notable error codes: -EINVAL - "val" is invalid -ENOTSUP - mode is not supported

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_params_sizeof()

size_t snd_rawmidi_params_sizeof | ( | void |  | ) |

get size of the snd_rawmidi_params_t structure in bytes

Returns
  size of the snd_rawmidi_params_t structure in bytes

## ◆ snd_rawmidi_poll_descriptors()

int snd_rawmidi_poll_descriptors | ( | snd_rawmidi_t * | rawmidi,
|  | struct pollfd * | pfds,
|  | unsigned int | space )

get poll descriptors

Parameters

  rawmidi | RawMidi handle
  pfds | array of poll descriptors
  space | space in the poll descriptor array

Returns
  count of filled descriptors

## ◆ snd_rawmidi_poll_descriptors_count()

int snd_rawmidi_poll_descriptors_count | ( | snd_rawmidi_t * | rawmidi | ) |

get count of poll descriptors for RawMidi handle

Parameters

  rawmidi | RawMidi handle

Returns
  count of poll descriptors

## ◆ snd_rawmidi_poll_descriptors_revents()

int snd_rawmidi_poll_descriptors_revents | ( | snd_rawmidi_t * | rawmidi,
|  | struct pollfd * | pfds,
|  | unsigned int | nfds,
|  | unsigned short * | revents )

get returned events from poll descriptors

Parameters

  rawmidi | rawmidi RawMidi handle
  pfds | array of poll descriptors
  nfds | count of poll descriptors
  revents | returned events

Returns
  zero if success, otherwise a negative error code

## ◆ snd_rawmidi_read()

ssize_t snd_rawmidi_read | ( | snd_rawmidi_t * | rawmidi,
|  | void * | buffer,
|  | size_t | size )

read MIDI bytes from MIDI stream

Parameters

  rawmidi | RawMidi handle
  buffer | buffer to store the input MIDI bytes
  size | input buffer size in bytes

Return values

  count | of MIDI bytes otherwise a negative error code

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_status()

int snd_rawmidi_status | ( | snd_rawmidi_t * | rawmidi,
|  | snd_rawmidi_status_t * | status )

get status of rawmidi stream

Parameters

  rawmidi | RawMidi handle
  status | pointer to a snd_rawmidi_status_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_rawmidi_status_copy()

void snd_rawmidi_status_copy | ( | snd_rawmidi_status_t * | dst,
|  | const snd_rawmidi_status_t * | src )

copy one snd_rawmidi_status_t structure to another

Parameters

  dst | destination snd_rawmidi_status_t structure
  src | source snd_rawmidi_status_t structure

## ◆ snd_rawmidi_status_free()

void snd_rawmidi_status_free | ( | snd_rawmidi_status_t * | status | ) |

frees the snd_rawmidi_status_t structure

Parameters

  status | pointer to the snd_rawmidi_status_t structure to free

Frees the given snd_rawmidi_status_t structure using the standard free C library function.

## ◆ snd_rawmidi_status_get_avail()

size_t snd_rawmidi_status_get_avail | ( | const snd_rawmidi_status_t * | status | ) |

get current available bytes in the rawmidi I/O ring buffer

Parameters

  status | pointer to a snd_rawmidi_status_t structure

Returns
  current available bytes in the rawmidi I/O ring buffer

## ◆ snd_rawmidi_status_get_tstamp()

void snd_rawmidi_status_get_tstamp | ( | const snd_rawmidi_status_t * | status,
|  | snd_htimestamp_t * | tstamp )

get the start timestamp

Parameters

  status | pointer to a snd_rawmidi_status_t structure
  tstamp | returned timestamp value

## ◆ snd_rawmidi_status_get_xruns()

size_t snd_rawmidi_status_get_xruns | ( | const snd_rawmidi_status_t * | status | ) |

get count of xruns

Parameters

  status | pointer to a snd_rawmidi_status_t structure

Returns
  count of xruns

## ◆ snd_rawmidi_status_malloc()

int snd_rawmidi_status_malloc | ( | snd_rawmidi_status_t ** | ptr | ) |

allocate the snd_rawmidi_status_t structure

Parameters

  ptr | returned pointer

Returns
  0 on success otherwise a negative error code if fails

Allocates a new snd_rawmidi_status_t structure using the standard malloc C library function.

## ◆ snd_rawmidi_status_sizeof()

size_t snd_rawmidi_status_sizeof | ( | void |  | ) |

get size of the snd_rawmidi_status_t structure in bytes

Returns
  size of the snd_rawmidi_status_t structure in bytes

## ◆ snd_rawmidi_stream()

snd_rawmidi_stream_t snd_rawmidi_stream | ( | snd_rawmidi_t * | rawmidi | ) |

get stream (direction) of RawMidi handle

Parameters

  rawmidi | a RawMidi handle

Returns
  stream of RawMidi handle

Returns the stream snd_rawmidi_stream_t of given RawMidi handle.

## ◆ snd_rawmidi_tread()

ssize_t snd_rawmidi_tread | ( | snd_rawmidi_t * | rawmidi,
|  | struct timespec * | tstamp,
|  | void * | buffer,
|  | size_t | size )

read MIDI bytes from MIDI stream with timestamp

Parameters

  | rawmidi | RawMidi handle
  [out] | tstamp | timestamp for the returned MIDI bytes
  | buffer | buffer to store the input MIDI bytes
  | size | input buffer size in bytes

Return values

  count | of MIDI bytes otherwise a negative error code

Examples
  /test/rawmidi.c.

## ◆ snd_rawmidi_type()

snd_rawmidi_type_t snd_rawmidi_type | ( | snd_rawmidi_t * | rawmidi | ) |

get type of RawMidi handle

Parameters

  rawmidi | a RawMidi handle

Returns
  type of RawMidi handle

Returns the type snd_rawmidi_type_t of given RawMidi handle.

## ◆ snd_rawmidi_write()

ssize_t snd_rawmidi_write | ( | snd_rawmidi_t * | rawmidi,
|  | const void * | buffer,
|  | size_t | size )

write MIDI bytes to MIDI stream

Parameters

  rawmidi | RawMidi handle
  buffer | buffer containing MIDI bytes
  size | output buffer size in bytes

Examples
  /test/rawmidi.c.

## ◆ snd_ump_block_info()

int snd_ump_block_info | ( | snd_ump_t * | ump,
|  | snd_ump_block_info_t * | info )

get UMP block information

Parameters

  ump | UMP handle
  info | pointer to a snd_ump_block_info_t structure

Returns
  0 on success otherwise a negative error code

The caller should fill the block ID to query at first via snd_ump_block_info_set_block_id().

## ◆ snd_ump_block_info_clear()

void snd_ump_block_info_clear | ( | snd_ump_block_info_t * | info | ) |

clears the snd_ump_block_info_t structure

Parameters

  info | pointer to the snd_ump_block_info_t structure to clear

Zero-clear the snd_ump_block_info_t object.

## ◆ snd_ump_block_info_copy()

void snd_ump_block_info_copy | ( | snd_ump_block_info_t * | dst,
|  | const snd_ump_block_info_t * | src )

copy one snd_ump_block_info_t structure to another

Parameters

  dst | destination snd_ump_block_info_t structure
  src | source snd_ump_block_info_t structure

## ◆ snd_ump_block_info_free()

void snd_ump_block_info_free | ( | snd_ump_block_info_t * | info | ) |

frees the snd_ump_block_info_t structure

Parameters

  info | pointer to the snd_ump_block_info_t structure to free

Frees the given snd_ump_block_info_t structure using the standard free C library function.

## ◆ snd_ump_block_info_get_active()

unsigned int snd_ump_block_info_get_active | ( | const snd_ump_block_info_t * | info | ) |

get UMP block activeness

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  1 if the block is active or 0 if inactive

## ◆ snd_ump_block_info_get_block_id()

unsigned int snd_ump_block_info_get_block_id | ( | const snd_ump_block_info_t * | info | ) |

get UMP block ID

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  ID number of the given UMP block

## ◆ snd_ump_block_info_get_card()

int snd_ump_block_info_get_card | ( | const snd_ump_block_info_t * | info | ) |

get card number of UMP block

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  the card number of the given UMP block

## ◆ snd_ump_block_info_get_device()

int snd_ump_block_info_get_device | ( | const snd_ump_block_info_t * | info | ) |

get device number of UMP block

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  the device number of the given UMP block

## ◆ snd_ump_block_info_get_direction()

unsigned int snd_ump_block_info_get_direction | ( | const snd_ump_block_info_t * | info | ) |

get UMP block direction

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  direction of UMP block (input,output,bidirectional)

## ◆ snd_ump_block_info_get_first_group()

unsigned int snd_ump_block_info_get_first_group | ( | const snd_ump_block_info_t * | info | ) |

get first UMP group ID belonging to the block

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  the first UMP group ID belonging to the block

## ◆ snd_ump_block_info_get_flags()

unsigned int snd_ump_block_info_get_flags | ( | const snd_ump_block_info_t * | info | ) |

get UMP block information flags

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  info flag bits for the given UMP block

## ◆ snd_ump_block_info_get_midi_ci_version()

unsigned int snd_ump_block_info_get_midi_ci_version | ( | const snd_ump_block_info_t * | info | ) |

get MIDI-CI version number

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  MIDI-CI version number

## ◆ snd_ump_block_info_get_name()

const char * snd_ump_block_info_get_name | ( | const snd_ump_block_info_t * | info | ) |

get the name string of UMP block

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  the name string of UMP block

## ◆ snd_ump_block_info_get_num_groups()

unsigned int snd_ump_block_info_get_num_groups | ( | const snd_ump_block_info_t * | info | ) |

get number of UMP groups belonging to the block

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  the number of UMP groups belonging to the block

## ◆ snd_ump_block_info_get_sysex8_streams()

unsigned int snd_ump_block_info_get_sysex8_streams | ( | const snd_ump_block_info_t * | info | ) |

get number of supported SysEx8 streams

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  number of supported SysEx8 streams

## ◆ snd_ump_block_info_get_ui_hint()

unsigned int snd_ump_block_info_get_ui_hint | ( | const snd_ump_block_info_t * | info | ) |

get UI hint of the given UMP block

Parameters

  info | pointer to a snd_ump_block_info_t structure

Returns
  the hint bits

## ◆ snd_ump_block_info_malloc()

int snd_ump_block_info_malloc | ( | snd_ump_block_info_t ** | info | ) |

allocate the snd_ump_block_info_t structure

Parameters

  info | returned pointer

Returns
  0 on success otherwise a negative error code if fails

Allocates a new snd_ump_block_info_t structure using the standard malloc C library function.

## ◆ snd_ump_block_info_set_active()

void snd_ump_block_info_set_active | ( | snd_ump_block_info_t * | info,
|  | unsigned int | active )

set activeness to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  active | 1 if the block is active or 0 if inactive

## ◆ snd_ump_block_info_set_block_id()

void snd_ump_block_info_set_block_id | ( | snd_ump_block_info_t * | info,
|  | unsigned int | id )

set UMP block ID to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  id | the ID number

This function is mostly used for setting the block ID to query.

## ◆ snd_ump_block_info_set_card()

void snd_ump_block_info_set_card | ( | snd_ump_block_info_t * | info,
|  | unsigned int | card )

set card number to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  card | the card number

## ◆ snd_ump_block_info_set_device()

void snd_ump_block_info_set_device | ( | snd_ump_block_info_t * | info,
|  | unsigned int | device )

set device number to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  device | the device number

## ◆ snd_ump_block_info_set_direction()

void snd_ump_block_info_set_direction | ( | snd_ump_block_info_t * | info,
|  | unsigned int | direction )

set UMP block direction to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  direction | direction of UMP block (input,output,bidirectional)

## ◆ snd_ump_block_info_set_first_group()

void snd_ump_block_info_set_first_group | ( | snd_ump_block_info_t * | info,
|  | unsigned int | first_group )

set first UMP group to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  first_group | the first UMP group ID belonging to the block

## ◆ snd_ump_block_info_set_flags()

void snd_ump_block_info_set_flags | ( | snd_ump_block_info_t * | info,
|  | unsigned int | flags )

set UMP block information flags to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  flags | flag bits for the given UMP block

## ◆ snd_ump_block_info_set_midi_ci_version()

void snd_ump_block_info_set_midi_ci_version | ( | snd_ump_block_info_t * | info,
|  | unsigned int | version )

set MIDI-CI version number to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  version | MIDI-CI version number

## ◆ snd_ump_block_info_set_name()

void snd_ump_block_info_set_name | ( | snd_ump_block_info_t * | info,
|  | const char * | name )

set the name string to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  name | the name string of UMP block

## ◆ snd_ump_block_info_set_num_groups()

void snd_ump_block_info_set_num_groups | ( | snd_ump_block_info_t * | info,
|  | unsigned int | num_groups )

set number of UMP groups to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  num_groups | the number of UMP groups belonging to the block

## ◆ snd_ump_block_info_set_sysex8_streams()

void snd_ump_block_info_set_sysex8_streams | ( | snd_ump_block_info_t * | info,
|  | unsigned int | streams )

set number of supported SysEx8 streams to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  streams | number of supported SysEx8 streams

## ◆ snd_ump_block_info_set_ui_hint()

void snd_ump_block_info_set_ui_hint | ( | snd_ump_block_info_t * | info,
|  | unsigned int | hint )

set UI Hint to snd_ump_block_info_t structure

Parameters

  info | pointer to a snd_ump_block_info_t structure
  hint | the hint bits

## ◆ snd_ump_block_info_sizeof()

size_t snd_ump_block_info_sizeof | ( | void |  | ) |

get size of the snd_ump_block_info_t structure in bytes

Returns
  size of the snd_ump_block_info_t structure in bytes

## ◆ snd_ump_close()

int snd_ump_close | ( | snd_ump_t * | ump | ) |

close UMP handle

Parameters

  ump | UMP handle

Returns
  0 on success otherwise a negative error code

Closes the specified UMP handle and frees all associated resources.

## ◆ snd_ump_drain()

int snd_ump_drain | ( | snd_ump_t * | ump | ) |

drain all packets in the UMP I/O ring buffer

Parameters

  ump | UMP handle

Returns
  0 on success otherwise a negative error code

Waits until all MIDI packets are not drained (sent) to the hardware device.

## ◆ snd_ump_drop()

int snd_ump_drop | ( | snd_ump_t * | ump | ) |

drop all packets in the rawmidi I/O ring buffer immediately

Parameters

  ump | UMP handle

Returns
  0 on success otherwise a negative error code

## ◆ snd_ump_endpoint_info()

int snd_ump_endpoint_info | ( | snd_ump_t * | ump,
|  | snd_ump_endpoint_info_t * | info )

get endpoint information about UMP handle

Parameters

  ump | UMP handle
  info | pointer to a snd_ump_endpoint_info_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_ump_endpoint_info_clear()

void snd_ump_endpoint_info_clear | ( | snd_ump_endpoint_info_t * | info | ) |

clears the snd_ump_endpoint_info_t structure

Parameters

  info | pointer to the snd_ump_endpoint_info_t structure to clear

Zero-clear the snd_ump_endpoint_info_t object.

## ◆ snd_ump_endpoint_info_copy()

void snd_ump_endpoint_info_copy | ( | snd_ump_endpoint_info_t * | dst,
|  | const snd_ump_endpoint_info_t * | src )

copy one snd_ump_endpoint_info_t structure to another

Parameters

  dst | destination snd_ump_endpoint_info_t structure
  src | source snd_ump_endpoint_info_t structure

## ◆ snd_ump_endpoint_info_free()

void snd_ump_endpoint_info_free | ( | snd_ump_endpoint_info_t * | info | ) |

frees the snd_ump_endpoint_info_t structure

Parameters

  info | pointer to the snd_ump_endpoint_info_t structure to free

Frees the given snd_ump_endpoint_info_t structure using the standard free C library function.

## ◆ snd_ump_endpoint_info_get_card()

int snd_ump_endpoint_info_get_card | ( | const snd_ump_endpoint_info_t * | info | ) |

get card number of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  the card number of the given UMP endpoint

## ◆ snd_ump_endpoint_info_get_device()

int snd_ump_endpoint_info_get_device | ( | const snd_ump_endpoint_info_t * | info | ) |

get device number of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  the device number of the given UMP endpoint

## ◆ snd_ump_endpoint_info_get_family_id()

unsigned int snd_ump_endpoint_info_get_family_id | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP family ID

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP family ID

## ◆ snd_ump_endpoint_info_get_flags()

unsigned int snd_ump_endpoint_info_get_flags | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP endpoint info flags

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP endpoint flag bits

## ◆ snd_ump_endpoint_info_get_manufacturer_id()

unsigned int snd_ump_endpoint_info_get_manufacturer_id | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP manufacturer ID

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP manufacturer ID

## ◆ snd_ump_endpoint_info_get_model_id()

unsigned int snd_ump_endpoint_info_get_model_id | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP model ID

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP model ID

## ◆ snd_ump_endpoint_info_get_name()

const char * snd_ump_endpoint_info_get_name | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP endpoint name string

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP endpoint name string

## ◆ snd_ump_endpoint_info_get_num_blocks()

unsigned int snd_ump_endpoint_info_get_num_blocks | ( | const snd_ump_endpoint_info_t * | info | ) |

get the number of UMP blocks belonging to the endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  number of UMP blocks

## ◆ snd_ump_endpoint_info_get_product_id()

const char * snd_ump_endpoint_info_get_product_id | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP endpoint product ID string

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP endpoint product ID string

## ◆ snd_ump_endpoint_info_get_protocol()

unsigned int snd_ump_endpoint_info_get_protocol | ( | const snd_ump_endpoint_info_t * | info | ) |

get the current UMP endpoint protocol

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP endpoint protocol bits

## ◆ snd_ump_endpoint_info_get_protocol_caps()

unsigned int snd_ump_endpoint_info_get_protocol_caps | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP endpoint protocol capability bits

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP endpoint protocol capability bits

## ◆ snd_ump_endpoint_info_get_sw_revision()

const unsigned char * snd_ump_endpoint_info_get_sw_revision | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP software revision

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP software revision

## ◆ snd_ump_endpoint_info_get_version()

unsigned int snd_ump_endpoint_info_get_version | ( | const snd_ump_endpoint_info_t * | info | ) |

get UMP version number

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure

Returns
  UMP version number

## ◆ snd_ump_endpoint_info_malloc()

int snd_ump_endpoint_info_malloc | ( | snd_ump_endpoint_info_t ** | info | ) |

allocate the snd_ump_endpoint_info_t structure

Parameters

  info | returned pointer

Returns
  0 on success otherwise a negative error code if fails

Allocates a new snd_rawmidi_status_t structure using the standard malloc C library function.

## ◆ snd_ump_endpoint_info_set_card()

void snd_ump_endpoint_info_set_card | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | card )

set card number of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  card | the card number of the given UMP endpoint

## ◆ snd_ump_endpoint_info_set_device()

void snd_ump_endpoint_info_set_device | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | device )

set device number of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  device | the device number of the given UMP endpoint

## ◆ snd_ump_endpoint_info_set_family_id()

void snd_ump_endpoint_info_set_family_id | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | id )

set the UMP family ID of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  id | UMP family ID

## ◆ snd_ump_endpoint_info_set_flags()

void snd_ump_endpoint_info_set_flags | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | flags )

set info flags of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  flags | UMP endpoint flag bits

## ◆ snd_ump_endpoint_info_set_manufacturer_id()

void snd_ump_endpoint_info_set_manufacturer_id | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | id )

set the UMP manufacturer ID of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  id | UMP manufacturer ID

## ◆ snd_ump_endpoint_info_set_model_id()

void snd_ump_endpoint_info_set_model_id | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | id )

set the UMP model ID of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  id | UMP model ID

## ◆ snd_ump_endpoint_info_set_name()

void snd_ump_endpoint_info_set_name | ( | snd_ump_endpoint_info_t * | info,
|  | const char * | name )

set the name of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  name | UMP endpoint name string

## ◆ snd_ump_endpoint_info_set_num_blocks()

void snd_ump_endpoint_info_set_num_blocks | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | blocks )

set the number of UMP blocks of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  blocks | the number of UMP blocks

## ◆ snd_ump_endpoint_info_set_product_id()

void snd_ump_endpoint_info_set_product_id | ( | snd_ump_endpoint_info_t * | info,
|  | const char * | id )

set the product ID string of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  id | UMP endpoint product ID string

## ◆ snd_ump_endpoint_info_set_protocol()

void snd_ump_endpoint_info_set_protocol | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | protocol )

set the current protocol of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  protocol | the UMP endpoint protocol bits

## ◆ snd_ump_endpoint_info_set_protocol_caps()

void snd_ump_endpoint_info_set_protocol_caps | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | caps )

set protocol capability bits of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  caps | UMP endpoint protocol capability bits

## ◆ snd_ump_endpoint_info_set_sw_revision()

void snd_ump_endpoint_info_set_sw_revision | ( | snd_ump_endpoint_info_t * | info,
|  | const unsigned char * | id )

set the UMP software revision of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  id | UMP software revision in 4 bytes array

## ◆ snd_ump_endpoint_info_set_version()

void snd_ump_endpoint_info_set_version | ( | snd_ump_endpoint_info_t * | info,
|  | unsigned int | version )

set the UMP version number of UMP endpoint

Parameters

  info | pointer to a snd_ump_endpoint_info_t structure
  version | the UMP version number

## ◆ snd_ump_endpoint_info_sizeof()

size_t snd_ump_endpoint_info_sizeof | ( | void |  | ) |

get size of the snd_ump_endpoint_info_t structure in bytes

Returns
  size of the snd_ump_endpoint_info_t structure in bytes

## ◆ snd_ump_name()

const char * snd_ump_name | ( | snd_ump_t * | ump | ) |

get identifier of UMP handle

Parameters

  ump | UMP handle

Returns
  ascii identifier of UMP handle

Returns the ASCII identifier of given UMP handle. It's the same identifier specified in snd_ump_open().

## ◆ snd_ump_nonblock()

int snd_ump_nonblock | ( | snd_ump_t * | ump,
|  | int | nonblock )

set nonblock mode

Parameters

  ump | UMP handle
  nonblock | 0 = block, 1 = nonblock mode

Returns
  0 on success otherwise a negative error code

The nonblock mode cannot be used when the stream is in SND_RAWMIDI_APPEND state.

## ◆ snd_ump_open()

int snd_ump_open | ( | snd_ump_t ** | inputp,
|  | snd_ump_t ** | outputp,
|  | const char * | name,
|  | int | mode )

Opens a new connection to the UMP interface.

Parameters

  inputp | Returned input handle (NULL if not wanted)
  outputp | Returned output handle (NULL if not wanted)
  name | ASCII identifier of the UMP handle
  mode | Open mode

Returns
  0 on success otherwise a negative error code

Opens a new connection to the UMP interface specified with an ASCII identifier and mode.

## ◆ snd_ump_poll_descriptors()

int snd_ump_poll_descriptors | ( | snd_ump_t * | ump,
|  | struct pollfd * | pfds,
|  | unsigned int | space )

get poll descriptors

Parameters

  ump | UMP handle
  pfds | array of poll descriptors
  space | space in the poll descriptor array

Returns
  count of filled descriptors

## ◆ snd_ump_poll_descriptors_count()

int snd_ump_poll_descriptors_count | ( | snd_ump_t * | ump | ) |

get count of poll descriptors for UMP handle

Parameters

  ump | UMP handle

Returns
  count of poll descriptors

## ◆ snd_ump_poll_descriptors_revents()

int snd_ump_poll_descriptors_revents | ( | snd_ump_t * | ump,
|  | struct pollfd * | pfds,
|  | unsigned int | nfds,
|  | unsigned short * | revents )

get returned events from poll descriptors

Parameters

  ump | UMP handle
  pfds | array of poll descriptors
  nfds | count of poll descriptors
  revents | returned events

Returns
  zero if success, otherwise a negative error code

## ◆ snd_ump_rawmidi()

snd_rawmidi_t * snd_ump_rawmidi | ( | snd_ump_t * | ump | ) |

get RawMidi instance associated with the UMP handle

Parameters

  ump | UMP handle

Returns
  the associated RawMidi handle

Returns the associated RawMidi instance with the given UMP handle

## ◆ snd_ump_rawmidi_info()

int snd_ump_rawmidi_info | ( | snd_ump_t * | ump,
|  | snd_rawmidi_info_t * | info )

get information about associated RawMidi handle

Parameters

  ump | UMP handle
  info | pointer to a snd_rawmidi_info_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_ump_rawmidi_params()

int snd_ump_rawmidi_params | ( | snd_ump_t * | ump,
|  | snd_rawmidi_params_t * | params )

set parameters about associated RawMidi stream

Parameters

  ump | UMP handle
  params | pointer to a snd_rawmidi_params_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_ump_rawmidi_params_current()

int snd_ump_rawmidi_params_current | ( | snd_ump_t * | ump,
|  | snd_rawmidi_params_t * | params )

get current parameters about associated RawMidi stream

Parameters

  ump | UMP handle
  params | pointer to a snd_rawmidi_params_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_ump_rawmidi_status()

int snd_ump_rawmidi_status | ( | snd_ump_t * | ump,
|  | snd_rawmidi_status_t * | status )

get status of associated RawMidi stream

Parameters

  ump | UMP handle
  status | pointer to a snd_rawmidi_status_t structure to be filled

Returns
  0 on success otherwise a negative error code

## ◆ snd_ump_read()

ssize_t snd_ump_read | ( | snd_ump_t * | ump,
|  | void * | buffer,
|  | size_t | size )

read UMP packets from UMP stream

Parameters

  ump | UMP handle
  buffer | buffer to store the input MIDI bytes
  size | input buffer size in bytes

Return values

  count | of UMP packet in bytes otherwise a negative error code

## ◆ snd_ump_tread()

ssize_t snd_ump_tread | ( | snd_ump_t * | ump,
|  | struct timespec * | tstamp,
|  | void * | buffer,
|  | size_t | size )

read UMP packets from UMP stream with timestamp

Parameters

  | ump | UMP handle
  [out] | tstamp | timestamp for the returned UMP packets
  | buffer | buffer to store the input UMP packets
  | size | input buffer size in bytes

Return values

  count | of UMP packet in bytes otherwise a negative error code

## ◆ snd_ump_write()

ssize_t snd_ump_write | ( | snd_ump_t * | ump,
|  | const void * | buffer,
|  | size_t | size )

write UMP packets to UMP stream

Parameters

  ump | UMP handle
  buffer | buffer containing UMP packets
  size | output buffer size in bytes