summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/Port.cpp19
-rw-r--r--src/gui/Port.hpp1
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);