jpayne@69
|
1 /**
|
jpayne@69
|
2 * \file include/rawmidi.h
|
jpayne@69
|
3 * \brief Application interface library for the ALSA driver
|
jpayne@69
|
4 * \author Jaroslav Kysela <perex@perex.cz>
|
jpayne@69
|
5 * \author Abramo Bagnara <abramo@alsa-project.org>
|
jpayne@69
|
6 * \author Takashi Iwai <tiwai@suse.de>
|
jpayne@69
|
7 * \date 1998-2001
|
jpayne@69
|
8 *
|
jpayne@69
|
9 * Application interface library for the ALSA driver
|
jpayne@69
|
10 */
|
jpayne@69
|
11 /*
|
jpayne@69
|
12 * This library is free software; you can redistribute it and/or modify
|
jpayne@69
|
13 * it under the terms of the GNU Lesser General Public License as
|
jpayne@69
|
14 * published by the Free Software Foundation; either version 2.1 of
|
jpayne@69
|
15 * the License, or (at your option) any later version.
|
jpayne@69
|
16 *
|
jpayne@69
|
17 * This program is distributed in the hope that it will be useful,
|
jpayne@69
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jpayne@69
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jpayne@69
|
20 * GNU Lesser General Public License for more details.
|
jpayne@69
|
21 *
|
jpayne@69
|
22 * You should have received a copy of the GNU Lesser General Public
|
jpayne@69
|
23 * License along with this library; if not, write to the Free Software
|
jpayne@69
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
jpayne@69
|
25 *
|
jpayne@69
|
26 */
|
jpayne@69
|
27
|
jpayne@69
|
28 #ifndef __ALSA_RAWMIDI_H
|
jpayne@69
|
29 #define __ALSA_RAWMIDI_H
|
jpayne@69
|
30
|
jpayne@69
|
31 #ifdef __cplusplus
|
jpayne@69
|
32 extern "C" {
|
jpayne@69
|
33 #endif
|
jpayne@69
|
34
|
jpayne@69
|
35 /**
|
jpayne@69
|
36 * \defgroup RawMidi RawMidi Interface
|
jpayne@69
|
37 * The RawMidi Interface. See \ref rawmidi page for more details.
|
jpayne@69
|
38 * \{
|
jpayne@69
|
39 */
|
jpayne@69
|
40
|
jpayne@69
|
41 /** dlsym version for interface entry callback */
|
jpayne@69
|
42 #define SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001
|
jpayne@69
|
43
|
jpayne@69
|
44 /** RawMidi information container */
|
jpayne@69
|
45 typedef struct _snd_rawmidi_info snd_rawmidi_info_t;
|
jpayne@69
|
46 /** RawMidi settings container */
|
jpayne@69
|
47 typedef struct _snd_rawmidi_params snd_rawmidi_params_t;
|
jpayne@69
|
48 /** RawMidi status container */
|
jpayne@69
|
49 typedef struct _snd_rawmidi_status snd_rawmidi_status_t;
|
jpayne@69
|
50
|
jpayne@69
|
51 /** RawMidi stream (direction) */
|
jpayne@69
|
52 typedef enum _snd_rawmidi_stream {
|
jpayne@69
|
53 /** Output stream */
|
jpayne@69
|
54 SND_RAWMIDI_STREAM_OUTPUT = 0,
|
jpayne@69
|
55 /** Input stream */
|
jpayne@69
|
56 SND_RAWMIDI_STREAM_INPUT,
|
jpayne@69
|
57 SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT
|
jpayne@69
|
58 } snd_rawmidi_stream_t;
|
jpayne@69
|
59
|
jpayne@69
|
60 /** Append (flag to open mode) \hideinitializer */
|
jpayne@69
|
61 #define SND_RAWMIDI_APPEND 0x0001
|
jpayne@69
|
62 /** Non blocking mode (flag to open mode) \hideinitializer */
|
jpayne@69
|
63 #define SND_RAWMIDI_NONBLOCK 0x0002
|
jpayne@69
|
64 /** Write sync mode (Flag to open mode) \hideinitializer */
|
jpayne@69
|
65 #define SND_RAWMIDI_SYNC 0x0004
|
jpayne@69
|
66
|
jpayne@69
|
67 /** RawMidi handle */
|
jpayne@69
|
68 typedef struct _snd_rawmidi snd_rawmidi_t;
|
jpayne@69
|
69
|
jpayne@69
|
70 /** RawMidi type */
|
jpayne@69
|
71 typedef enum _snd_rawmidi_type {
|
jpayne@69
|
72 /** Kernel level RawMidi */
|
jpayne@69
|
73 SND_RAWMIDI_TYPE_HW,
|
jpayne@69
|
74 /** Shared memory client RawMidi (not yet implemented) */
|
jpayne@69
|
75 SND_RAWMIDI_TYPE_SHM,
|
jpayne@69
|
76 /** INET client RawMidi (not yet implemented) */
|
jpayne@69
|
77 SND_RAWMIDI_TYPE_INET,
|
jpayne@69
|
78 /** Virtual (sequencer) RawMidi */
|
jpayne@69
|
79 SND_RAWMIDI_TYPE_VIRTUAL
|
jpayne@69
|
80 } snd_rawmidi_type_t;
|
jpayne@69
|
81
|
jpayne@69
|
82 int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
|
jpayne@69
|
83 const char *name, int mode);
|
jpayne@69
|
84 int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi,
|
jpayne@69
|
85 const char *name, int mode, snd_config_t *lconf);
|
jpayne@69
|
86 int snd_rawmidi_close(snd_rawmidi_t *rmidi);
|
jpayne@69
|
87 int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi);
|
jpayne@69
|
88 int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space);
|
jpayne@69
|
89 int snd_rawmidi_poll_descriptors_revents(snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent);
|
jpayne@69
|
90 int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock);
|
jpayne@69
|
91 size_t snd_rawmidi_info_sizeof(void);
|
jpayne@69
|
92 /** \hideinitializer
|
jpayne@69
|
93 * \brief allocate an invalid #snd_rawmidi_info_t using standard alloca
|
jpayne@69
|
94 * \param ptr returned pointer
|
jpayne@69
|
95 */
|
jpayne@69
|
96 #define snd_rawmidi_info_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_info)
|
jpayne@69
|
97 int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr);
|
jpayne@69
|
98 void snd_rawmidi_info_free(snd_rawmidi_info_t *obj);
|
jpayne@69
|
99 void snd_rawmidi_info_copy(snd_rawmidi_info_t *dst, const snd_rawmidi_info_t *src);
|
jpayne@69
|
100 unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
101 unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
102 snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
103 int snd_rawmidi_info_get_card(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
104 unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
105 const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
106 const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
107 const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
108 unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
109 unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj);
|
jpayne@69
|
110 void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val);
|
jpayne@69
|
111 void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val);
|
jpayne@69
|
112 void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val);
|
jpayne@69
|
113 int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * info);
|
jpayne@69
|
114 size_t snd_rawmidi_params_sizeof(void);
|
jpayne@69
|
115 /** \hideinitializer
|
jpayne@69
|
116 * \brief allocate an invalid #snd_rawmidi_params_t using standard alloca
|
jpayne@69
|
117 * \param ptr returned pointer
|
jpayne@69
|
118 */
|
jpayne@69
|
119 #define snd_rawmidi_params_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_params)
|
jpayne@69
|
120 int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr);
|
jpayne@69
|
121 void snd_rawmidi_params_free(snd_rawmidi_params_t *obj);
|
jpayne@69
|
122 void snd_rawmidi_params_copy(snd_rawmidi_params_t *dst, const snd_rawmidi_params_t *src);
|
jpayne@69
|
123 int snd_rawmidi_params_set_buffer_size(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val);
|
jpayne@69
|
124 size_t snd_rawmidi_params_get_buffer_size(const snd_rawmidi_params_t *params);
|
jpayne@69
|
125 int snd_rawmidi_params_set_avail_min(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val);
|
jpayne@69
|
126 size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t *params);
|
jpayne@69
|
127 int snd_rawmidi_params_set_no_active_sensing(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, int val);
|
jpayne@69
|
128 int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t *params);
|
jpayne@69
|
129 int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params);
|
jpayne@69
|
130 int snd_rawmidi_params_current(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params);
|
jpayne@69
|
131 size_t snd_rawmidi_status_sizeof(void);
|
jpayne@69
|
132 /** \hideinitializer
|
jpayne@69
|
133 * \brief allocate an invalid #snd_rawmidi_status_t using standard alloca
|
jpayne@69
|
134 * \param ptr returned pointer
|
jpayne@69
|
135 */
|
jpayne@69
|
136 #define snd_rawmidi_status_alloca(ptr) __snd_alloca(ptr, snd_rawmidi_status)
|
jpayne@69
|
137 int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr);
|
jpayne@69
|
138 void snd_rawmidi_status_free(snd_rawmidi_status_t *obj);
|
jpayne@69
|
139 void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src);
|
jpayne@69
|
140 void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr);
|
jpayne@69
|
141 size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj);
|
jpayne@69
|
142 size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj);
|
jpayne@69
|
143 int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status);
|
jpayne@69
|
144 int snd_rawmidi_drain(snd_rawmidi_t *rmidi);
|
jpayne@69
|
145 int snd_rawmidi_drop(snd_rawmidi_t *rmidi);
|
jpayne@69
|
146 ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size);
|
jpayne@69
|
147 ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size);
|
jpayne@69
|
148 const char *snd_rawmidi_name(snd_rawmidi_t *rmidi);
|
jpayne@69
|
149 snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t *rmidi);
|
jpayne@69
|
150 snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t *rawmidi);
|
jpayne@69
|
151
|
jpayne@69
|
152 /** \} */
|
jpayne@69
|
153
|
jpayne@69
|
154 #ifdef __cplusplus
|
jpayne@69
|
155 }
|
jpayne@69
|
156 #endif
|
jpayne@69
|
157
|
jpayne@69
|
158 #endif /* __RAWMIDI_H */
|
jpayne@69
|
159
|