mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
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:
parent
ff7fe6d4d6
commit
a92dddda25
3 changed files with 6 additions and 38 deletions
|
|
@ -1009,35 +1009,6 @@ AutomationTimeAxisView::set_state (const XMLNode&, int /*version*/)
|
||||||
return 0;
|
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 */
|
/** @return true if this view has any automation data to display */
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,6 @@ public:
|
||||||
return _show_regions;
|
return _show_regions;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void what_has_visible_automation (const boost::shared_ptr<ARDOUR::Automatable>& automatable, std::set<Evoral::Parameter>& visible);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* Note that for MIDI controller "automation" (in regions), all of these
|
/* Note that for MIDI controller "automation" (in regions), all of these
|
||||||
* may be set. In this case, _automatable is likely _route so the
|
* may be set. In this case, _automatable is likely _route so the
|
||||||
|
|
|
||||||
|
|
@ -2100,9 +2100,6 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
|
||||||
|
|
||||||
items.clear ();
|
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) {
|
for (std::set<Evoral::Parameter>::const_iterator i = automatable.begin(); i != automatable.end(); ++i) {
|
||||||
|
|
||||||
ProcessorAutomationNode* pan;
|
ProcessorAutomationNode* pan;
|
||||||
|
|
@ -2119,10 +2116,6 @@ RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p
|
||||||
|
|
||||||
_subplugin_menu_map[*i] = mitem;
|
_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) {
|
if ((pan = find_processor_automation_node (processor, *i)) == 0) {
|
||||||
|
|
||||||
/* new item */
|
/* 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));
|
mitem->signal_toggled().connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::processor_menu_item_toggled), rai, pan));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue