From 62ce5465cadaa6cf7e315cb1dc2e61444bc19e01 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 11 Aug 2017 14:58:41 +0200 Subject: [PATCH] Prepare for templates w/description --- libs/ardour/ardour/template_utils.h | 1 + libs/ardour/template_utils.cc | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/ardour/ardour/template_utils.h b/libs/ardour/ardour/template_utils.h index 9887ab9cdc..d89d0bcdaf 100644 --- a/libs/ardour/ardour/template_utils.h +++ b/libs/ardour/ardour/template_utils.h @@ -37,6 +37,7 @@ namespace ARDOUR { struct LIBARDOUR_API TemplateInfo { std::string name; std::string path; + std::string description; }; LIBARDOUR_API void find_route_templates (std::vector& template_names); diff --git a/libs/ardour/template_utils.cc b/libs/ardour/template_utils.cc index 81a7f31078..d355231115 100644 --- a/libs/ardour/template_utils.cc +++ b/libs/ardour/template_utils.cc @@ -94,18 +94,19 @@ find_session_templates (vector& template_names, bool read_xml) for (vector::iterator i = templates.begin(); i != templates.end(); ++i) { string file = session_template_dir_to_file (*i); + TemplateInfo rti; + rti.name = Glib::path_get_basename (*i); + rti.path = *i; + if (read_xml) { XMLTree tree; if (!tree.read (file.c_str())) { continue; } + // TODO extract description, + // compare to Session::get_info_from_path } - TemplateInfo rti; - - rti.name = Glib::path_get_basename (*i); - rti.path = *i; - template_names.push_back (rti); } } -- 2.30.2