summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/PatchView.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 03:10:58 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 03:10:58 +0000
commitd6823fa9b29bcff74ca180e6d389d8a21cf88d1f (patch)
treeb79dcfd907f83f035d657964d26b578c85ef0de2 /src/libs/gui/PatchView.cpp
parent694b31089c8060fc6b908b146b12c0e340d004c7 (diff)
downloadingen-d6823fa9b29bcff74ca180e6d389d8a21cf88d1f.tar.gz
ingen-d6823fa9b29bcff74ca180e6d389d8a21cf88d1f.tar.bz2
ingen-d6823fa9b29bcff74ca180e6d389d8a21cf88d1f.zip
There!
Loader uses only CommonInterface and is now able to parse into a client or engine. Proper OSC serialisation of boolean atoms. Remove patch_enabled and patch_disabled calls/signals/etc in favour of new generic "property" mechanism (courtesy of which much more killed API is to come). git-svn-id: http://svn.drobilla.net/lad/ingen@1410 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/PatchView.cpp')
-rw-r--r--src/libs/gui/PatchView.cpp31
1 files changed, 10 insertions, 21 deletions
diff --git a/src/libs/gui/PatchView.cpp b/src/libs/gui/PatchView.cpp
index 2ba05070..8b720db4 100644
--- a/src/libs/gui/PatchView.cpp
+++ b/src/libs/gui/PatchView.cpp
@@ -79,11 +79,13 @@ PatchView::set_patch(SharedPtr<PatchModel> patch)
_poly_spin->set_value(patch->poly());
_destroy_but->set_sensitive(patch->path() != "/");
- patch->enabled() ? enable() : disable();
+
+ for (GraphObject::Variables::const_iterator i = patch->properties().begin();
+ i != patch->properties().end(); ++i)
+ property_changed(i->first, i->second);
// Connect model signals to track state
- patch->signal_enabled.connect(sigc::mem_fun(this, &PatchView::enable));
- patch->signal_disabled.connect(sigc::mem_fun(this, &PatchView::disable));
+ patch->signal_property.connect(sigc::mem_fun(this, &PatchView::property_changed));
// Connect widget signals to do things
_process_but->signal_toggled().connect(sigc::mem_fun(this, &PatchView::process_toggled));
@@ -151,13 +153,8 @@ PatchView::process_toggled()
if (!_enable_signal)
return;
- if (_process_but->get_active()) {
- App::instance().engine()->enable_patch(_patch->path());
- App::instance().patch_tree()->patch_enabled(_patch->path());
- } else {
- App::instance().engine()->disable_patch(_patch->path());
- App::instance().patch_tree()->patch_disabled(_patch->path());
- }
+ App::instance().engine()->set_property(_patch->path(), "ingen:enabled",
+ (bool)_process_but->get_active());
}
@@ -183,19 +180,11 @@ PatchView::refresh_clicked()
void
-PatchView::enable()
-{
- _enable_signal = false;
- _process_but->set_active(true);
- _enable_signal = true;
-}
-
-
-void
-PatchView::disable()
+PatchView::property_changed(const std::string& predicate, const Raul::Atom& value)
{
_enable_signal = false;
- _process_but->set_active(false);
+ if (predicate == "ingen:enabled" && value.type() == Atom::BOOL)
+ _process_but->set_active(value.get_bool());
_enable_signal = true;
}