From 815d93a1e714d8644add1c48cff4304fe0d97694 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sun, 28 Aug 2016 11:18:08 +1000 Subject: [PATCH] Use XMLNode::get/set_parameter API in ARDOUR::MidiAutomationListBinder class --- libs/ardour/midi_automation_list_binder.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libs/ardour/midi_automation_list_binder.cc b/libs/ardour/midi_automation_list_binder.cc index b01155b739..986a6796cc 100644 --- a/libs/ardour/midi_automation_list_binder.cc +++ b/libs/ardour/midi_automation_list_binder.cc @@ -35,17 +35,18 @@ MidiAutomationListBinder::MidiAutomationListBinder (boost::shared_ptrproperty ("source-id"); - assert (source); + std::string id_str; + std::string parameter_str; + if (!node->get_property ("source-id", id_str) || + !node->get_property ("parameter", parameter_str)) { + assert (false); + } - XMLProperty const * parameter = node->property ("parameter"); - assert (parameter); - - Session::SourceMap::const_iterator i = sources.find (PBD::ID (source->value())); + Session::SourceMap::const_iterator i = sources.find (PBD::ID (id_str)); assert (i != sources.end()); _source = boost::dynamic_pointer_cast (i->second); - _parameter = EventTypeMap::instance().from_symbol (parameter->value()); + _parameter = EventTypeMap::instance().from_symbol (parameter_str); } AutomationList* @@ -63,6 +64,6 @@ MidiAutomationListBinder::get () const void MidiAutomationListBinder::add_state (XMLNode* node) { - node->add_property ("source-id", _source->id().to_s()); - node->add_property ("parameter", EventTypeMap::instance().to_symbol (_parameter)); + node->set_property ("source-id", _source->id().to_s()); + node->set_property ("parameter", EventTypeMap::instance().to_symbol (_parameter)); }