diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-07 16:25:50 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | 0dca11cb470700399c2e284649ece2ff23332660 (patch) | |
tree | cff266dd9b067de26a4d3c6f7757fe13faf28bd3 /libs/ardour/session_state.cc | |
parent | 1132d3f4c8871ab15364b442da49acfdfeff1223 (diff) |
save+restore VCA counter value across instances
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 819b2949ea..decff17f1e 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1099,6 +1099,11 @@ Session::state (bool full_state) snprintf (buf, sizeof (buf), "%d", Evoral::event_id_counter()); node->add_property ("event-counter", buf); + /* save the VCA counter */ + + snprintf (buf, sizeof (buf), "%" PRIu32, VCA::next_vca_number()); + node->add_property ("vca-counter", buf); + /* various options */ list<XMLNode*> midi_port_nodes = _midi_ports->get_midi_port_states(); @@ -1359,6 +1364,14 @@ Session::set_state (const XMLNode& node, int version) Evoral::init_event_id_counter (atoi (prop->value())); } + if ((prop = node.property (X_("vca-counter"))) != 0) { + uint32_t x; + sscanf (prop->value().c_str(), "%" PRIu32, &x); + VCA::set_next_vca_number (x); + } else { + VCA::set_next_vca_number (1); + } + if ((child = find_named_node (node, "MIDIPorts")) != 0) { _midi_ports->set_midi_port_states (child->children()); } |