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/gui/PatchPortModule.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/gui/PatchPortModule.cpp') diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index 1e5b1d5a..9ad1fe9a 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -114,7 +114,7 @@ PatchPortModule::show_human_names(bool b) { const URIs& uris = app().uris(); const Atom& name = _model->get_property(uris.lv2_name); - if (b && name.type() == Atom::STRING) + if (b && name.type() == uris.forge.String) set_name(name.get_string()); else set_name(_model->symbol().c_str()); @@ -131,15 +131,13 @@ void PatchPortModule::property_changed(const URI& key, const Atom& value) { const URIs& uris = app().uris(); - switch (value.type()) { - case Atom::FLOAT: + if (value.type() == uris.forge.Float) { if (key == uris.ingen_canvasX) { move_to(value.get_float(), get_y()); } else if (key == uris.ingen_canvasY) { move_to(get_x(), value.get_float()); } - break; - case Atom::STRING: + } else if (value.type() == uris.forge.String) { if (key == uris.lv2_name && app().configuration()->name_style() == Configuration::HUMAN) { set_name(value.get_string()); @@ -147,8 +145,7 @@ PatchPortModule::property_changed(const URI& key, const Atom& value) && app().configuration()->name_style() == Configuration::PATH) { set_name(value.get_string()); } - break; - case Atom::BOOL: + } else if (value.type() == uris.forge.Bool) { if (key == uris.ingen_polyphonic) { set_stacked(value.get_bool()); } else if (key == uris.ingen_selected) { @@ -156,7 +153,6 @@ PatchPortModule::property_changed(const URI& key, const Atom& value) set_selected(value.get_bool()); } } - default: break; } } -- cgit v1.2.1