diff options
author | David Robillard <d@drobilla.net> | 2012-08-11 16:23:56 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-11 16:23:56 +0000 |
commit | 885c186ed6427e7912faadfad7cc91692092efcb (patch) | |
tree | 4089c1fff96e4e051fa732cf54c0e79ca06f5bc8 /src/gui | |
parent | 27a7db9c0055475adb3488cea2e7cf9800728a0d (diff) | |
download | ingen-885c186ed6427e7912faadfad7cc91692092efcb.tar.gz ingen-885c186ed6427e7912faadfad7cc91692092efcb.tar.bz2 ingen-885c186ed6427e7912faadfad7cc91692092efcb.zip |
Reset peaks on disconnected inputs on the client side, reducing bandwidth and fixing a notification race crash caused on deletion.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4656 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/Port.cpp | 19 | ||||
-rw-r--r-- | src/gui/Port.hpp | 1 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 7a4ed0c8..f70e8576 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -88,10 +88,15 @@ Port::Port(App& app, sigc::mem_fun(this, &Port::value_changed)); } - pm->signal_activity().connect(sigc::mem_fun(this, &Port::activity)); - pm->signal_moved().connect(sigc::mem_fun(this, &Port::moved)); + pm->signal_activity().connect( + sigc::mem_fun(this, &Port::activity)); + pm->signal_disconnection().connect( + sigc::mem_fun(this, &Port::disconnected_from)); + pm->signal_moved().connect( + sigc::mem_fun(this, &Port::moved)); - signal_value_changed.connect(sigc::mem_fun(this, &Port::on_value_changed)); + signal_value_changed.connect( + sigc::mem_fun(this, &Port::on_value_changed)); update_metadata(); value_changed(pm->value()); @@ -294,6 +299,14 @@ Port::activity(const Raul::Atom& value) } } +void +Port::disconnected_from(SharedPtr<PortModel> port) +{ + if (!model()->connected() && model()->is_a(_app.uris().lv2_AudioPort)) { + set_fill_color(peak_color(0.0f)); + } +} + PatchBox* Port::get_patch_box() const { diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index 66f30f79..d94f9511 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -61,6 +61,7 @@ public: void value_changed(const Raul::Atom& value); void activity(const Raul::Atom& value); + void disconnected_from(SharedPtr<Client::PortModel> port); void set_selected(gboolean b); |