aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-16 20:15:21 +0000
committerDavid Robillard <d@drobilla.net>2011-12-16 20:15:21 +0000
commit102ba23f77650bbeaceca98c3a6539f1e637b4f7 (patch)
tree88d7032347b31ab8e79e992e2b5ab0c002aa6ccd /src/jalv.c
parent1849c5d7f96db8f2dfed04208e0c49685c50d4a4 (diff)
downloadjalv-102ba23f77650bbeaceca98c3a6539f1e637b4f7.tar.gz
jalv-102ba23f77650bbeaceca98c3a6539f1e637b4f7.tar.bz2
jalv-102ba23f77650bbeaceca98c3a6539f1e637b4f7.zip
Support presets in Gtk UI.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3878 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv.c')
-rw-r--r--src/jalv.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/jalv.c b/src/jalv.c
index f1fb6c2..de40077 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -46,6 +46,7 @@
#define NS_ATOM "http://lv2plug.in/ns/ext/atom#"
#define NS_MIDI "http://lv2plug.in/ns/ext/midi#"
+#define NS_PSET "http://lv2plug.in/ns/ext/presets#"
sem_t exit_sem; /**< Exit semaphore */
@@ -144,8 +145,9 @@ create_port(Jalv* host,
port->lilv_port = lilv_plugin_get_port_by_index(host->plugin, port_index);
port->jack_port = NULL;
- port->control = 0.0f;
port->evbuf = NULL;
+ port->index = port_index;
+ port->control = 0.0f;
port->flow = FLOW_UNKNOWN;
/* Get the port symbol for console printing */
@@ -446,12 +448,12 @@ jack_session_cb(jack_session_event_t* event, void* arg)
}
#endif /* JALV_JACK_SESSION */
-static void
-lv2_ui_write(SuilController controller,
- uint32_t port_index,
- uint32_t buffer_size,
- uint32_t protocol,
- const void* buffer)
+void
+jalv_ui_write(SuilController controller,
+ uint32_t port_index,
+ uint32_t buffer_size,
+ uint32_t protocol,
+ const void* buffer)
{
Jalv* host = (Jalv*)controller;
@@ -477,11 +479,13 @@ lv2_ui_write(SuilController controller,
ev->protocol = protocol;
ev->size = buffer_size;
memcpy(ev->body, buffer, buffer_size);
+ #if 0
printf("WRITE: ");
for (uint32_t i = 0; i < sizeof(buf); ++i) {
printf("%c", buf[i]);
}
printf("\n");
+ #endif
jack_ringbuffer_write(host->ui_events, buf, sizeof(buf));
}
@@ -558,6 +562,8 @@ main(int argc, char** argv)
host.event_class = lilv_new_uri(world, LILV_URI_EVENT_PORT);
host.aevent_class = lilv_new_uri(world, NS_ATOM "EventPort");
host.midi_class = lilv_new_uri(world, LILV_URI_MIDI_EVENT);
+ host.preset_class = lilv_new_uri(world, NS_PSET "Preset");
+ host.label_pred = lilv_new_uri(world, LILV_NS_RDFS "label");
host.optional = lilv_new_uri(world, LILV_NS_LV2
"connectionOptional");
@@ -694,7 +700,7 @@ main(int argc, char** argv)
SuilHost* ui_host = NULL;
if (host.ui) {
/* Instantiate UI */
- ui_host = suil_host_new(lv2_ui_write, NULL, NULL, NULL);
+ ui_host = suil_host_new(jalv_ui_write, NULL, NULL, NULL);
host.ui_instance = suil_instance_new(
ui_host,
@@ -755,6 +761,8 @@ main(int argc, char** argv)
lilv_node_free(host.audio_class);
lilv_node_free(host.event_class);
lilv_node_free(host.midi_class);
+ lilv_node_free(host.preset_class);
+ lilv_node_free(host.label_pred);
lilv_node_free(host.optional);
symap_free(host.symap);
suil_instance_free(host.ui_instance);