#include "ardour/search_paths.h"
#include "ardour/io.h"
+#include "pbd/i18n.h"
+
using namespace std;
using namespace PBD;
rti.path = *i;
if (read_xml) {
+
XMLTree tree;
if (!tree.read (file.c_str())) {
+ cerr << "Failed to parse Route-template XML file: " << file;
continue;
}
- // TODO extract description,
- // compare to Session::get_info_from_path
+
+ XMLNode* root = tree.root();
+
+ rti.modified_with = _("(unknown)");
+ try {
+ XMLNode *pv = root->child("ProgramVersion");
+ string modified_with;
+ if (pv != 0) {
+ pv->get_property (X_("modified-with"), modified_with);
+ }
+ rti.modified_with = modified_with;
+ } catch (XMLException &e) {}
+
+ rti.description = _("No Description");
+ try {
+ XMLNode *desc = root->child("description");
+ if (desc != 0) {
+ rti.description = desc->attribute_value();
+ }
+ } catch (XMLException &e) {}
}
template_names.push_back (rti);
}
+ std::sort(template_names.begin(), template_names.end());
}
void
XMLTree tree;
if (!tree.read (fullpath.c_str())) {
+ cerr << "Failed to parse Route-template XML file: " << fullpath;
continue;
}
TemplateInfo rti;
+ rti.modified_with = _("(unknown)");
+ try {
+ XMLNode *pv = root->child("ProgramVersion");
+ string modified_with;
+ if (pv != 0) {
+ pv->get_property (X_("modified-with"), modified_with);
+ }
+ rti.modified_with = modified_with;
+ } catch (XMLException &e) {}
+
+ rti.description = _("No Description");
+ try {
+ XMLNode *desc = root->child("description");
+ if (desc != 0) {
+ rti.description = desc->attribute_value();
+ }
+ } catch (XMLException &e) {}
+
rti.name = IO::name_from_state (*root->children().front());
rti.path = fullpath;