summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchPortModule.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/gui/PatchPortModule.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/gui/PatchPortModule.cpp')
-rw-r--r--src/gui/PatchPortModule.cpp12
1 files changed, 4 insertions, 8 deletions
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;
}
}