ALSA project - the C library reference
Loading...
Searching...
No Matches
ump.c File Reference

Universal MIDI Protocol (UMP) Interface. More...

Functions

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
 
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 protocol)
 set the current protocol of UMP endpoint
 
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
 
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
 
int snd_ump_endpoint_info (snd_ump_t *ump, snd_ump_endpoint_info_t *info)
 get endpoint information about UMP handle
 
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
 
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
 
int snd_ump_block_info (snd_ump_t *ump, snd_ump_block_info_t *info)
 get UMP block information
 
int snd_ump_msg_sysex_expand (const uint32_t *ump, uint8_t *buf, size_t maxlen, size_t *filled)
 fill sysex byte from a UMP packet
 
int snd_ump_packet_length (unsigned int type)
 return the length of a UMP packet type
 

Detailed Description

Universal MIDI Protocol (UMP) Interface.

Function Documentation

◆ snd_ump_block_info()

int snd_ump_block_info ( snd_ump_t * ump,
snd_ump_block_info_t * info )

get UMP block information

Parameters
umpUMP handle
infopointer 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
infopointer 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
dstdestination snd_ump_block_info_t structure
srcsource 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
inforeturned 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
infopointer to a snd_ump_block_info_t structure
active1 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
infopointer to a snd_ump_block_info_t structure
idthe 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
infopointer to a snd_ump_block_info_t structure
cardthe 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
infopointer to a snd_ump_block_info_t structure
devicethe 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
infopointer to a snd_ump_block_info_t structure
directiondirection 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
infopointer to a snd_ump_block_info_t structure
first_groupthe 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
infopointer to a snd_ump_block_info_t structure
flagsflag 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
infopointer to a snd_ump_block_info_t structure
versionMIDI-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
infopointer to a snd_ump_block_info_t structure
namethe 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
infopointer to a snd_ump_block_info_t structure
num_groupsthe 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
infopointer to a snd_ump_block_info_t structure
streamsnumber 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
infopointer to a snd_ump_block_info_t structure
hintthe 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
umpUMP 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
umpUMP 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
umpUMP 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
umpUMP handle
infopointer 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
infopointer 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
dstdestination snd_ump_endpoint_info_t structure
srcsource 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
infopointer 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
inforeturned 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
infopointer to a snd_ump_endpoint_info_t structure
cardthe 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
infopointer to a snd_ump_endpoint_info_t structure
devicethe 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
infopointer to a snd_ump_endpoint_info_t structure
idUMP 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
infopointer to a snd_ump_endpoint_info_t structure
flagsUMP 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
infopointer to a snd_ump_endpoint_info_t structure
idUMP 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
infopointer to a snd_ump_endpoint_info_t structure
idUMP 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
infopointer to a snd_ump_endpoint_info_t structure
nameUMP 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
infopointer to a snd_ump_endpoint_info_t structure
blocksthe 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
infopointer to a snd_ump_endpoint_info_t structure
idUMP 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
infopointer to a snd_ump_endpoint_info_t structure
protocolthe 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
infopointer to a snd_ump_endpoint_info_t structure
capsUMP 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
infopointer to a snd_ump_endpoint_info_t structure
idUMP 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
infopointer to a snd_ump_endpoint_info_t structure
versionthe 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_msg_sysex_expand()

int snd_ump_msg_sysex_expand ( const uint32_t * ump,
uint8_t * buf,
size_t maxlen,
size_t * filled )

fill sysex byte from a UMP packet

Parameters
umpUMP packet pointer
bufbuffer point to fill sysex bytes
maxlenmax buffer size in bytes
filledthe size of filled sysex bytes on the buffer
Returns
1 if the sysex finished, otherwise 0

◆ snd_ump_name()

const char * snd_ump_name ( snd_ump_t * ump)

get identifier of UMP handle

Parameters
umpUMP 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
umpUMP handle
nonblock0 = 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
inputpReturned input handle (NULL if not wanted)
outputpReturned output handle (NULL if not wanted)
nameASCII identifier of the UMP handle
modeOpen 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_packet_length()

int snd_ump_packet_length ( unsigned int type)

return the length of a UMP packet type

Parameters
typeUMP packet type
Returns
the length of the given UMP packet type in 32bit words (from 1 to 4), or 0 for negative inputs.

◆ snd_ump_poll_descriptors()

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

get poll descriptors

Parameters
umpUMP handle
pfdsarray of poll descriptors
spacespace 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
umpUMP 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
umpUMP handle
pfdsarray of poll descriptors
nfdscount of poll descriptors
reventsreturned 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
umpUMP 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
umpUMP handle
infopointer 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
umpUMP handle
paramspointer 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
umpUMP handle
paramspointer 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
umpUMP handle
statuspointer 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
umpUMP handle
bufferbuffer to store the input MIDI bytes
sizeinput buffer size in bytes
Return values
countof 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
umpUMP handle
[out]tstamptimestamp for the returned UMP packets
bufferbuffer to store the input UMP packets
sizeinput buffer size in bytes
Return values
countof 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
umpUMP handle
bufferbuffer containing UMP packets
sizeoutput buffer size in bytes