don't increment actual VCA counter when saving session state

This commit is contained in:
Paul Davis 2016-03-07 16:46:36 -05:00
parent 7b62e08233
commit c3afeab49c
3 changed files with 10 additions and 1 deletions

View 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; }

View 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 */

View 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)