+VCA::VCA (Session& s, int32_t num, const string& name)
+ : Stripable (s, name, PresentationInfo (num, PresentationInfo::VCA))
+ , Muteable (s, name)
+ , Automatable (s)
+ , _number (num)
+ , _gain_control (new GainControl (s, Evoral::Parameter (GainAutomation), boost::shared_ptr<AutomationList> ()))
+{
+}
+
+int
+VCA::init ()
+{
+ _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this));
+ _mute_control.reset (new MuteControl (_session, X_("mute"), *this));
+
+ add_control (_gain_control);
+ add_control (_solo_control);
+ add_control (_mute_control);
+
+ return 0;
+}
+
+VCA::~VCA ()
+{
+ DEBUG_TRACE (DEBUG::Destruction, string_compose ("delete VCA %1\n", number()));
+ {
+ Glib::Threads::Mutex::Lock lm (number_lock);
+ if (_number == next_number - 1) {
+ /* this was the "last" VCA added, so rewind the next number so
+ * that future VCAs get numbered as intended
+ */
+ next_number--;
+ }
+ }
+}
+
+XMLNode&
+VCA::get_state ()
+{
+ XMLNode* node = new XMLNode (xml_node_name);
+ node->add_property (X_("name"), _name);
+ node->add_property (X_("number"), _number);
+
+ node->add_child_nocopy (_presentation_info.get_state());
+
+ node->add_child_nocopy (_gain_control->get_state());
+ node->add_child_nocopy (_solo_control->get_state());
+ node->add_child_nocopy (_mute_control->get_state());
+ node->add_child_nocopy (get_automation_xml_state());
+
+ node->add_child_nocopy (Slavable::get_state());
+
+ return *node;
+}
+
+int
+VCA::set_state (XMLNode const& node, int version)