JACK-AUDIO-CONNECTION-KIT  0.125.0rc1
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 {
40  size_t size;
41  jack_midi_data_t *buffer;
43 
44 
50 /* Get number of events in a port buffer.
51  *
52  * @param port_buffer Port buffer from which to retrieve event.
53  * @return number of events inside @a port_buffer
54  */
56 jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
57 
58 
70 int
72  void *port_buffer,
73  uint32_t event_index) JACK_OPTIONAL_WEAK_EXPORT;
74 
75 
84 void
85 jack_midi_clear_buffer(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
86 
87 
95 size_t
96 jack_midi_max_event_size(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
97 
98 
118 jack_midi_data_t*
119 jack_midi_event_reserve(void *port_buffer,
121  size_t data_size) JACK_OPTIONAL_WEAK_EXPORT;
122 
123 
145 int
146 jack_midi_event_write(void *port_buffer,
148  const jack_midi_data_t *data,
149  size_t data_size) JACK_OPTIONAL_WEAK_EXPORT;
150 
151 
160 uint32_t
161 jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
162 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 
171 #endif /* __JACK_MIDIPORT_H */
172 
173 
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:40
jack_nframes_t time
Definition: midiport.h:39
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:41