JACK-AUDIO-CONNECTION-KIT
midiport.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004 Ian Esten
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published by
6  the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 */
19 
20 
21 #ifndef __JACK_MIDIPORT_H
22 #define __JACK_MIDIPORT_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include <jack/weakmacros.h>
29 #include <jack/types.h>
30 #include <stdlib.h>
31 
32 
34 typedef unsigned char jack_midi_data_t;
35 
36 
38 typedef struct _jack_midi_event
39 {
41  size_t size;
42  jack_midi_data_t *buffer;
44 
45 
51 /* Get number of events in a port buffer.
52  *
53  * @param port_buffer Port buffer from which to retrieve event.
54  * @return number of events inside @a port_buffer
55  */
57 jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
58 
59 
71 int
73  void *port_buffer,
74  uint32_t event_index) JACK_OPTIONAL_WEAK_EXPORT;
75 
76 
85 void
86 jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
87 
88 
96 size_t
97 jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
98 
99 
119 jack_midi_data_t*
120 jack_midi_event_reserve(void *port_buffer,
122  size_t data_size) JACK_OPTIONAL_WEAK_EXPORT;
123 
124 
146 int
147 jack_midi_event_write(void *port_buffer,
149  const jack_midi_data_t *data,
150  size_t data_size) JACK_OPTIONAL_WEAK_EXPORT;
151 
152 
161 uint32_t
162 jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
163 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 
172 #endif /* __JACK_MIDIPORT_H */
173 
174 
void jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT
Definition: midiport.h:38
uint32_t jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT
jack_nframes_t jack_midi_get_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT
size_t jack_midi_max_event_size(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT
size_t size
Definition: midiport.h:41
jack_nframes_t time
Definition: midiport.h:40
struct _jack_midi_event jack_midi_event_t
int jack_midi_event_get(jack_midi_event_t *event, void *port_buffer, uint32_t event_index) JACK_OPTIONAL_WEAK_EXPORT
uint32_t jack_nframes_t
Definition: types.h:53
int jack_midi_event_write(void *port_buffer, jack_nframes_t time, const jack_midi_data_t *data, size_t data_size) JACK_OPTIONAL_WEAK_EXPORT
unsigned char jack_midi_data_t
Definition: midiport.h:34
jack_midi_data_t * jack_midi_event_reserve(void *port_buffer, jack_nframes_t time, size_t data_size) JACK_OPTIONAL_WEAK_EXPORT
jack_midi_data_t * buffer
Definition: midiport.h:42