diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-12 00:57:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-12 00:57:51 +0100 |
| commit | df085fc0ea4f1a3f009de5a7a5bf9f241173bcba (patch) | |
| tree | 597ff1fe90446aa684e5fede3a72217b0b5c3d1a /src/lib/audio_mapping.cc | |
| parent | 1b576d63f5b5babda35c3995dd375e39baa16947 (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_mapping.cc')
| -rw-r--r-- | src/lib/audio_mapping.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc index 301d44fa6..b1810c973 100644 --- a/src/lib/audio_mapping.cc +++ b/src/lib/audio_mapping.cc @@ -17,9 +17,9 @@ */ -#include <boost/lexical_cast.hpp> #include <libxml++/libxml++.h> #include <libcxml/cxml.h> +#include <libdcp/raw_convert.h> #include "audio_mapping.h" #include "util.h" @@ -30,8 +30,8 @@ using std::pair; using std::string; using std::min; using boost::shared_ptr; -using boost::lexical_cast; using boost::dynamic_pointer_cast; +using libdcp::raw_convert; AudioMapping::AudioMapping () : _content_channels (0) @@ -94,7 +94,7 @@ AudioMapping::AudioMapping (shared_ptr<const cxml::Node> node, int state_version set ( (*i)->number_attribute<int> ("Content"), static_cast<libdcp::Channel> ((*i)->number_attribute<int> ("DCP")), - lexical_cast<float> ((*i)->content ()) + raw_convert<float> ((*i)->content ()) ); } } @@ -115,14 +115,14 @@ AudioMapping::get (int c, libdcp::Channel d) const void AudioMapping::as_xml (xmlpp::Node* node) const { - node->add_child ("ContentChannels")->add_child_text (lexical_cast<string> (_content_channels)); + node->add_child ("ContentChannels")->add_child_text (raw_convert<string> (_content_channels)); for (int c = 0; c < _content_channels; ++c) { for (int d = 0; d < MAX_DCP_AUDIO_CHANNELS; ++d) { xmlpp::Element* t = node->add_child ("Gain"); - t->set_attribute ("Content", lexical_cast<string> (c)); - t->set_attribute ("DCP", lexical_cast<string> (d)); - t->add_child_text (lexical_cast<string> (get (c, static_cast<libdcp::Channel> (d)))); + t->set_attribute ("Content", raw_convert<string> (c)); + t->set_attribute ("DCP", raw_convert<string> (d)); + t->add_child_text (raw_convert<string> (get (c, static_cast<libdcp::Channel> (d)))); } } } |
