From 0b2ae7dad991e1fc8b88462c3cd145c1d3663392 Mon Sep 17 00:00:00 2001 From: nick_m Date: Tue, 15 Nov 2016 03:48:20 +1100 Subject: [PATCH 1/1] change note selection node name - should fix 7110 --- gtk2_ardour/selection.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 5c93fd62c8..2b496fb833 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -1273,19 +1273,18 @@ Selection::get_state () const XMLNode* n = NULL; list > > > > rid_notes; editor->get_per_region_note_selection (rid_notes); - if (!rid_notes.empty()) { - n = node->add_child (X_("MIDINote")); - } + list > > > >::iterator rn_it; for (rn_it = rid_notes.begin(); rn_it != rid_notes.end(); ++rn_it) { assert(n); // hint for clang static analysis - n->add_property (X_("region_id"), atoi((*rn_it).first.to_s().c_str())); + n = node->add_child (X_("MIDINotes")); + n->add_property (X_("region-id"), atoi((*rn_it).first.to_s().c_str())); for (std::set > >::iterator i = (*rn_it).second.begin(); i != (*rn_it).second.end(); ++i) { XMLNode* nc = n->add_child(X_("note")); snprintf(buf, sizeof(buf), "%d", (*i)->id()); - nc->add_property(X_("id"), string(buf)); + nc->add_property (X_("note-id"), string(buf)); } } @@ -1380,7 +1379,7 @@ Selection::set_state (XMLNode const & node, int) regions.pending.push_back (id); } - } else if ((*i)->name() == X_("MIDINote")) { + } else if ((*i)->name() == X_("MIDINotes")) { XMLProperty const * prop_region_id = (*i)->property (X_("region-id")); assert (prop_region_id); @@ -1394,9 +1393,9 @@ Selection::set_state (XMLNode const & node, int) XMLNodeList children = (*i)->children (); for (XMLNodeList::const_iterator ci = children.begin(); ci != children.end(); ++ci) { - XMLProperty const* prop_id = (*ci)->property (X_("id")); + XMLProperty const * prop_id = (*ci)->property (X_("note-id")); if (prop_id) { - Evoral::event_id_t id = atoi (prop_id->value ()); + Evoral::event_id_t id = atoi(prop_id->value()); notes.push_back (id); } } -- 2.30.2