diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2017-08-14 16:14:42 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2017-08-14 16:14:42 -0500 |
commit | 47d86cf54d64ae2f65c7ffa961ccc583d33f3382 (patch) | |
tree | 5d4ef1d0f153ccd8cfc51e4b8547724f79d46350 /libs | |
parent | 0a0eec2adca785e6fff1b1e798bbded196188f4c (diff) |
Change the template pulldown menu into a tree list. Populate the Description view when a template is selected.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/template_utils.h | 1 | ||||
-rw-r--r-- | libs/ardour/template_utils.cc | 23 |
2 files changed, 22 insertions, 2 deletions
diff --git a/libs/ardour/ardour/template_utils.h b/libs/ardour/ardour/template_utils.h index d89d0bcdaf..07ba1d62ae 100644 --- a/libs/ardour/ardour/template_utils.h +++ b/libs/ardour/ardour/template_utils.h @@ -38,6 +38,7 @@ namespace ARDOUR { std::string name; std::string path; std::string description; + std::string created_with; }; LIBARDOUR_API void find_route_templates (std::vector<TemplateInfo>& template_names); diff --git a/libs/ardour/template_utils.cc b/libs/ardour/template_utils.cc index d355231115..75c8d5b9af 100644 --- a/libs/ardour/template_utils.cc +++ b/libs/ardour/template_utils.cc @@ -33,6 +33,8 @@ #include "ardour/search_paths.h" #include "ardour/io.h" +#include "pbd/i18n.h" + using namespace std; using namespace PBD; @@ -103,8 +105,25 @@ find_session_templates (vector<TemplateInfo>& template_names, bool read_xml) if (!tree.read (file.c_str())) { continue; } - // TODO extract description, - // compare to Session::get_info_from_path + + string created_with = "(unknown)"; + XMLNode *pv = tree.root()->child("ProgramVersion"); + if (pv != 0) { + pv->get_property (X_("created-with"), created_with); + } + + string description = "No Description"; + XMLNode *md = tree.root()->child("Metadata"); + if (md != 0) { + XMLNode *desc = md->child("description"); + if (desc != 0) { + description = desc->attribute_value(); + } + } + + rti.created_with = created_with; + rti.description = description; + } template_names.push_back (rti); |