summaryrefslogtreecommitdiffstats
path: root/src/client/PluginUI.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-19 20:16:46 +0000
committerDavid Robillard <d@drobilla.net>2012-03-19 20:16:46 +0000
commit254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 (patch)
treeddf849fc5b64d1096846c28c1f1a742f54c3adff /src/client/PluginUI.cpp
parentbc3afd8380d59c750c8f8e9bf1ed1b8d4a6826e9 (diff)
downloadingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.gz
ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.bz2
ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.zip
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
Diffstat (limited to 'src/client/PluginUI.cpp')
-rw-r--r--src/client/PluginUI.cpp40
1 files changed, 4 insertions, 36 deletions
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<const PortModel> 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<bool, uint16_t> 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