X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Frc_configuration.cc;h=e16bf40fb7b0ca274b8574a28b56629e8d8e4063;hb=2b320d51dd080909a0e305116f1396dd1356200b;hp=7fe030fb7e0102e3d39acc2a44586f45f253900f;hpb=08371ae2cf6231bbb8522645d14add41ffa9c1c0;p=ardour.git diff --git a/libs/ardour/rc_configuration.cc b/libs/ardour/rc_configuration.cc index 7fe030fb7e..e16bf40fb7 100644 --- a/libs/ardour/rc_configuration.cc +++ b/libs/ardour/rc_configuration.cc @@ -21,11 +21,12 @@ #include /* for snprintf, grrr */ #include -#include /* for g_stat() */ +#include "pbd/gstdio_compat.h" #include #include "pbd/xml++.h" #include "pbd/file_utils.h" +#include "pbd/replace_all.h" #include "ardour/audioengine.h" #include "ardour/control_protocol_manager.h" @@ -34,8 +35,9 @@ #include "ardour/port.h" #include "ardour/rc_configuration.h" #include "ardour/session_metadata.h" +#include "ardour/types_convert.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace std; @@ -49,6 +51,9 @@ namespace ARDOUR { float speed_quietning = 0.251189; // -12dB reduction for ffwd or rewind } +static const char* user_config_file_name = "config"; +static const char* system_config_file_name = "system_config"; + RCConfiguration::RCConfiguration () : /* construct variables */ @@ -76,7 +81,7 @@ RCConfiguration::load_state () /* load system configuration first */ - if (find_file_in_search_path (ardour_config_search_path(), "ardour_system.rc", rcfile)) { + if (find_file (ardour_config_search_path(), system_config_file_name, rcfile)) { /* stupid XML Parser hates empty files */ @@ -85,7 +90,7 @@ RCConfiguration::load_state () } if (statbuf.st_size != 0) { - info << string_compose (_("Loading system configuration file %1"), rcfile) << endl; + info << string_compose (_("Loading system configuration file %1"), rcfile) << endmsg; XMLTree tree; if (!tree.read (rcfile.c_str())) { @@ -104,7 +109,7 @@ RCConfiguration::load_state () /* now load configuration file for user */ - if (find_file_in_search_path (ardour_config_search_path(), "ardour.rc", rcfile)) { + if (find_file (ardour_config_search_path(), user_config_file_name, rcfile)) { /* stupid XML parser hates empty files */ @@ -113,7 +118,7 @@ RCConfiguration::load_state () } if (statbuf.st_size != 0) { - info << string_compose (_("Loading user configuration file %1"), rcfile) << endl; + info << string_compose (_("Loading user configuration file %1"), rcfile) << endmsg; XMLTree tree; if (!tree.read (rcfile)) { @@ -136,7 +141,7 @@ RCConfiguration::load_state () int RCConfiguration::save_state() { - const std::string rcfile = Glib::build_filename (user_config_directory(), "ardour.rc"); + const std::string rcfile = Glib::build_filename (user_config_directory(), user_config_file_name); // this test seems bogus? if (!rcfile.empty()) { @@ -168,7 +173,7 @@ XMLNode& RCConfiguration::get_state () { XMLNode* root; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg; root = new XMLNode("Ardour"); @@ -189,7 +194,7 @@ XMLNode& RCConfiguration::get_variables () { XMLNode* node; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg; node = new XMLNode ("Config"); @@ -216,6 +221,7 @@ RCConfiguration::set_state (const XMLNode& root, int version) XMLNodeList nlist = root.children(); XMLNodeConstIterator niter; XMLNode *node; + LocaleGuard lg; Stateful::save_extra_xml (root); @@ -232,7 +238,8 @@ RCConfiguration::set_state (const XMLNode& root, int version) } } - Diskstream::set_disk_io_chunk_frames (minimum_disk_io_bytes.get() / sizeof (Sample)); + Diskstream::set_disk_read_chunk_frames (minimum_disk_read_bytes.get() / sizeof (Sample)); + Diskstream::set_disk_write_chunk_frames (minimum_disk_write_bytes.get() / sizeof (Sample)); return 0; } @@ -267,3 +274,4 @@ RCConfiguration::map_parameters (boost::function& functor) #undef CONFIG_VARIABLE #undef CONFIG_VARIABLE_SPECIAL } +