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/vca.cc | |
parent | 1132d3f4c8871ab15364b442da49acfdfeff1223 (diff) |
save+restore VCA counter value across instances
Diffstat (limited to 'libs/ardour/vca.cc')
-rw-r--r-- | libs/ardour/vca.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/vca.cc b/libs/ardour/vca.cc index 6873a29df9..aafb084a40 100644 --- a/libs/ardour/vca.cc +++ b/libs/ardour/vca.cc @@ -31,7 +31,7 @@ using namespace ARDOUR; using namespace PBD; using std::string; -gint VCA::next_number = 0; +gint VCA::next_number = 1; string VCA::xml_node_name (X_("VCA")); string @@ -43,8 +43,16 @@ VCA::default_name_template () int VCA::next_vca_number () { - /* recall that atomic_int_add() returns the value before the add */ - return g_atomic_int_add (&next_number, 1) + 1; + /* recall that atomic_int_add() returns the value before the add. We + * start at one, then next one will be two etc. + */ + return g_atomic_int_add (&next_number, 1); +} + +void +VCA::set_next_vca_number (uint32_t n) +{ + g_atomic_int_set (&next_number, n); } VCA::VCA (Session& s, uint32_t num, const string& name) |