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.
_button.signal_clicked.connect (sigc::mem_fun (*this, &Control::button_clicked));
_button.signal_led_clicked.connect (sigc::mem_fun (*this, &Control::button_clicked));
_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 ());
_slider.set_default_value (normal);
_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &Control::slider_adjusted));
_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 ();
control_changed ();
set_tooltip ();
set_no_tooltip_whatsoever (_slider);
}
set_no_tooltip_whatsoever (_slider);
}
+ProcessorEntry::Control::~Control ()
+{
+ timer_connection.disconnect ();
+}
+
void
ProcessorEntry::Control::set_tooltip ()
{
void
ProcessorEntry::Control::set_tooltip ()
{
_button.set_active (c->get_value() > 0.5);
} else {
_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;
}
_ignore_ui_adjustment = false;
class Control : public sigc::trackable {
public:
Control (boost::shared_ptr<ARDOUR::AutomationControl>, std::string const &);
class Control : public sigc::trackable {
public:
Control (boost::shared_ptr<ARDOUR::AutomationControl>, std::string const &);
void set_visible (bool);
void add_state (XMLNode *) const;
void set_visible (bool);
void add_state (XMLNode *) const;
PBD::ScopedConnection _connection;
bool _visible;
std::string _name;
PBD::ScopedConnection _connection;
bool _visible;
std::string _name;
+ sigc::connection timer_connection;
};
std::list<Control*> _controls;
};
std::list<Control*> _controls;