ALSA project - the C library reference
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rawmidi.h
Go to the documentation of this file.
1 
11 /*
12  * This library is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License as
14  * published by the Free Software Foundation; either version 2.1 of
15  * the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25  *
26  */
27 
28 #ifndef __ALSA_RAWMIDI_H
29 #define __ALSA_RAWMIDI_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
42 #define SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001
43 
45 typedef struct _snd_rawmidi_info snd_rawmidi_info_t;
47 typedef struct _snd_rawmidi_params snd_rawmidi_params_t;
49 typedef struct _snd_rawmidi_status snd_rawmidi_status_t;
50 
52 typedef enum _snd_rawmidi_stream {
57  SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT
59 
61 #define SND_RAWMIDI_APPEND 0x0001
62 
63 #define SND_RAWMIDI_NONBLOCK 0x0002
64 
65 #define SND_RAWMIDI_SYNC 0x0004
66 
68 typedef struct _snd_rawmidi snd_rawmidi_t;
69 
71 typedef enum _snd_rawmidi_type {
81 
82 int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
83  const char *name, int mode);
84 int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
85  const char *name, int mode, snd_config_t *lconf);
88 int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space);
89 int snd_rawmidi_poll_descriptors_revents(snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent);
90 int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock);
91 size_t snd_rawmidi_info_sizeof(void);
96 #define snd_rawmidi_info_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_info)
100 unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj);
101 unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj);
104 unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj);
105 const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj);
106 const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj);
110 void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val);
111 void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val);
114 size_t snd_rawmidi_params_sizeof(void);
119 #define snd_rawmidi_params_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_params)
131 size_t snd_rawmidi_status_sizeof(void);
136 #define snd_rawmidi_status_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_status)
144 int snd_rawmidi_drain(snd_rawmidi_t *rmidi);
145 int snd_rawmidi_drop(snd_rawmidi_t *rmidi);
146 ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size);
147 ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size);
148 const char *snd_rawmidi_name(snd_rawmidi_t *rmidi);
151 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif /* __RAWMIDI_H */
159