13
0

Use XMLNode::get_property API in AutomationTimeAxis class

This commit is contained in:
Tim Mayberry 2016-08-30 22:31:25 +10:00
parent 8d90723e8c
commit 5b71470449

View File

@ -828,13 +828,13 @@ int
AutomationTimeAxisView::set_state_2X (const XMLNode& node, int /*version*/) AutomationTimeAxisView::set_state_2X (const XMLNode& node, int /*version*/)
{ {
if (node.name() == X_("gain") && _parameter == Evoral::Parameter (GainAutomation)) { if (node.name() == X_("gain") && _parameter == Evoral::Parameter (GainAutomation)) {
XMLProperty const * shown = node.property (X_("shown"));
bool shown;
if (node.get_property (X_("shown"), shown)) {
if (shown) { if (shown) {
bool yn = string_is_affirmative (shown->value ());
if (yn) {
_canvas_display->show (); /* FIXME: necessary? show_at? */ _canvas_display->show (); /* FIXME: necessary? show_at? */
set_gui_property ("visible", shown);
} }
set_gui_property ("visible", yn);
} else { } else {
set_gui_property ("visible", false); set_gui_property ("visible", false);
} }
@ -869,16 +869,14 @@ AutomationTimeAxisView::what_has_visible_automation (const boost::shared_ptr<Aut
const XMLNode* gui_node = ac->extra_xml ("GUI"); const XMLNode* gui_node = ac->extra_xml ("GUI");
if (gui_node) { if (gui_node) {
XMLProperty const * prop = gui_node->property ("shown"); bool shown;
if (prop) { if (gui_node->get_property ("shown", shown) && shown) {
if (string_is_affirmative (prop->value())) {
visible.insert (i->first); 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 */