summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-08-19 13:49:30 +0200
committerRobin Gareus <robin@gareus.org>2015-08-19 14:27:14 +0200
commit11f51497f365ca55065834e86169ddd6605e4f9b (patch)
tree8af78fcac04562a32a18c7e14ddb627c9bdba0f0 /gtk2_ardour
parentbb79071038779057630e2244379f26af782c7852 (diff)
provisional processor control-box tweaks - possible fix for #6519
ControlBoxes are created/destroyed regularly (plugin re-order, track selection -> Editor Mixer,...). Properly disconnect the timer signal in the dtor and skip updateing the tooltip unnecessarily (duplicate calls, Changed & Timer). This should really be undone, the timer needs to be removed and Changed() used throughout.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/processor_box.cc25
-rw-r--r--gtk2_ardour/processor_box.h2
2 files changed, 21 insertions, 6 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 536d5f26f9..f6ce27a0c9 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -529,7 +529,8 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string
_button.signal_clicked.connect (sigc::mem_fun (*this, &Control::button_clicked));
_button.signal_led_clicked.connect (sigc::mem_fun (*this, &Control::button_clicked));
- c->Changed.connect (_connection, MISSING_INVALIDATOR, boost::bind (&Control::control_changed, this), gui_context ());
+ // dup. currently timers are used :(
+ //c->Changed.connect (_connection, MISSING_INVALIDATOR, boost::bind (&Control::control_changed, this), gui_context ());
} else {
@@ -565,10 +566,13 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string
_slider.set_default_value (normal);
_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &Control::slider_adjusted));
- c->Changed.connect (_connection, MISSING_INVALIDATOR, boost::bind (&Control::control_changed, this), gui_context ());
+ // dup. currently timers are used :(
+ //c->Changed.connect (_connection, MISSING_INVALIDATOR, boost::bind (&Control::control_changed, this), gui_context ());
}
- Timers::rapid_connect (sigc::mem_fun (*this, &Control::control_changed));
+ // yuck, do we really need to do this?
+ // according to c404374 this is only needed for send automation
+ timer_connection = Timers::rapid_connect (sigc::mem_fun (*this, &Control::control_changed));
control_changed ();
set_tooltip ();
@@ -577,6 +581,11 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string
set_no_tooltip_whatsoever (_slider);
}
+ProcessorEntry::Control::~Control ()
+{
+ timer_connection.disconnect ();
+}
+
void
ProcessorEntry::Control::set_tooltip ()
{
@@ -645,9 +654,13 @@ ProcessorEntry::Control::control_changed ()
_button.set_active (c->get_value() > 0.5);
} else {
-
- _adjustment.set_value (c->internal_to_interface(c->get_value ()));
- set_tooltip ();
+ // as long as rapid timers are used, only update the tooltip
+ // if the value has changed.
+ const double nval = c->internal_to_interface (c->get_value ());
+ if (_adjustment.get_value() != nval) {
+ _adjustment.set_value (nval);
+ set_tooltip ();
+ }
}
_ignore_ui_adjustment = false;
diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h
index a76970b721..fcc70a6074 100644
--- a/gtk2_ardour/processor_box.h
+++ b/gtk2_ardour/processor_box.h
@@ -169,6 +169,7 @@ private:
class Control : public sigc::trackable {
public:
Control (boost::shared_ptr<ARDOUR::AutomationControl>, std::string const &);
+ ~Control ();
void set_visible (bool);
void add_state (XMLNode *) const;
@@ -203,6 +204,7 @@ private:
PBD::ScopedConnection _connection;
bool _visible;
std::string _name;
+ sigc::connection timer_connection;
};
std::list<Control*> _controls;