summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-11 16:23:56 +0000
committerDavid Robillard <d@drobilla.net>2012-08-11 16:23:56 +0000
commit885c186ed6427e7912faadfad7cc91692092efcb (patch)
tree4089c1fff96e4e051fa732cf54c0e79ca06f5bc8 /src
parent27a7db9c0055475adb3488cea2e7cf9800728a0d (diff)
downloadingen-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')
-rw-r--r--src/gui/Port.cpp19
-rw-r--r--src/gui/Port.hpp1
-rw-r--r--src/server/InputPort.cpp11
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;