summaryrefslogtreecommitdiff
path: root/src/lib/audio_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-12 00:57:51 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-12 00:57:51 +0100
commitdf085fc0ea4f1a3f009de5a7a5bf9f241173bcba (patch)
tree597ff1fe90446aa684e5fede3a72217b0b5c3d1a /src/lib/audio_content.cc
parent1b576d63f5b5babda35c3995dd375e39baa16947 (diff)
Remove LocaleGuard and lexical_cast<> in favour of libdcp::raw_convert,
which should get things right with both decimal and thousands separators; LocaleGuard fixed decimal separators ok but not, it appears, thousands ones.
Diffstat (limited to 'src/lib/audio_content.cc')
-rw-r--r--src/lib/audio_content.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc
index b96300e15..1896c4d5c 100644
--- a/src/lib/audio_content.cc
+++ b/src/lib/audio_content.cc
@@ -18,6 +18,7 @@
*/
#include <libcxml/cxml.h>
+#include <libdcp/raw_convert.h>
#include "audio_content.h"
#include "analyse_audio_job.h"
#include "job_manager.h"
@@ -30,8 +31,8 @@
using std::string;
using std::vector;
using boost::shared_ptr;
-using boost::lexical_cast;
using boost::dynamic_pointer_cast;
+using libdcp::raw_convert;
int const AudioContentProperty::AUDIO_CHANNELS = 200;
int const AudioContentProperty::AUDIO_LENGTH = 201;
@@ -59,8 +60,6 @@ AudioContent::AudioContent (shared_ptr<const Film> f, boost::filesystem::path p)
AudioContent::AudioContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
: Content (f, node)
{
- LocaleGuard lg;
-
_audio_gain = node->number_child<float> ("AudioGain");
_audio_delay = node->number_child<int> ("AudioDelay");
}
@@ -90,11 +89,9 @@ AudioContent::AudioContent (shared_ptr<const Film> f, vector<shared_ptr<Content>
void
AudioContent::as_xml (xmlpp::Node* node) const
{
- LocaleGuard lg;
-
boost::mutex::scoped_lock lm (_mutex);
- node->add_child("AudioGain")->add_child_text (lexical_cast<string> (_audio_gain));
- node->add_child("AudioDelay")->add_child_text (lexical_cast<string> (_audio_delay));
+ node->add_child("AudioGain")->add_child_text (raw_convert<string> (_audio_gain));
+ node->add_child("AudioDelay")->add_child_text (raw_convert<string> (_audio_delay));
}