#include <unistd.h>
#include <cstdio> /* for snprintf, grrr */
+#include <glibmm/miscutils.h>
+
#include <pbd/failed_constructor.h>
#include <pbd/xml++.h>
#include <pbd/error.h>
}
int
-UIConfiguration::load_state ()
+UIConfiguration::load_defaults ()
{
- bool found = false;
+ int found = 0;
+ std::string rcfile;
+ const char* ui_conf;
+
+ ui_conf = getenv ("ARDOUR_UI_CONF");
+
+ if (ui_conf && ui_conf[0] != '\0') {
+ rcfile = find_config_file (ui_conf);
+ } else {
+ if (getenv ("ARDOUR_SAE")) {
+ rcfile = find_config_file ("ardour2_ui_sae.conf");
+ } else {
+ rcfile = find_config_file ("ardour2_ui_default.conf");
+ }
+ }
+
+ if (rcfile.length()) {
- std::string rcfile = find_config_file ("ardour2_ui_default.conf");
-
- if (rcfile.length())
- {
XMLTree tree;
- found = true;
+ found = 1;
cerr << string_compose (_("loading default ui configuration file %1"), rcfile) << endl;
return -1;
}
}
-
- rcfile = find_config_file ("ardour2_ui.conf");
+ return found;
+}
+
+int
+UIConfiguration::load_state ()
+{
+ int found = load_defaults ();
+ std::string rcfile = find_config_file ("ardour2_ui.conf");
if (rcfile.length())
{
XMLTree tree;
string rcfile;
- rcfile = get_user_ardour_path ();
- rcfile += "ardour2_ui.conf";
+ rcfile = Glib::build_filename (get_user_ardour_path (), "ardour2_ui.conf");
if (rcfile.length()) {
tree.set_root (&get_state());