diff --git a/gtk2_ardour/route_properties_box.cc b/gtk2_ardour/route_properties_box.cc index f5248b3b61..e527444386 100644 --- a/gtk2_ardour/route_properties_box.cc +++ b/gtk2_ardour/route_properties_box.cc @@ -103,12 +103,20 @@ RoutePropertiesBox::set_session (ARDOUR::Session* s) { _insert_frame.add (*_insert_box); _insert_frame.set_padding (4); _insert_frame.set_size_request (144 * ui_scale, 236 * ui_scale); + + _session->SurroundMasterAddedOrRemoved.connect (_session_connections, invalidator (*this), std::bind (&RoutePropertiesBox::surround_master_added_or_removed, this), gui_context()); } void -RoutePropertiesBox::set_route (std::shared_ptr r) +RoutePropertiesBox::surround_master_added_or_removed () { - if (r == _route) { + set_route (_route, true); +} + +void +RoutePropertiesBox::set_route (std::shared_ptr r, bool force_update) +{ + if (r == _route && !force_update) { return; } diff --git a/gtk2_ardour/route_properties_box.h b/gtk2_ardour/route_properties_box.h index 2bbe4b9c6e..cd26734dcc 100644 --- a/gtk2_ardour/route_properties_box.h +++ b/gtk2_ardour/route_properties_box.h @@ -46,7 +46,7 @@ public: ~RoutePropertiesBox (); void set_session (ARDOUR::Session*); - void set_route (std::shared_ptr); + void set_route (std::shared_ptr, bool force = false); private: void property_changed (const PBD::PropertyChange& what_changed); @@ -59,6 +59,7 @@ private: void refill_processors (); void add_processor_to_display (std::weak_ptr w); void idle_refill_processors (); + void surround_master_added_or_removed (); static int _idle_refill_processors (gpointer);