ALSA project - the C library reference
seq_midi_event.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  *
26  */
27 
28 #if !defined(__ASOUNDLIB_H) && !defined(ALSA_LIBRARY_BUILD)
29 /* don't use ALSA_LIBRARY_BUILD define in sources outside alsa-lib */
30 #warning "use #include <alsa/asoundlib.h>, <alsa/seq_midi_event.h> should not be used directly"
31 #include <alsa/asoundlib.h>
32 #endif
33 
34 #ifndef __ALSA_SEQ_MIDI_EVENT_H
35 #define __ALSA_SEQ_MIDI_EVENT_H
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
49 typedef struct snd_midi_event snd_midi_event_t;
50 
51 int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev);
52 int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize);
58 /* encode from byte stream - return number of written bytes if success */
59 long snd_midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev);
61 /* decode from event to bytes - return number of written bytes if success */
62 long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev);
63 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* __ALSA_SEQ_MIDI_EVENT_H */
71 
void snd_midi_event_reset_decode(snd_midi_event_t *dev)
Resets MIDI decode parser.
Definition: seq_midi_event.c:244
int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize)
Resizes the MIDI message encoding buffer.
Definition: seq_midi_event.c:282
void snd_midi_event_no_status(snd_midi_event_t *dev, int on)
Enables/disables MIDI command merging.
Definition: seq_midi_event.c:202
void snd_midi_event_reset_encode(snd_midi_event_t *dev)
Resets MIDI encode parser.
Definition: seq_midi_event.c:228
void snd_midi_event_init(snd_midi_event_t *dev)
Resets MIDI encode/decode parsers.
Definition: seq_midi_event.c:259
void snd_midi_event_free(snd_midi_event_t *dev)
Frees a MIDI event parser.
Definition: seq_midi_event.c:183
long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev)
Decodes sequencer event to MIDI byte stream.
Definition: seq_midi_event.c:559
int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev)
Creates a MIDI event parser.
Definition: seq_midi_event.c:152
int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev)
Encodes byte to sequencer event.
Definition: seq_midi_event.c:400
long snd_midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev)
Encodes bytes to sequencer event.
Definition: seq_midi_event.c:362
struct snd_midi_event snd_midi_event_t
Definition: seq_midi_event.h:49
Definition: seq_event.h:328