summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2017-08-19 13:49:33 +0200
committerRobin Gareus <robin@gareus.org>2017-08-20 21:09:30 +0200
commit245154d06aa79c7cb75d52a366a2ad3fa9c3a578 (patch)
tree58c811c962790710c07066d5ce7659f16c7e077d /libs/ardour/route.cc
parentae51d5fd4ebb90f782334ac0b4addc0c88e1629c (diff)
Let user add a route template description on saving route templates
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index d3412f0387..5cd9b576a5 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -4014,7 +4014,7 @@ Route::set_plugin_state_dir (boost::weak_ptr<Processor> p, const std::string& d)
}
int
-Route::save_as_template (const string& path, const string& name)
+Route::save_as_template (const string& path, const string& name, const string& description)
{
std::string state_dir = path.substr (0, path.find_last_of ('.')); // strip template_suffix
PBD::Unwinder<std::string> uw (_session._template_state_dir, state_dir);
@@ -4022,6 +4022,14 @@ Route::save_as_template (const string& path, const string& name)
XMLNode& node (state (false));
node.set_property (X_("name"), name);
+ if (!description.empty()) {
+ XMLNode* desc = new XMLNode(X_("description"));
+ XMLNode* desc_cont = new XMLNode(X_("content"), description);
+ desc->add_child_nocopy (*desc_cont);
+
+ node.add_child_nocopy (*desc);
+ }
+
XMLTree tree;
IO::set_name_in_state (*node.children().front(), name);