summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 04:05:32 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 04:05:32 +0000
commit19928bb583e72802746b89e322f71ecc0fcb7427 (patch)
tree95912dc84d8c9dcf57939398514feaf148c1cd63 /src/gui/NodeModule.cpp
parent96f839e64de70a23210847e322d24690299287fe (diff)
downloadingen-19928bb583e72802746b89e322f71ecc0fcb7427.tar.gz
ingen-19928bb583e72802746b89e322f71ecc0fcb7427.tar.bz2
ingen-19928bb583e72802746b89e322f71ecc0fcb7427.zip
The great ID refactoring of 2009.
Path is now actually URI (scheme path: for now). Therefore ingen nodes and such live in the same namespace as ... well, everything. Including plugins. Thar be profit, laddies. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1992 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index b137ebc1..efc2febd 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -36,6 +36,7 @@
#include "NodeMenu.hpp"
using namespace std;
+using namespace Raul;
namespace Ingen {
namespace GUI {
@@ -370,21 +371,28 @@ NodeModule::store_location()
void
-NodeModule::set_variable(const string& key, const Atom& value)
+NodeModule::set_variable(const URI& key, const Atom& value)
{
- if (key == "ingenuity:canvas-x" && value.type() == Atom::FLOAT) {
- move_to(value.get_float(), property_y());
- } else if (key == "ingenuity:canvas-y" && value.type() == Atom::FLOAT) {
- move_to(property_x(), value.get_float());
- } else if (key == "ingen:polyphonic" && value.type() == Atom::BOOL) {
- set_stacked_border(value.get_bool());
- } else if (key == "ingen:selected" && value.type() == Atom::BOOL) {
- if (value.get_bool() != selected()) {
- if (value.get_bool())
- _canvas.lock()->select_item(shared_from_this());
- else
- _canvas.lock()->unselect_item(shared_from_this());
+ switch (value.type()) {
+ case Atom::FLOAT:
+ if (key.str() == "ingenuity:canvas-x") {
+ move_to(value.get_float(), property_y());
+ } else if (key.str() == "ingenuity:canvas-y") {
+ move_to(property_x(), value.get_float());
+ }
+ break;
+ case Atom::BOOL:
+ if (key.str() == "ingen:polyphonic") {
+ set_stacked_border(value.get_bool());
+ } else if (key.str() == "ingen:selected") {
+ if (value.get_bool() != selected()) {
+ if (value.get_bool())
+ _canvas.lock()->select_item(shared_from_this());
+ else
+ _canvas.lock()->unselect_item(shared_from_this());
+ }
}
+ default: break;
}
}