All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rawmidi.h
Go to the documentation of this file.
/*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __ALSA_RAWMIDI_H
#define __ALSA_RAWMIDI_H
#ifdef __cplusplus
extern "C" {
#endif
#define SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001
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 enum _snd_rawmidi_stream {
SND_RAWMIDI_STREAM_OUTPUT = 0,
SND_RAWMIDI_STREAM_INPUT,
SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT
} snd_rawmidi_stream_t;
#define SND_RAWMIDI_APPEND 0x0001
#define SND_RAWMIDI_NONBLOCK 0x0002
#define SND_RAWMIDI_SYNC 0x0004
typedef struct _snd_rawmidi snd_rawmidi_t;
typedef enum _snd_rawmidi_type {
SND_RAWMIDI_TYPE_HW,
SND_RAWMIDI_TYPE_SHM,
SND_RAWMIDI_TYPE_INET,
SND_RAWMIDI_TYPE_VIRTUAL
} snd_rawmidi_type_t;
int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
const char *name, int mode);
int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
const char *name, int mode, snd_config_t *lconf);
int snd_rawmidi_close(snd_rawmidi_t *rmidi);
int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi);
int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space);
int snd_rawmidi_poll_descriptors_revents(snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent);
int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock);
size_t snd_rawmidi_info_sizeof(void);
#define snd_rawmidi_info_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_info)
int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr);
void snd_rawmidi_info_free(snd_rawmidi_info_t *obj);
void snd_rawmidi_info_copy(snd_rawmidi_info_t *dst, const snd_rawmidi_info_t *src);
unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj);
unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj);
snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t *obj);
int snd_rawmidi_info_get_card(const snd_rawmidi_info_t *obj);
unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj);
const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj);
const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj);
const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj);
unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj);
unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj);
void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val);
void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val);
void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val);
int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * info);
size_t snd_rawmidi_params_sizeof(void);
#define snd_rawmidi_params_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_params)
int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr);
void snd_rawmidi_params_free(snd_rawmidi_params_t *obj);
void snd_rawmidi_params_copy(snd_rawmidi_params_t *dst, const snd_rawmidi_params_t *src);
int snd_rawmidi_params_set_buffer_size(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val);
size_t snd_rawmidi_params_get_buffer_size(const snd_rawmidi_params_t *params);
int snd_rawmidi_params_set_avail_min(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val);
size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t *params);
int snd_rawmidi_params_set_no_active_sensing(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, int val);
int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t *params);
int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params);
int snd_rawmidi_params_current(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params);
size_t snd_rawmidi_status_sizeof(void);
#define snd_rawmidi_status_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_status)
int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr);
void snd_rawmidi_status_free(snd_rawmidi_status_t *obj);
void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src);
void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr);
size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj);
size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj);
int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status);
int snd_rawmidi_drain(snd_rawmidi_t *rmidi);
int snd_rawmidi_drop(snd_rawmidi_t *rmidi);
ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size);
ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size);
const char *snd_rawmidi_name(snd_rawmidi_t *rmidi);
snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t *rmidi);
snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t *rawmidi);
#ifdef __cplusplus
}
#endif
#endif /* __RAWMIDI_H */
snd_rawmidi_params_t
struct _snd_rawmidi_params snd_rawmidi_params_t
Definition: rawmidi.h:47
snd_rawmidi_params_current
int snd_rawmidi_params_current(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params)
get current parameters about rawmidi stream
Definition: rawmidi.c:839
snd_rawmidi_info_get_device
unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj)
get rawmidi device number
Definition: rawmidi.c:524
snd_rawmidi_info_get_card
int snd_rawmidi_info_get_card(const snd_rawmidi_info_t *obj)
get rawmidi card number
Definition: rawmidi.c:557
snd_rawmidi_nonblock
int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock)
set nonblock mode
Definition: rawmidi.c:455
snd_rawmidi_drain
int snd_rawmidi_drain(snd_rawmidi_t *rmidi)
drain all bytes in the rawmidi I/O ring buffer
Definition: rawmidi.c:964
snd_rawmidi_poll_descriptors
int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space)
get poll descriptors
Definition: rawmidi.c:417
snd_rawmidi_status_sizeof
size_t snd_rawmidi_status_sizeof(void)
get size of the snd_rawmidi_status_t structure in bytes
Definition: rawmidi.c:853
SND_RAWMIDI_STREAM_INPUT
Definition: rawmidi.h:56
snd_rawmidi_params_free
void snd_rawmidi_params_free(snd_rawmidi_params_t *obj)
frees the snd_rawmidi_params_t structure
Definition: rawmidi.c:708
snd_rawmidi_open_lconf
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.
Definition: rawmidi.c:332
snd_rawmidi_info_t
struct _snd_rawmidi_info snd_rawmidi_info_t
Definition: rawmidi.h:45
snd_rawmidi_info_sizeof
size_t snd_rawmidi_info_sizeof(void)
get size of the snd_rawmidi_info_t structure in bytes
Definition: rawmidi.c:473
snd_rawmidi_info_get_id
const char * snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj)
get rawmidi hardware driver identifier
Definition: rawmidi.c:579
SND_RAWMIDI_STREAM_OUTPUT
Definition: rawmidi.h:54
snd_rawmidi_read
ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size)
read MIDI bytes from MIDI stream
Definition: rawmidi.c:990
snd_rawmidi_status_get_tstamp
void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr)
get the start timestamp
Definition: rawmidi.c:904
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
Definition: rawmidi.c:893
snd_rawmidi_close
int snd_rawmidi_close(snd_rawmidi_t *rmidi)
close RawMidi handle
Definition: rawmidi.c:347
snd_rawmidi_open
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.
Definition: rawmidi.c:305
snd_rawmidi_params_malloc
int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr)
allocate the snd_rawmidi_params_t structure
Definition: rawmidi.c:692
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
Definition: rawmidi.c:778
snd_rawmidi_params_sizeof
size_t snd_rawmidi_params_sizeof(void)
get size of the snd_rawmidi_params_t structure in bytes
Definition: rawmidi.c:679
snd_rawmidi_type
snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t *rmidi)
get type of RawMidi handle
Definition: rawmidi.c:380
SND_RAWMIDI_TYPE_SHM
Definition: rawmidi.h:75
snd_rawmidi_info
int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t *info)
get information about RawMidi handle
Definition: rawmidi.c:668
snd_htimestamp_t
struct timespec snd_htimestamp_t
Definition: global.h:153
snd_rawmidi_info_get_subdevice
unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj)
get rawmidi subdevice number
Definition: rawmidi.c:535
snd_rawmidi_info_get_name
const char * snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj)
get rawmidi hardware driver name
Definition: rawmidi.c:590
snd_rawmidi_write
ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size)
write MIDI bytes to MIDI stream
Definition: rawmidi.c:976
snd_rawmidi_status_get_xruns
size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj)
get count of xruns
Definition: rawmidi.c:926
snd_rawmidi_info_free
void snd_rawmidi_info_free(snd_rawmidi_info_t *obj)
frees the snd_rawmidi_info_t structure
Definition: rawmidi.c:502
snd_rawmidi_poll_descriptors_count
int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi)
get count of poll descriptors for RawMidi handle
Definition: rawmidi.c:404
snd_rawmidi_info_set_device
void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val)
set rawmidi device number
Definition: rawmidi.c:634
snd_rawmidi_name
const char * snd_rawmidi_name(snd_rawmidi_t *rmidi)
get identifier of RawMidi handle
Definition: rawmidi.c:367
snd_rawmidi_stream
snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t *rawmidi)
get stream (direction) of RawMidi handle
Definition: rawmidi.c:393
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
Definition: rawmidi.c:807
snd_rawmidi_info_set_subdevice
void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val)
set rawmidi subdevice number
Definition: rawmidi.c:645
snd_rawmidi_status_malloc
int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr)
allocate the snd_rawmidi_status_t structure
Definition: rawmidi.c:866
snd_rawmidi_params
int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params)
set parameters about rawmidi stream
Definition: rawmidi.c:819
snd_rawmidi_status
int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t *status)
get status of rawmidi stream
Definition: rawmidi.c:938
snd_rawmidi_info_get_subdevice_name
const char * snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj)
get rawmidi subdevice name
Definition: rawmidi.c:601
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
Definition: rawmidi.c:513
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
Definition: rawmidi.c:749
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
Definition: rawmidi.c:719
SND_RAWMIDI_TYPE_VIRTUAL
Definition: rawmidi.h:79
SND_RAWMIDI_TYPE_HW
Definition: rawmidi.h:73
snd_rawmidi_params_set_avail_min
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
Definition: rawmidi.c:764
snd_rawmidi_drop
int snd_rawmidi_drop(snd_rawmidi_t *rmidi)
drop all bytes in the rawmidi I/O ring buffer immediately
Definition: rawmidi.c:950
snd_rawmidi_params_set_buffer_size
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
Definition: rawmidi.c:735
snd_rawmidi_info_get_subdevices_avail
unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj)
get rawmidi available count of subdevices
Definition: rawmidi.c:623
snd_rawmidi_info_set_stream
void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val)
set rawmidi stream identifier
Definition: rawmidi.c:656
snd_rawmidi_status_t
struct _snd_rawmidi_status snd_rawmidi_status_t
Definition: rawmidi.h:49
snd_config_t
struct _snd_config snd_config_t
Internal structure for a configuration node object.
Definition: conf.h:69
snd_rawmidi_type_t
snd_rawmidi_type_t
Definition: rawmidi.h:71
snd_rawmidi_params_set_no_active_sensing
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()
Definition: rawmidi.c:794
snd_rawmidi_t
struct _snd_rawmidi snd_rawmidi_t
Definition: rawmidi.h:68
snd_rawmidi_stream_t
snd_rawmidi_stream_t
Definition: rawmidi.h:52
snd_rawmidi_status_free
void snd_rawmidi_status_free(snd_rawmidi_status_t *obj)
frees the snd_rawmidi_status_t structure
Definition: rawmidi.c:882
snd_rawmidi_info_get_flags
unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj)
get rawmidi flags
Definition: rawmidi.c:568
ptr
void * ptr
Definition: seq_event.h:199
snd_rawmidi_info_get_subdevices_count
unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj)
get rawmidi count of subdevices
Definition: rawmidi.c:612
snd_rawmidi_info_malloc
int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr)
allocate a new snd_rawmidi_info_t structure
Definition: rawmidi.c:486
SND_RAWMIDI_TYPE_INET
Definition: rawmidi.h:77
snd_rawmidi_poll_descriptors_revents
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
Definition: rawmidi.c:436
snd_rawmidi_info_get_stream
snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t *obj)
get rawmidi stream identification
Definition: rawmidi.c:546
snd_rawmidi_status_get_avail
size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj)
get current available bytes in the rawmidi I/O ring buffer
Definition: rawmidi.c:915