infrastructure for finding theme files
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 29 May 2016 15:42:56 +0000 (11:42 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 May 2016 19:30:45 +0000 (15:30 -0400)
libs/ardour/ardour/directory_names.h
libs/ardour/ardour/search_paths.h
libs/ardour/directory_names.cc
libs/ardour/search_paths.cc

index eb5f1b6630176d9cc33cc902bc337e7368513fa3..7c507d1086d1122f1c83bcc5ce69f71189037a83 100644 (file)
@@ -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;
index 31305158525e32d956db42daa622e8bcb38a5805..f280e5dd3f6d73c8c2d4075b9cc89b1ab2f5cbca 100644 (file)
@@ -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 ();
 
index 298e4a20b3d5e1cd89b8c2cd900e5c27319f67e5..a8108e9a39da8b7ed7e2c1a45dd7e998a04bdde5 100644 (file)
@@ -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");
index 8ee1dbc150dbe5f4767ad602f82b89d4e845ac9b..06032004c9aa7d0141637cdc42f7ccde6545de2b 100644 (file)
@@ -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 ()
 {