diff options
author | Doug McLain <doug@nostar.net> | 2006-03-10 07:16:45 +0000 |
---|---|---|
committer | Doug McLain <doug@nostar.net> | 2006-03-10 07:16:45 +0000 |
commit | 276d290a422f3c13a3e72d907eb4882e9db53105 (patch) | |
tree | 87298f5b550eb45f32c4eb1d5355380750ba649c /libs | |
parent | 58bd9bff8db593dab69188199632aeabbcf8be8d (diff) |
Example code to load the x and <-> xpms for the mixer strip from files instead of from hard coded xpm data.
git-svn-id: svn://localhost/trunk/ardour2@370 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/ardour.h | 2 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 31bd22590e..293d346823 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -48,7 +48,7 @@ namespace ARDOUR { int init (AudioEngine&, bool with_vst, bool try_optimization, void (*sighandler)(int,siginfo_t*,void*) = 0); int cleanup (); std::string find_config_file (std::string name); - std::string find_data_file (std::string name); + std::string find_data_file (std::string name, std::string subdir = "" ); const layer_t max_layer = UCHAR_MAX; diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 2d64c02c40..99cf9f9890 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -299,7 +299,7 @@ ARDOUR::new_change () } static string -find_file (string name, string dir) +find_file (string name, string dir, string subdir = "") { string path; @@ -317,8 +317,12 @@ find_file (string name, string dir) mkdir (path.c_str(), 0755); + if (subdir.length()) { + path += subdir + "/"; + } + path += name; - + cerr << path << endl; if (access (path.c_str(), R_OK) == 0) { return path; } @@ -328,6 +332,11 @@ find_file (string name, string dir) path = dir; path += "/ardour/"; + + if (subdir.length()) { + path += subdir + "/"; + } + path += name; if (access (path.c_str(), R_OK) == 0) { @@ -349,14 +358,14 @@ ARDOUR::find_config_file (string name) } string -ARDOUR::find_data_file (string name) +ARDOUR::find_data_file (string name, string subdir) { char* envvar; if ((envvar = getenv("ARDOUR_DATA_PATH")) == 0) { envvar = DATA_DIR; } - return find_file (name, envvar); + return find_file (name, envvar, subdir); } ARDOUR::LocaleGuard::LocaleGuard (const char* str) |