From 83cbcd41aaab5934710fe06769627241c78ff8dd Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 24 Jan 2015 19:50:28 -0500 Subject: [PATCH] replace all uses of POSIX locale with C locale - Windows does not support POSIX locale --- gtk2_ardour/ardour_ui_dialogs.cc | 2 +- gtk2_ardour/ui_config.cc | 4 ++-- gtk2_ardour/video_timeline.cc | 8 ++++---- libs/ardour/audio_diskstream.cc | 4 ++-- libs/ardour/audio_track.cc | 2 +- libs/ardour/audio_unit.cc | 4 ++-- libs/ardour/audioregion.cc | 6 +++--- libs/ardour/automation_list.cc | 4 ++-- libs/ardour/diskstream.cc | 2 +- libs/ardour/io.cc | 6 +++--- libs/ardour/ladspa_plugin.cc | 6 +++--- libs/ardour/lv2_plugin.cc | 4 ++-- libs/ardour/midi_diskstream.cc | 4 ++-- libs/ardour/midi_track.cc | 2 +- libs/ardour/monitor_processor.cc | 2 +- libs/ardour/panner_shell.cc | 2 +- libs/ardour/plugin.cc | 2 +- libs/ardour/rc_configuration.cc | 4 ++-- libs/ardour/region.cc | 2 +- libs/ardour/session_configuration.cc | 6 +++--- libs/ardour/session_state.cc | 2 +- libs/ardour/speakers.cc | 4 ++-- libs/ardour/tempo.cc | 8 ++++---- libs/ardour/vst_plugin.cc | 4 ++-- libs/pbd/controllable.cc | 4 ++-- 25 files changed, 49 insertions(+), 49 deletions(-) diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index b76aede272..6b3e8213fb 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -151,7 +151,7 @@ ARDOUR_UI::set_session (Session *s) Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::audition_blink)); Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::feedback_blink)); - _session->SaveSessionUnderway.connect_same_thread (_session_connections, boost::bind (&ARDOUR_UI::save_session_gui_state, this)); + _session->SessionSaveUnderway.connect_same_thread (_session_connections, boost::bind (&ARDOUR_UI::save_session_gui_state, this)); _session->SaveSessionRequested.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::save_session_at_its_request, this, _1), gui_context()); _session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context()); _session->StepEditStatusChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::step_edit_status_change, this, _1), gui_context()); diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 7a4359d61d..dfa653bec8 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -180,7 +180,7 @@ XMLNode& UIConfiguration::get_state () { XMLNode* root; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); root = new XMLNode("Ardour"); @@ -198,7 +198,7 @@ XMLNode& UIConfiguration::get_variables (std::string which_node) { XMLNode* node; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); node = new XMLNode(which_node); diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc index 56ae98e9d8..88ef2d7748 100644 --- a/gtk2_ardour/video_timeline.cc +++ b/gtk2_ardour/video_timeline.cc @@ -101,7 +101,7 @@ VideoTimeLine::save_session () return; } - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); XMLNode* node = new XMLNode(X_("Videomonitor")); if (!node) return; @@ -159,7 +159,7 @@ VideoTimeLine::set_session (ARDOUR::Session *s) if (!_session) { return ; } _session->SessionSaveUnderway.connect_same_thread (sessionsave, boost::bind (&VideoTimeLine::save_session, this)); - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); XMLNode* node = _session->extra_xml (X_("Videotimeline")); @@ -240,7 +240,7 @@ VideoTimeLine::save_undo () int VideoTimeLine::set_state (const XMLNode& node, int /*version*/) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); const XMLProperty* propoffset = node.property (X_("VideoOffset")); if (propoffset) { video_offset = atoll(propoffset->value()); @@ -253,7 +253,7 @@ XMLNode& VideoTimeLine::get_state () { XMLNode* node = new XMLNode (X_("Videotimeline")); - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); node->add_property (X_("VideoOffset"), video_offset_p); return *node; } diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 875224a55d..8c8ef67178 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -1825,7 +1825,7 @@ AudioDiskstream::get_state () { XMLNode& node (Diskstream::get_state()); char buf[64] = ""; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); boost::shared_ptr c = channels.reader(); snprintf (buf, sizeof(buf), "%u", (unsigned int) c->size()); @@ -1867,7 +1867,7 @@ AudioDiskstream::set_state (const XMLNode& node, int version) XMLNodeIterator niter; uint32_t nchans = 1; XMLNode* capture_pending_node = 0; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* prevent write sources from being created */ diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 13d5c43dda..a341c6eb0c 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -244,7 +244,7 @@ AudioTrack::set_state_part_two () { XMLNode* fnode; XMLProperty* prop; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* This is called after all session state has been restored but before have been made ports and connections are established. diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index add2407f84..2a91d958d8 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1672,7 +1672,7 @@ AUPlugin::parameter_is_output (uint32_t) const void AUPlugin::add_state (XMLNode* root) const { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); CFDataRef xmlData; CFPropertyListRef propertyList; @@ -1711,7 +1711,7 @@ AUPlugin::set_state(const XMLNode& node, int version) { int ret = -1; CFPropertyListRef propertyList; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if (node.name() != state_node_name()) { error << _("Bad node sent to AUPlugin::set_state") << endmsg; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 6b29565585..c0d8dfd9e5 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -772,7 +772,7 @@ AudioRegion::get_basic_state () { XMLNode& node (Region::state ()); char buf[64]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); snprintf (buf, sizeof (buf), "%u", (uint32_t) _sources.size()); node.add_property ("channels", buf); @@ -785,7 +785,7 @@ AudioRegion::state () { XMLNode& node (get_basic_state()); XMLNode *child; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); child = node.add_child ("Envelope"); @@ -842,7 +842,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_ { const XMLNodeList& nlist = node.children(); const XMLProperty *prop; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); boost::shared_ptr the_playlist (_playlist.lock()); suspend_property_changes (); diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index e5a4493618..8685afefb7 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -238,7 +238,7 @@ AutomationList::state (bool full) { XMLNode* root = new XMLNode (X_("AutomationList")); char buf[64]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); root->add_property ("automation-id", EventTypeMap::instance().to_symbol(_parameter)); @@ -352,7 +352,7 @@ AutomationList::deserialize_events (const XMLNode& node) int AutomationList::set_state (const XMLNode& node, int version) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); XMLNodeList nlist = node.children(); XMLNode* nsos; XMLNodeIterator niter; diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 1eb1f72e83..3d98dd9564 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -458,7 +458,7 @@ Diskstream::get_state () { XMLNode* node = new XMLNode ("Diskstream"); char buf[64]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); node->add_property ("flags", enum_2_string (_flags)); node->add_property ("playlist", _playlist->name()); diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 2cc213f797..2336ee8c0c 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -527,7 +527,7 @@ IO::state (bool /*full_state*/) string str; vector::iterator ci; int n; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); Glib::Threads::Mutex::Lock lm (io_lock); node->add_property("name", _name); @@ -588,7 +588,7 @@ IO::set_state (const XMLNode& node, int version) const XMLProperty* prop; XMLNodeConstIterator iter; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* force use of non-localized representation of decimal point, since we use it a lot in XML files and so forth. @@ -644,7 +644,7 @@ IO::set_state_2X (const XMLNode& node, int version, bool in) { const XMLProperty* prop; XMLNodeConstIterator iter; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* force use of non-localized representation of decimal point, since we use it a lot in XML files and so forth. diff --git a/libs/ardour/ladspa_plugin.cc b/libs/ardour/ladspa_plugin.cc index 8b089929b5..df0efabcd7 100644 --- a/libs/ardour/ladspa_plugin.cc +++ b/libs/ardour/ladspa_plugin.cc @@ -351,7 +351,7 @@ LadspaPlugin::add_state (XMLNode* root) const { XMLNode *child; char buf[16]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); for (uint32_t i = 0; i < parameter_count(); ++i){ @@ -384,7 +384,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version) const char *data; uint32_t port_id; #endif - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if (node.name() != state_node_name()) { error << _("Bad node sent to LadspaPlugin::set_state") << endmsg; @@ -434,7 +434,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */) const char *data; uint32_t port_id; #endif - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if (node.name() != state_node_name()) { error << _("Bad node sent to LadspaPlugin::set_state") << endmsg; diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 1e27920305..63cf6c61b5 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -888,7 +888,7 @@ LV2Plugin::add_state(XMLNode* root) const XMLNode* child; char buf[16]; - LocaleGuard lg(X_("POSIX")); + LocaleGuard lg(X_("C")); for (uint32_t i = 0; i < parameter_count(); ++i) { if (parameter_is_input(i) && parameter_is_control(i)) { @@ -1256,7 +1256,7 @@ LV2Plugin::set_state(const XMLNode& node, int version) const char* sym; const char* value; uint32_t port_id; - LocaleGuard lg(X_("POSIX")); + LocaleGuard lg(X_("C")); if (node.name() != state_node_name()) { error << _("Bad node sent to LV2Plugin::set_state") << endmsg; diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index b280b815a6..a65267dac7 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -1153,7 +1153,7 @@ MidiDiskstream::get_state () { XMLNode& node (Diskstream::get_state()); char buf[64]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if (_write_source && _session.get_record_enabled()) { @@ -1187,7 +1187,7 @@ MidiDiskstream::set_state (const XMLNode& node, int version) XMLNodeList nlist = node.children(); XMLNodeIterator niter; XMLNode* capture_pending_node = 0; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* prevent write sources from being created */ diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index 0dab684ac2..6f679a74f3 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -244,7 +244,7 @@ MidiTrack::set_state_part_two () { XMLNode* fnode; XMLProperty* prop; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); /* This is called after all session state has been restored but before have been made ports and connections are established. diff --git a/libs/ardour/monitor_processor.cc b/libs/ardour/monitor_processor.cc index ed06647860..a88de86ec1 100644 --- a/libs/ardour/monitor_processor.cc +++ b/libs/ardour/monitor_processor.cc @@ -224,7 +224,7 @@ MonitorProcessor::set_state (const XMLNode& node, int version) XMLNode& MonitorProcessor::state (bool full) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); XMLNode& node (Processor::state (full)); char buf[64]; diff --git a/libs/ardour/panner_shell.cc b/libs/ardour/panner_shell.cc index 30a74db6d0..ce6e1b8e00 100644 --- a/libs/ardour/panner_shell.cc +++ b/libs/ardour/panner_shell.cc @@ -172,7 +172,7 @@ PannerShell::set_state (const XMLNode& node, int version) XMLNodeList nlist = node.children (); XMLNodeConstIterator niter; const XMLProperty *prop; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if ((prop = node.property (X_("bypassed"))) != 0) { set_bypassed (string_is_affirmative (prop->value ())); diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index 11d859ed8c..ae89570746 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -389,7 +389,7 @@ XMLNode & Plugin::get_state () { XMLNode* root = new XMLNode (state_node_name ()); - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); root->add_property (X_("last-preset-uri"), _last_preset.uri); root->add_property (X_("last-preset-label"), _last_preset.label); diff --git a/libs/ardour/rc_configuration.cc b/libs/ardour/rc_configuration.cc index cf768e0e36..74b96bdbb2 100644 --- a/libs/ardour/rc_configuration.cc +++ b/libs/ardour/rc_configuration.cc @@ -171,7 +171,7 @@ XMLNode& RCConfiguration::get_state () { XMLNode* root; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); root = new XMLNode("Ardour"); @@ -192,7 +192,7 @@ XMLNode& RCConfiguration::get_variables () { XMLNode* node; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); node = new XMLNode ("Config"); diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 1784cdbf3c..4ef0e6ddce 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1138,7 +1138,7 @@ Region::state () XMLNode *node = new XMLNode ("Region"); char buf[64]; char buf2[64]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); const char* fe = NULL; /* custom version of 'add_properties (*node);' diff --git a/libs/ardour/session_configuration.cc b/libs/ardour/session_configuration.cc index f9f43ba4b2..bd5ac778e8 100644 --- a/libs/ardour/session_configuration.cc +++ b/libs/ardour/session_configuration.cc @@ -51,7 +51,7 @@ XMLNode& SessionConfiguration::get_state () { XMLNode* root; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); root = new XMLNode ("Ardour"); root->add_child_nocopy (get_variables ()); @@ -64,7 +64,7 @@ XMLNode& SessionConfiguration::get_variables () { XMLNode* node; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); node = new XMLNode ("Config"); @@ -156,7 +156,7 @@ SessionConfiguration::load_state () XMLNode* node; if (((node = find_named_node (root, X_("Config"))) != 0)) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); set_variables(*node); info << _("Loaded custom session defaults.") << endmsg; } else { diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index e6a50c58b3..5385f8b7df 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -923,7 +923,7 @@ Session::load_state (string snapshot_name) int Session::load_options (const XMLNode& node) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); config.set_variables (node); return 0; } diff --git a/libs/ardour/speakers.cc b/libs/ardour/speakers.cc index bbad254f6e..7c7b02f0cc 100644 --- a/libs/ardour/speakers.cc +++ b/libs/ardour/speakers.cc @@ -245,7 +245,7 @@ Speakers::get_state () { XMLNode* node = new XMLNode (X_("Speakers")); char buf[32]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); for (vector::const_iterator i = _speakers.begin(); i != _speakers.end(); ++i) { XMLNode* speaker = new XMLNode (X_("Speaker")); @@ -269,7 +269,7 @@ Speakers::set_state (const XMLNode& node, int /*version*/) XMLNodeConstIterator i; const XMLProperty* prop; double a, e, d; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); int n = 0; _speakers.clear (); diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 621d1e2c74..cfced9b423 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -73,7 +73,7 @@ TempoSection::TempoSection (const XMLNode& node) { const XMLProperty *prop; BBT_Time start; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if ((prop = node.property ("start")) == 0) { error << _("TempoSection XML node has no \"start\" property") << endmsg; @@ -132,7 +132,7 @@ TempoSection::get_state() const { XMLNode *root = new XMLNode (xml_state_node_name); char buf[256]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, start().bars, @@ -195,7 +195,7 @@ MeterSection::MeterSection (const XMLNode& node) { const XMLProperty *prop; BBT_Time start; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if ((prop = node.property ("start")) == 0) { error << _("MeterSection XML node has no \"start\" property") << endmsg; @@ -249,7 +249,7 @@ MeterSection::get_state() const { XMLNode *root = new XMLNode (xml_state_node_name); char buf[256]; - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, start().bars, diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index 24020e8356..0b2bc6afca 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -158,7 +158,7 @@ VSTPlugin::set_chunk (gchar const * data, bool single) void VSTPlugin::add_state (XMLNode* root) const { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); if (_plugin->flags & 32 /* effFlagsProgramsChunks */) { @@ -195,7 +195,7 @@ VSTPlugin::add_state (XMLNode* root) const int VSTPlugin::set_state (const XMLNode& node, int version) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); int ret = -1; if (node.name() != state_node_name()) { diff --git a/libs/pbd/controllable.cc b/libs/pbd/controllable.cc index 42e015ac6f..b0aeaac2c0 100644 --- a/libs/pbd/controllable.cc +++ b/libs/pbd/controllable.cc @@ -107,7 +107,7 @@ XMLNode& Controllable::get_state () { XMLNode* node = new XMLNode (xml_node_name); - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); char buf[64]; node->add_property (X_("name"), _name); // not reloaded from XML state, just there to look at @@ -128,7 +128,7 @@ Controllable::get_state () int Controllable::set_state (const XMLNode& node, int /*version*/) { - LocaleGuard lg (X_("POSIX")); + LocaleGuard lg (X_("C")); const XMLProperty* prop; Stateful::save_extra_xml (node);