diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-03-07 16:46:36 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-05-31 15:30:39 -0400 |
commit | c3afeab49c7f454f58bd1fb17b39ccac1d39258e (patch) | |
tree | c221913467b8238599ae581e8b3d1a3cab7dea08 /libs | |
parent | 7b62e08233dcb87168fa9bc2b9862cf84405cf64 (diff) |
don't increment actual VCA counter when saving session state
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/vca.h | 3 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 2 | ||||
-rw-r--r-- | libs/ardour/vca.cc | 6 |
3 files changed, 10 insertions, 1 deletions
diff --git a/libs/ardour/ardour/vca.h b/libs/ardour/ardour/vca.h index 42224eb708..069eb98564 100644 --- a/libs/ardour/ardour/vca.h +++ b/libs/ardour/ardour/vca.h @@ -55,6 +55,9 @@ class LIBARDOUR_API VCA : public Stripable, public Automatable, public boost::en static std::string default_name_template (); static int next_vca_number (); static std::string xml_node_name; + + /* used by Session to save/restore the atomic counter */ + static uint32_t get_next_vca_number (); static void set_next_vca_number (uint32_t); virtual boost::shared_ptr<GainControl> gain_control() const { return _gain_control; } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 273aef20a7..45d6f6efce 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1102,7 +1102,7 @@ Session::state (bool full_state) /* save the VCA counter */ - snprintf (buf, sizeof (buf), "%" PRIu32, VCA::next_vca_number()); + snprintf (buf, sizeof (buf), "%" PRIu32, VCA::get_next_vca_number()); node->add_property ("vca-counter", buf); /* various options */ diff --git a/libs/ardour/vca.cc b/libs/ardour/vca.cc index aafb084a40..2616549e17 100644 --- a/libs/ardour/vca.cc +++ b/libs/ardour/vca.cc @@ -55,6 +55,12 @@ VCA::set_next_vca_number (uint32_t n) g_atomic_int_set (&next_number, n); } +uint32_t +VCA::get_next_vca_number () +{ + return g_atomic_int_get (&next_number); +} + VCA::VCA (Session& s, uint32_t num, const string& name) : Stripable (s, name) , Automatable (s) |