changing the start (position) of a marker with a scene change needs to update the...
[ardour.git] / gtk2_ardour / ui_config.cc
index ff49301419cf3181e70b66d1e59634871df3151f..215df25e7f2ea179c79d1a834d091c4b6a1837c4 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "pbd/failed_constructor.h"
 #include "pbd/xml++.h"
-#include "pbd/filesystem.h"
 #include "pbd/file_utils.h"
 #include "pbd/error.h"
 
@@ -60,6 +59,15 @@ UIConfiguration::~UIConfiguration ()
 {
 }
 
+void
+UIConfiguration::map_parameters (boost::function<void (std::string)>& functor)
+{
+#undef  UI_CONFIG_VARIABLE
+#define UI_CONFIG_VARIABLE(Type,var,Name,value) functor (Name);
+#include "ui_config_vars.h"
+#undef  UI_CONFIG_VARIABLE
+}
+
 int
 UIConfiguration::load_defaults ()
 {
@@ -160,18 +168,8 @@ UIConfiguration::save_state()
 {
        XMLTree tree;
 
-       try {
-               sys::create_directories (user_config_directory ());
-       }
-       catch (const sys::filesystem_error& ex) {
-               error << "Could not create user configuration directory" << endmsg;
-               return -1;
-       }
-
-       sys::path rcfile_path(user_config_directory());
-
-       rcfile_path /= "ardour3_ui.conf";
-       const string rcfile = rcfile_path.to_string();
+       std::string rcfile(user_config_directory());
+       rcfile = Glib::build_filename (rcfile, "ardour3_ui.conf");
 
        // this test seems bogus?
        if (rcfile.length()) {
@@ -289,7 +287,7 @@ UIConfiguration::color_by_name (const std::string& name)
        }
 
        // cerr << string_compose (_("Color %1 not found"), name) << endl;
-       return RGBA_TO_UINT (random()%256,random()%256,random()%256,0xff);
+       return RGBA_TO_UINT (g_random_int()%256,g_random_int()%256,g_random_int()%256,0xff);
 }
 
 void