From 1af5f37e4698c2e3c0edf195c23734834d426ea0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 28 Feb 2020 02:25:57 +0100 Subject: [PATCH] Restore visible automation lanes (#7914) On session re-load only automation lanes with events were displayed, regardless of visibility state. This allowed for inconsistent state (menu showed them as visible even if they were not). --- gtk2_ardour/axis_view.h | 12 ++++++++++++ gtk2_ardour/route_time_axis.cc | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index 1a1686add9..e1db192b7e 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -83,6 +83,18 @@ public: return false; } + template + bool get_gui_property (const std::string& state_id, const std::string& property_name, T& value) const + { + std::string str = gui_object_state().get_string (state_id, property_name); + + if (!str.empty ()) { + return PBD::string_to(str, value); + } + return false; + } + + void set_gui_property (const std::string& property_name, const std::string& value); void remove_gui_property (const std::string& property_name); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 8bd0b8f440..4a723ba16e 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -2045,9 +2045,23 @@ RouteTimeAxisView::add_existing_processor_automation_curves (boost::weak_ptr existing; - processor->what_has_data (existing); + /* Also add explicitly visible */ + const std::set& automatable = processor->what_can_be_automated (); + for (std::set::const_iterator i = automatable.begin(); i != automatable.end(); ++i) { + boost::shared_ptr control = boost::dynamic_pointer_cast(processor->control(*i, false)); + if (!control) { + continue; + } + /* see also AutomationTimeAxisView::state_id() */ + std::string ctrl_state_id = std::string("automation ") + control->id().to_s(); + bool visible; + if (get_gui_property (ctrl_state_id, "visible", visible) && visible) { + existing.insert (*i); + } + } + for (set::iterator i = existing.begin(); i != existing.end(); ++i) { Evoral::Parameter param (*i);