diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index f4f15ff4a9..e66e0784fe 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -381,7 +381,7 @@ public: boost::weak_ptr<Route> weakroute (); - int save_as_template (const std::string& path, const std::string& name); + int save_as_template (const std::string& path, const std::string& name, const std::string& description ); PBD::Signal1<void,void*> SelectedChanged; 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); |