diff options
author | Johannes Mueller <github@johannes-mueller.org> | 2017-08-19 13:49:33 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-20 21:09:30 +0200 |
commit | 245154d06aa79c7cb75d52a366a2ad3fa9c3a578 (patch) | |
tree | 58c811c962790710c07066d5ce7659f16c7e077d /libs/ardour | |
parent | ae51d5fd4ebb90f782334ac0b4addc0c88e1629c (diff) |
Let user add a route template description on saving route templates
Diffstat (limited to 'libs/ardour')
-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); |