1 /* LV2 OSC Messages Extension
2 * Copyright (C) 2007-2008 Dave Robillard <dave@drobilla.net>
4 * This header is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
9 * This header is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef LV2_CONTEXTS_H
20 #define LV2_CONTEXTS_H
24 #define LV2_CONTEXTS_URI "http://lv2plug.in/ns/dev/contexts"
26 #define LV2_CONTEXT_MESSAGE "http://lv2plug.in/ns/dev/contexts#MessageContext"
29 lv2_contexts_set_port_valid(uint32_t* flags
, uint32_t index
) {
30 ((uint8_t*)flags
)[(index
) / 8] |= 1 << ((index
) % 8);
34 lv2_contexts_unset_port_valid(uint32_t* flags
, uint32_t index
) {
35 ((uint8_t*)flags
)[(index
) / 8] &= ~(1 << ((index
) % 8));
39 lv2_contexts_port_is_valid(uint32_t flags
, uint32_t index
) {
40 return ((flags
& (1 << index
)) != 0);
48 /** The message run function. This is called once to process a set of
49 * inputs and produce a set of outputs. Before calling the host MUST
50 * set valid_inputs such that the bit corresponding to each input port
51 * is 1 iff data is present. The plugin MUST only inspect bits
52 * corresponding to ports in the message thread. Before returning the
53 * plugin MUST set valid_outputs such that the bit corresponding to
54 * each output port of the message context is 1 iff data has been written
55 * to that port in the duration of this function invocation.
56 * The plugin must return 1 if outputs have been written, 0 otherwise.
58 uint32_t (*message_run
)(LV2_Handle instance
,
59 uint32_t* valid_inputs
,
60 uint32_t* valid_outputs
);
62 /** The message thread function alalogous to the LV2 connect_port
63 * function. This function must only be used to connect ports that
64 * belong to the message context. */
65 void (*message_connect_port
)(LV2_Handle instance
,
72 #endif // LV2_CONTEXTS_H