diff options
-rw-r--r-- | src/gui/Port.cpp | 19 | ||||
-rw-r--r-- | src/gui/Port.hpp | 1 | ||||
-rw-r--r-- | src/server/InputPort.cpp | 11 |
3 files changed, 18 insertions, 13 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); diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index 0ded3e5b..48b79822 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -149,17 +149,8 @@ InputPort::remove_edge(ProcessContext& context, const OutputPort* tail) return NULL; } - // Turn off broadcasting if we're no longer connected if (_edges.empty()) { - if (is_a(PortType::AUDIO)) { - // Send an update peak of 0.0 to reset to silence - const Raul::Atom z = context.engine().world()->forge().make(0.0f); - context.notify(context.engine().world()->uris().ingen_activity, - context.start(), - this, - z.size(), z.type(), z.get_body()); - } - _broadcast = false; + _broadcast = false; // Turn off broadcasting if no longer connected } return edge; |