From 254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 Mar 2012 20:16:46 +0000 Subject: Partially functioning communication between Ingen LV2 plugin and UI. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4078 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PluginUI.cpp | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'src/client/PluginUI.cpp') diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index c20d41b1..8a8759fa 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -24,8 +24,6 @@ #include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" -#include "lv2/lv2plug.in/ns/ext/event/event-helpers.h" -#include "lv2/lv2plug.in/ns/ext/event/event.h" using namespace std; using namespace Raul; @@ -53,8 +51,7 @@ lv2_ui_write(SuilController controller, SharedPtr port = ports[port_index]; - const Shared::URIs& uris = *ui->world()->uris().get(); - const Shared::LV2URIMap& uri_map = *ui->world()->lv2_uri_map().get(); + const Shared::URIs& uris = *ui->world()->uris().get(); // float (special case, always 0) if (format == 0) { @@ -67,40 +64,11 @@ lv2_ui_write(SuilController controller, uris.ingen_value, ui->world()->forge().make(*(float*)buffer)); - } else if (format == uris.ui_Events.id) { - LV2_Event_Buffer* buf = (LV2_Event_Buffer*)buffer; - LV2_Event_Iterator iter; - uint8_t* data; - lv2_event_begin(&iter, buf); - while (lv2_event_is_valid(&iter)) { - LV2_Event* const ev = lv2_event_get(&iter, &data); - std::pair midi_id = - uri_map.global_to_event(uris.midi_MidiEvent.id); - if (midi_id.first && ev->type == midi_id.second) { - // FIXME - /* - ui->world()->engine()->set_property( - port->path(), - uris.ingen_value, - Atom("http://lv2plug.in/ns/ext/midi#MidiEvent", ev->size, - data)); - */ - } else { - warn << "Unable to serialise UI event type " << ev->type - << ", event lost" << endl; - } - - lv2_event_increment(&iter); - } - } else if (format == uris.atom_eventTransfer.id) { - std::cerr << "FIXME: atom event transfer" << std::endl; - #if 0 - LV2_Atom* buf = (LV2_Atom*)buffer; - Raul::Atom val; - Shared::LV2Atom::to_atom(uris, buf, val); + LV2_Atom* atom = (LV2_Atom*)buffer; + Raul::Atom val = ui->world()->forge().alloc( + atom->size, atom->type, LV2_ATOM_BODY(atom)); ui->world()->engine()->set_property(port->path(), uris.ingen_value, val); - #endif } else { warn << "Unknown value format " << format -- cgit v1.2.1