Update action state when watched controllable changes

This fixes bug, when a button has both a controllable and
a toggle action assigned. Previously only the visual state
was updated.  e.g. monitor section mute button.

When "cut all" was toggled (e.g. Control surface, or a Lua script:
`Session:monitor_out():monitor_control():set_cut_all(true)`,

The action state itself remained unchanged. Also the button
in the application remained unchanged since that button does
not :watch() the controllable.
This commit is contained in:
Robin Gareus
2025-09-24 17:11:59 +02:00
parent 68128f4156
commit cb64c9a9c1

View File

@@ -1221,11 +1221,15 @@ ArdourButton::controllable_changed ()
{
float val = binding_proxy.get_controllable()->get_value();
if (fabs (val) >= 0.5f) {
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(_action);
if (tact) {
tact->set_active (fabs (val) >= 0.5f);
} else if (fabs (val) >= 0.5f) {
set_active_state (Gtkmm2ext::ExplicitActive);
} else {
unset_active_state ();
}
CairoWidget::set_dirty ();
}