diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 98952e18d8..c363c0f1b6 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -995,7 +995,7 @@ ProcessorEntry::toggle_allow_feedback () } } -ProcessorEntry::Control::Control (ProcessorEntry& e,std::shared_ptr c, string const & n) +ProcessorEntry::Control::Control (ProcessorEntry& e, std::shared_ptr c, string const & n) : _entry (e) , _control (c) , _adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1) @@ -1004,9 +1004,27 @@ ProcessorEntry::Control::Control (ProcessorEntry& e,std::shared_ptr c = _control.lock (); + + if (!c) { + return false; + } + _have_ui = true; if (c->toggled()) { _button.set_text (_name); @@ -1065,9 +1083,7 @@ ProcessorEntry::Control::Control (ProcessorEntry& e,std::shared_ptrtoggled ()) { _button.set_active (c->get_value() > 0.5); @@ -1194,8 +1210,6 @@ ProcessorEntry::Control::control_changed () set_tooltip (); } } - - _ignore_ui_adjustment = false; } void @@ -1226,6 +1240,9 @@ void ProcessorEntry::Control::set_visible (bool v) { if (v) { + if (!build_ui ()) { + return; + } box.show (); } else { box.hide (); diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 9816894a06..bd07a81fcb 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -228,6 +228,7 @@ private: Gtk::Alignment box; private: + bool build_ui (); void slider_adjusted (); void button_clicked (); void button_clicked_event (GdkEventButton *); @@ -252,6 +253,7 @@ private: bool _ignore_ui_adjustment; PBD::ScopedConnectionList _connections; bool _visible; + bool _have_ui; std::string _name; };