diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-02-14 22:47:50 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-02-14 22:47:50 +0000 |
commit | c6740a61d766cef183525c1736ecb96496272fc2 (patch) | |
tree | 7f08a97c35bd829993227e7f993deb490fed4c91 /libs/ardour/session_state.cc | |
parent | d56085060908f50be5f49021b04093596004b777 (diff) |
track templates; indent fixes needed and will be forthcoming; minor fix for the curvetest hack
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4565 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index c769e57025..f206d18644 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2058,6 +2058,12 @@ Session::template_dir () } string +Session::route_template_dir () +{ + return Glib::build_filename (get_user_ardour_path(), "route_templates"); +} + +string Session::export_dir () const { return Glib::build_filename (_path, export_dir_name); @@ -2103,6 +2109,13 @@ Session::template_path () return suffixed_search_path (X_("templates"), true); } + +string +Session::route_template_path () +{ + return suffixed_search_path (X_("route_templates"), true); +} + string Session::control_protocol_path () { @@ -2471,6 +2484,43 @@ Session::get_template_list (list<string> &template_names) } } +void +Session::get_route_templates (vector<RouteTemplateInfo>& template_names) +{ + vector<string *> *templates; + PathScanner scanner; + string path; + + path = route_template_path (); + + templates = scanner (path, template_filter, 0, false, true); + + if (!templates) { + return; + } + + for (vector<string*>::iterator i = templates->begin(); i != templates->end(); ++i) { + string fullpath = *(*i); + + XMLTree tree; + + if (!tree.read (fullpath.c_str())) { + continue; + } + + XMLNode* root = tree.root(); + + RouteTemplateInfo rti; + + rti.name = IO::name_from_state (*root->children().front()); + rti.path = fullpath; + + template_names.push_back (rti); + } + + free (templates); +} + int Session::read_favorite_dirs (FavoriteDirs & favs) { |