summaryrefslogtreecommitdiff
path: root/libs/ardour/vca.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-02-29 15:52:27 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:38 -0400
commit4478bdc1d102c8e75779a1624879ab37963b848a (patch)
tree0514a937f5e16784207430e6ecc2664059a1a76e /libs/ardour/vca.cc
parent33e56e58d7b60232d7024368aed4026a6f07a7d1 (diff)
add a bit of state to VCAs
Diffstat (limited to 'libs/ardour/vca.cc')
-rw-r--r--libs/ardour/vca.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/libs/ardour/vca.cc b/libs/ardour/vca.cc
index 67ca4733cb..f4737e433a 100644
--- a/libs/ardour/vca.cc
+++ b/libs/ardour/vca.cc
@@ -16,6 +16,8 @@
675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include "pbd/convert.h"
+
#include "ardour/automation_control.h"
#include "ardour/gain_control.h"
#include "ardour/route.h"
@@ -28,6 +30,7 @@ using namespace PBD;
using std::string;
gint VCA::next_number = 0;
+string VCA::xml_node_name (X_("VCA"));
string
VCA::default_name_template ()
@@ -74,3 +77,34 @@ VCA::remove (boost::shared_ptr<Route> r)
{
r->gain_control()->remove_master (_control);
}
+
+void
+VCA::set_name (string const& str)
+{
+ _name = str;
+}
+
+XMLNode&
+VCA::get_state ()
+{
+ XMLNode* node = new XMLNode (xml_node_name);
+ node->add_property (X_("name"), _name);
+ node->add_property (X_("number"), _number);
+ return *node;
+}
+
+int
+VCA::set_state (XMLNode const& node, int /*version*/)
+{
+ XMLProperty const* prop;
+
+ if ((prop = node.property ("name")) != 0) {
+ set_name (prop->value());
+ }
+
+ if ((prop = node.property ("number")) != 0) {
+ _number = atoi (prop->value());
+ }
+
+ return 0;
+}