don't increment actual VCA counter when saving session state
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 7 Mar 2016 21:46:36 +0000 (16:46 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:39 +0000 (15:30 -0400)
libs/ardour/ardour/vca.h
libs/ardour/session_state.cc
libs/ardour/vca.cc

index 42224eb7083e4e8fc92bf8627418ec6d55786caf..069eb98564892f23658b409189992633286cc8e5 100644 (file)
@@ -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; }
index 273aef20a7f08626ed4f4621176394deef8720e0..45d6f6efcedc6040099eea9d85afc45a9e173e4e 100644 (file)
@@ -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 */
index aafb084a40bf614e09d5001277f52c5a4b2ca423..2616549e1722b2880f16995670564b8cb6fcb7e2 100644 (file)
@@ -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)