diff --git a/libs/ardour/ardour/directory_names.h b/libs/ardour/ardour/directory_names.h index eb5f1b6630..7c507d1086 100644 --- a/libs/ardour/ardour/directory_names.h +++ b/libs/ardour/ardour/directory_names.h @@ -39,6 +39,7 @@ namespace ARDOUR { LIBARDOUR_API extern const char* const templates_dir_name; LIBARDOUR_API extern const char* const route_templates_dir_name; LIBARDOUR_API extern const char* const surfaces_dir_name; + LIBARDOUR_API extern const char* const theme_dir_name; LIBARDOUR_API extern const char* const ladspa_dir_name; LIBARDOUR_API extern const char* const panner_dir_name; LIBARDOUR_API extern const char* const backend_dir_name; diff --git a/libs/ardour/ardour/search_paths.h b/libs/ardour/ardour/search_paths.h index 3130515852..f280e5dd3f 100644 --- a/libs/ardour/ardour/search_paths.h +++ b/libs/ardour/ardour/search_paths.h @@ -79,19 +79,29 @@ namespace ARDOUR { * * If ARDOUR_MIDI_PATCH_PATH is defined then the Searchpath returned * will contain only those directories specified in it, otherwise it will - * contain the user and system directories which may contain control - * surface plugins. + * contain the user and system directories. */ LIBARDOUR_API PBD::Searchpath midi_patch_search_path (); + /** + * return a Searchpath containing directories in which to look for + * theme files. + * + * If ARDOUR_THEMES_PATH is defined then the Searchpath returned + * will contain only those directories specified in it, otherwise it will + * contain the user and system directories + */ + LIBARDOUR_API PBD::Searchpath theme_search_path (); + + /** * return a Searchpath containing directories in which to look for * panner plugins. * * If ARDOUR_PANNER_PATH is defined then the Searchpath returned * will contain only those directories specified in it, otherwise it will - * contain the user and system directories which may contain control - * surface plugins. + * contain the user and system directories which may contain panner + * plugins. */ LIBARDOUR_API PBD::Searchpath panner_search_path (); diff --git a/libs/ardour/directory_names.cc b/libs/ardour/directory_names.cc index 298e4a20b3..a8108e9a39 100644 --- a/libs/ardour/directory_names.cc +++ b/libs/ardour/directory_names.cc @@ -37,6 +37,7 @@ const char* const templates_dir_name = X_("templates"); const char* const route_templates_dir_name = X_("route_templates"); const char* const surfaces_dir_name = X_("surfaces"); const char* const ladspa_dir_name = X_("ladspa"); +const char* const theme_dir_name = X_("themes"); const char* const panner_dir_name = X_("panners"); const char* const backend_dir_name = X_("backends"); const char* const automation_dir_name = X_("automation"); diff --git a/libs/ardour/search_paths.cc b/libs/ardour/search_paths.cc index 8ee1dbc150..06032004c9 100644 --- a/libs/ardour/search_paths.cc +++ b/libs/ardour/search_paths.cc @@ -38,6 +38,7 @@ namespace { const char * const backend_env_variable_name = "ARDOUR_BACKEND_PATH"; const char * const surfaces_env_variable_name = "ARDOUR_SURFACES_PATH"; const char * const export_env_variable_name = "ARDOUR_EXPORT_FORMATS_PATH"; + const char * const theme_env_variable_name = "ARDOUR_THEMES_PATH"; const char * const ladspa_env_variable_name = "LADSPA_PATH"; const char * const midi_patch_env_variable_name = "ARDOUR_MIDI_PATCH_PATH"; const char * const panner_env_variable_name = "ARDOUR_PANNER_PATH"; @@ -69,6 +70,16 @@ control_protocol_search_path () return spath; } +Searchpath +theme_search_path () +{ + Searchpath spath(user_config_directory ()); + spath.add_subdirectory_to_paths (theme_dir_name); + + spath += Searchpath(Glib::getenv(theme_env_variable_name)); + return spath; +} + Searchpath export_formats_search_path () {