13
0

Fix automation dropdown menu-item active state

Extra XML/GUI has not been in use since ages.
Automation Lane visibility is saved as GUIObjectState.

This properly marks DropDown Menu items as active when a
Plugin Automation Lane is displayed
This commit is contained in:
Robin Gareus 2019-12-12 03:01:31 +01:00
parent ff7fe6d4d6
commit a92dddda25
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 6 additions and 38 deletions

View File

@ -1009,35 +1009,6 @@ AutomationTimeAxisView::set_state (const XMLNode&, int /*version*/)
return 0;
}
void
AutomationTimeAxisView::what_has_visible_automation (const boost::shared_ptr<Automatable>& automatable, set<Evoral::Parameter>& visible)
{
/* this keeps "knowledge" of how we store visibility information
in XML private to this class.
*/
assert (automatable);
Automatable::Controls& controls (automatable->controls());
for (Automatable::Controls::iterator i = controls.begin(); i != controls.end(); ++i) {
boost::shared_ptr<AutomationControl> ac = boost::dynamic_pointer_cast<AutomationControl> (i->second);
if (ac && ac->alist()) {
const XMLNode* gui_node = ac->extra_xml ("GUI");
if (gui_node) {
bool shown;
if (gui_node->get_property ("shown", shown) && shown) {
visible.insert (i->first);
}
}
}
}
}
/** @return true if this view has any automation data to display */
bool

View File

@ -133,8 +133,6 @@ public:
return _show_regions;
}
static void what_has_visible_automation (const boost::shared_ptr<ARDOUR::Automatable>& automatable, std::set<Evoral::Parameter>& visible);
protected:
/* Note that for MIDI controller "automation" (in regions), all of these
* may be set. In this case, _automatable is likely _route so the

View File

@ -2100,9 +2100,6 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
items.clear ();
std::set<Evoral::Parameter> has_visible_automation;
AutomationTimeAxisView::what_has_visible_automation (processor, has_visible_automation);
for (std::set<Evoral::Parameter>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
ProcessorAutomationNode* pan;
@ -2119,10 +2116,6 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
_subplugin_menu_map[*i] = mitem;
if (has_visible_automation.find((*i)) != has_visible_automation.end()) {
mitem->set_active(true);
}
if ((pan = find_processor_automation_node (processor, *i)) == 0) {
/* new item */
@ -2137,6 +2130,12 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
}
boost::shared_ptr<AutomationTimeAxisView> atav = automation_child (*i);
bool visible;
if (atav && atav->get_gui_property ("visible", visible)) {
mitem->set_active(true);
}
mitem->signal_toggled().connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::processor_menu_item_toggled), rai, pan));
}