From 245154d06aa79c7cb75d52a366a2ad3fa9c3a578 Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Sat, 19 Aug 2017 13:49:33 +0200 Subject: Let user add a route template description on saving route templates --- libs/ardour/route.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libs/ardour/route.cc') 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 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 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); -- cgit v1.2.3