Move locale_convert into libdcp.
authorCarl Hetherington <cth@carlh.net>
Fri, 12 Aug 2016 08:10:08 +0000 (09:10 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 Aug 2016 08:14:09 +0000 (09:14 +0100)
26 files changed:
src/lib/audio_content.cc
src/lib/colour_conversion.cc
src/lib/config.cc
src/lib/content.cc
src/lib/ffmpeg_content.cc
src/lib/film.cc
src/lib/j2k_image_proxy.cc
src/lib/locale_convert.cc [deleted file]
src/lib/locale_convert.h [deleted file]
src/lib/player_video.cc
src/lib/raw_image_proxy.cc
src/lib/subtitle_content.cc
src/lib/user_property.h
src/lib/util.cc
src/lib/video_content.cc
src/lib/wscript
src/wx/audio_mapping_view.cc
src/wx/colour_conversion_editor.cc
src/wx/config_dialog.cc
src/wx/dcp_panel.cc
src/wx/image_sequence_dialog.cc
src/wx/playhead_to_frame_dialog.cc
src/wx/time_picker.cc
src/wx/timing_panel.cc
src/wx/video_waveform_plot.cc
src/wx/wx_util.cc

index 25a7ef8a51c96f14f4aca221ddd7edeb8630185a..e66b8b998ded170d9ec2d56df47417c278c653b7 100644 (file)
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "frame_rate_change.h"
 #include "compose.hpp"
-#include "locale_convert.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
index e4659a5d9231e2b15af01fbc0911a47d4a3c9c94..aa6b61fed29e3d861f118b0855ab6bf3ddb783d4 100644 (file)
@@ -152,7 +152,7 @@ ColourConversion::as_xml (xmlpp::Node* node) const
                in_node->add_child("B")->add_child_text (raw_convert<string> (tf->B ()));
        }
 
-       node->add_child("YUVToRGB")->add_child_text (raw_convert<string> (_yuv_to_rgb));
+       node->add_child("YUVToRGB")->add_child_text (raw_convert<string> (static_cast<int> (_yuv_to_rgb)));
        node->add_child("RedX")->add_child_text (raw_convert<string> (_red.x));
        node->add_child("RedY")->add_child_text (raw_convert<string> (_red.y));
        node->add_child("GreenX")->add_child_text (raw_convert<string> (_green.x));
index 7f457439d98f0f8a2b1b4c2fcf22b68cc74a8f0c..b5e4b4d008e317bb4e282e3f9f6e5e0363209cd3 100644 (file)
@@ -380,7 +380,7 @@ Config::write_config_xml () const
        }
 
        root->add_child("OnlyServersEncode")->add_child_text (_only_servers_encode ? "1" : "0");
-       root->add_child("TMSProtocol")->add_child_text (raw_convert<string> (_tms_protocol));
+       root->add_child("TMSProtocol")->add_child_text (raw_convert<string> (static_cast<int> (_tms_protocol)));
        root->add_child("TMSIP")->add_child_text (_tms_ip);
        root->add_child("TMSPath")->add_child_text (_tms_path);
        root->add_child("TMSUser")->add_child_text (_tms_user);
index 536036ff7e2f047c0b46ad4cc5f309b18725c00d..9083635f242eaea3f5aefe5445c1d25ccb6b8921 100644 (file)
@@ -27,9 +27,9 @@
 #include "content_factory.h"
 #include "exceptions.h"
 #include "film.h"
-#include "locale_convert.h"
 #include "job.h"
 #include "compose.hpp"
+#include <dcp/locale_convert.h>
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
@@ -46,6 +46,7 @@ using std::max;
 using std::pair;
 using boost::shared_ptr;
 using dcp::raw_convert;
+using dcp::locale_convert;
 
 int const ContentProperty::PATH = 400;
 int const ContentProperty::POSITION = 401;
index 71cda084c6b48f66057d2fd12fd53dd25bc8d4c9..b5c5ce0a8a45e64da5d52aae6a4aa3aaf482fb91 100644 (file)
@@ -33,7 +33,6 @@
 #include "exceptions.h"
 #include "frame_rate_change.h"
 #include "subtitle_content.h"
-#include "locale_convert.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 extern "C" {
@@ -223,10 +222,10 @@ FFmpegContent::as_xml (xmlpp::Node* node) const
                node->add_child("FirstVideo")->add_child_text (raw_convert<string> (_first_video.get().get()));
        }
 
-       node->add_child("ColorRange")->add_child_text (raw_convert<string> (_color_range));
-       node->add_child("ColorPrimaries")->add_child_text (raw_convert<string> (_color_primaries));
-       node->add_child("ColorTransferCharacteristic")->add_child_text (raw_convert<string> (_color_trc));
-       node->add_child("Colorspace")->add_child_text (raw_convert<string> (_colorspace));
+       node->add_child("ColorRange")->add_child_text (raw_convert<string> (static_cast<int> (_color_range)));
+       node->add_child("ColorPrimaries")->add_child_text (raw_convert<string> (static_cast<int> (_color_primaries)));
+       node->add_child("ColorTransferCharacteristic")->add_child_text (raw_convert<string> (static_cast<int> (_color_trc)));
+       node->add_child("Colorspace")->add_child_text (raw_convert<string> (static_cast<int> (_colorspace)));
        if (_bits_per_pixel) {
                node->add_child("BitsPerPixel")->add_child_text (raw_convert<string> (_bits_per_pixel.get ()));
        }
index 58c272eb16bedb078e901e91ca38da63e400176f..a41ab3c95eb2c7722418ec814185a88c06e59701 100644 (file)
@@ -361,7 +361,7 @@ Film::metadata () const
        if (_audio_processor) {
                root->add_child("AudioProcessor")->add_child_text (_audio_processor->id ());
        }
-       root->add_child("ReelType")->add_child_text (raw_convert<string> (_reel_type));
+       root->add_child("ReelType")->add_child_text (raw_convert<string> (static_cast<int> (_reel_type)));
        root->add_child("ReelLength")->add_child_text (raw_convert<string> (_reel_length));
        root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0");
        _playlist->as_xml (root->add_child ("Playlist"));
index 707a088e90f468bd219dfa853624cf03153a3d25..fb38c9e999a9d04913f14823a67a0ed581429944 100644 (file)
@@ -143,7 +143,7 @@ J2KImageProxy::add_metadata (xmlpp::Node* node) const
        node->add_child("Width")->add_child_text (raw_convert<string> (_size.width));
        node->add_child("Height")->add_child_text (raw_convert<string> (_size.height));
        if (_eye) {
-               node->add_child("Eye")->add_child_text (raw_convert<string> (_eye.get ()));
+               node->add_child("Eye")->add_child_text (raw_convert<string> (static_cast<int> (_eye.get ())));
        }
        node->add_child("Size")->add_child_text (raw_convert<string> (_data.size ()));
 }
diff --git a/src/lib/locale_convert.cc b/src/lib/locale_convert.cc
deleted file mode 100644 (file)
index 6358c0f..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "locale_convert.h"
-#include <string>
-#include <inttypes.h>
-
-using std::string;
-
-template<>
-string
-locale_convert (int x, int)
-{
-       char buffer[64];
-       snprintf (buffer, sizeof(buffer), "%d", x);
-       return buffer;
-}
-
-template<>
-string
-locale_convert (int64_t x, int)
-{
-       char buffer[64];
-       snprintf (buffer, sizeof(buffer), "%" PRId64, x);
-       return buffer;
-}
-
-template<>
-string
-locale_convert (float x, int precision)
-{
-       char format[64];
-       snprintf (format, sizeof(format), "%%.%df", precision);
-       char buffer[64];
-       snprintf (buffer, sizeof(buffer), format, x);
-       return buffer;
-}
-
-template<>
-string
-locale_convert (double x, int precision)
-{
-       char format[64];
-       snprintf (format, sizeof(format), "%%.%df", precision);
-       char buffer[64];
-       snprintf (buffer, sizeof(buffer), format, x);
-       return buffer;
-}
-
-template<>
-string
-locale_convert (string x, int)
-{
-       return x;
-}
-
-template<>
-string
-locale_convert (char* x, int)
-{
-       return x;
-}
-
-template<>
-string
-locale_convert (char const * x, int)
-{
-       return x;
-}
-
-template<>
-int
-locale_convert (string x, int)
-{
-       int y = 0;
-       sscanf (x.c_str(), "%d", &y);
-       return y;
-}
-
-template<>
-int64_t
-locale_convert (string x, int)
-{
-       int64_t y = 0;
-       sscanf (x.c_str(), "%" PRId64, &y);
-       return y;
-}
-
-template<>
-float
-locale_convert (string x, int)
-{
-       float y = 0;
-       sscanf (x.c_str(), "%f", &y);
-       return y;
-}
-
-template<>
-double
-locale_convert (string x, int)
-{
-       double y = 0;
-       sscanf (x.c_str(), "%lf", &y);
-       return y;
-}
diff --git a/src/lib/locale_convert.h b/src/lib/locale_convert.h
deleted file mode 100644 (file)
index b5c38ca..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_LOCALE_CONVERT_H
-#define DCPOMATIC_LOCALE_CONVERT_H
-
-#include <boost/static_assert.hpp>
-#include <string>
-
-template <typename P, typename Q>
-P
-locale_convert (Q x, int precision = 16)
-{
-       /* We can't write a generic version of locale_convert; all required
-          versions must be specialised.
-       */
-       BOOST_STATIC_ASSERT (sizeof (Q) == 0);
-}
-
-template <>
-std::string
-locale_convert (int x, int);
-
-template <>
-std::string
-locale_convert (int64_t x, int);
-
-template <>
-std::string
-locale_convert (float x, int precision);
-
-template <>
-std::string
-locale_convert (double x, int precision);
-
-template <>
-std::string
-locale_convert (std::string x, int);
-
-template <>
-std::string
-locale_convert (char* x, int);
-
-template <>
-std::string
-locale_convert (char const * x, int);
-
-template <>
-int
-locale_convert (std::string x, int);
-
-template <>
-int64_t
-locale_convert (std::string x, int);
-
-template <>
-float
-locale_convert (std::string x, int);
-
-template <>
-double
-locale_convert (std::string x, int);
-
-#endif
index a86ff14516c941a745914705b473ee26bdd6db61..17d3dc52270db80dc48cd782d3bc29ce9b8ce6b0 100644 (file)
@@ -159,8 +159,8 @@ PlayerVideo::add_metadata (xmlpp::Node* node) const
        node->add_child("InterHeight")->add_child_text (raw_convert<string> (_inter_size.height));
        node->add_child("OutWidth")->add_child_text (raw_convert<string> (_out_size.width));
        node->add_child("OutHeight")->add_child_text (raw_convert<string> (_out_size.height));
-       node->add_child("Eyes")->add_child_text (raw_convert<string> (_eyes));
-       node->add_child("Part")->add_child_text (raw_convert<string> (_part));
+       node->add_child("Eyes")->add_child_text (raw_convert<string> (static_cast<int> (_eyes)));
+       node->add_child("Part")->add_child_text (raw_convert<string> (static_cast<int> (_part)));
        if (_colour_conversion) {
                _colour_conversion.get().as_xml (node);
        }
index e182c0e5d17f5048f70f1814826dbfbdf4aac88f..6ebcee60c9d1c135822a8426fd3d49d7f5cec98a 100644 (file)
@@ -64,7 +64,7 @@ RawImageProxy::add_metadata (xmlpp::Node* node) const
        node->add_child("Type")->add_child_text (N_("Raw"));
        node->add_child("Width")->add_child_text (raw_convert<string> (_image->size().width));
        node->add_child("Height")->add_child_text (raw_convert<string> (_image->size().height));
-       node->add_child("PixelFormat")->add_child_text (raw_convert<string> (_image->pixel_format ()));
+       node->add_child("PixelFormat")->add_child_text (raw_convert<string> (static_cast<int> (_image->pixel_format ())));
 }
 
 void
index d6bf54aef5cf36a62bfe2d60a487d6ba7a0aa004..21bfd8a2d5fbe18ee7ab0f83c66c3d9ef368cb20 100644 (file)
@@ -224,8 +224,8 @@ SubtitleContent::as_xml (xmlpp::Node* root) const
 {
        boost::mutex::scoped_lock lm (_mutex);
 
-       root->add_child("UseSubtitles")->add_child_text (raw_convert<string> (_use));
-       root->add_child("BurnSubtitles")->add_child_text (raw_convert<string> (_burn));
+       root->add_child("UseSubtitles")->add_child_text (_use ? "1" : "0");
+       root->add_child("BurnSubtitles")->add_child_text (_burn ? "1" : "0");
        root->add_child("SubtitleXOffset")->add_child_text (raw_convert<string> (_x_offset));
        root->add_child("SubtitleYOffset")->add_child_text (raw_convert<string> (_y_offset));
        root->add_child("SubtitleXScale")->add_child_text (raw_convert<string> (_x_scale));
@@ -234,8 +234,8 @@ SubtitleContent::as_xml (xmlpp::Node* root) const
        root->add_child("Red")->add_child_text (raw_convert<string> (_colour.r));
        root->add_child("Green")->add_child_text (raw_convert<string> (_colour.g));
        root->add_child("Blue")->add_child_text (raw_convert<string> (_colour.b));
-       root->add_child("Outline")->add_child_text (raw_convert<string> (_outline));
-       root->add_child("Shadow")->add_child_text (raw_convert<string> (_shadow));
+       root->add_child("Outline")->add_child_text (_outline ? "1" : "0");
+       root->add_child("Shadow")->add_child_text (_shadow ? "1" : "0");
        root->add_child("EffectRed")->add_child_text (raw_convert<string> (_effect_colour.r));
        root->add_child("EffectGreen")->add_child_text (raw_convert<string> (_effect_colour.g));
        root->add_child("EffectBlue")->add_child_text (raw_convert<string> (_effect_colour.b));
index 8b69b7687bf18de3acc570021e788b37280ce30e..ffbb99a5f4b81f1f19f233607eab59241da23715 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef DCPOMATIC_USER_PROPERTY_H
 #define DCPOMATIC_USER_PROPERTY_H
 
-#include "locale_convert.h"
+#include <dcp/locale_convert.h>
 
 class UserProperty
 {
@@ -37,7 +37,7 @@ public:
        UserProperty (Category category_, std::string key_, T value_, std::string unit_ = "")
                : category (category_)
                , key (key_)
-               , value (locale_convert<std::string> (value_))
+               , value (dcp::locale_convert<std::string> (value_))
                , unit (unit_)
        {}
 
index eedc7ddb5bc692847d927485f780806dbd064d57..d20fd7dc7b0f4d94cb830dfaf6db4d07683d446d 100644 (file)
@@ -36,7 +36,7 @@
 #include "digester.h"
 #include "audio_processor.h"
 #include "compose.hpp"
-#include "locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <dcp/util.h>
 #include <dcp/raw_convert.h>
 #include <dcp/picture_asset.h>
@@ -94,6 +94,7 @@ using boost::lexical_cast;
 using boost::bad_lexical_cast;
 using dcp::Size;
 using dcp::raw_convert;
+using dcp::locale_convert;
 
 /** Path to our executable, required by the stacktrace stuff and filled
  *  in during App::onInit().
index ac038678c9762d7898953267e6e82fcc2ab03584..4f1b08016ae7c438da59e10a9204d284408abe2f 100644 (file)
@@ -30,7 +30,6 @@
 #include "exceptions.h"
 #include "frame_rate_change.h"
 #include "log.h"
-#include "locale_convert.h"
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <dcp/colour_matrix.h>
index 074c12ad406af425f4a426b4921f01542fc1e453..911ee0af43ac8c12cfe51906fc17a2f4684db09e 100644 (file)
@@ -94,7 +94,6 @@ sources = """
           job.cc
           job_manager.cc
           json_server.cc
-          locale_convert.cc
           log.cc
           log_entry.cc
           magick_image_proxy.cc
index 866156336e2fb1f621a024045853187874c878b6..0833eadde25c5fce10215772169d780a8162b1a2 100644 (file)
@@ -27,7 +27,7 @@
 #include "audio_gain_dialog.h"
 #include "lib/audio_mapping.h"
 #include "lib/util.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <dcp/types.h>
 #include <wx/wx.h>
 #include <wx/renderer.h>
@@ -45,6 +45,7 @@ using std::vector;
 using std::pair;
 using std::make_pair;
 using boost::shared_ptr;
+using dcp::locale_convert;
 
 #define INDICATOR_SIZE 16
 #define LEFT_WIDTH 48
index e56f30baf219f04e1ca05f83e69000b5aa18bd4f..d21d45fd2b21f41e2e940ee6c84e0bf934ad9bae 100644 (file)
@@ -21,7 +21,7 @@
 #include "wx_util.h"
 #include "colour_conversion_editor.h"
 #include "lib/colour_conversion.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <dcp/gamma_transfer_function.h>
 #include <dcp/modified_gamma_transfer_function.h>
 #include <wx/spinctrl.h>
@@ -32,6 +32,7 @@ using std::string;
 using std::cout;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
+using dcp::locale_convert;
 
 ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
        : wxPanel (parent, wxID_ANY)
index 6006ba782bf336373e2d3604da7af6fc9d96628a..cb9f4669b8c7a0cfa7057b2606e7a73c9f10d969 100644 (file)
@@ -41,7 +41,7 @@
 #include "lib/util.h"
 #include "lib/cross.h"
 #include "lib/exceptions.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <dcp/exceptions.h>
 #include <dcp/certificate_chain.h>
 #include <wx/stdpaths.h>
@@ -63,6 +63,7 @@ using boost::bind;
 using boost::shared_ptr;
 using boost::function;
 using boost::optional;
+using dcp::locale_convert;
 
 class Page
 {
index 8cbd1dbb654ed947038b1e03b6f5789aceccaf6d..ea131524661fa9e81692ce87923b5c9163b4cd7e 100644 (file)
@@ -34,7 +34,7 @@
 #include "lib/subtitle_content.h"
 #include "lib/dcp_content.h"
 #include "lib/audio_content.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <dcp/key.h>
 #include <wx/wx.h>
 #include <wx/notebook.h>
@@ -53,6 +53,7 @@ using std::max;
 using std::make_pair;
 using boost::lexical_cast;
 using boost::shared_ptr;
+using dcp::locale_convert;
 
 DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
        : _audio_dialog (0)
index a207338a1b6ee68cd29071ca01e99501a7cc1ece..0484b900ea176e3fe55b8bf09aa9de9de409441b 100644 (file)
@@ -20,7 +20,9 @@
 
 #include "wx_util.h"
 #include "image_sequence_dialog.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
+
+using dcp::locale_convert;
 
 ImageSequenceDialog::ImageSequenceDialog (wxWindow* parent)
        : TableDialog (parent, _("Add image sequence"), 2, 1, true)
index 3f1d06d2a9affa4a953bdf6f6b18f8957ece8ebf..137be60ae7c0c8e96134e54cae47c9d98f87233d 100644 (file)
@@ -19,7 +19,9 @@
 */
 
 #include "playhead_to_frame_dialog.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
+
+using dcp::locale_convert;
 
 PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps)
        : TableDialog (parent, _("Go to frame"), 2, 1, true)
index bddf615d0c68ce1ed276787c115a3206aede1dea..309e5c713b564cea157d8f772270786284e5b292 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "time_picker.h"
 #include "wx_util.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <wx/spinctrl.h>
 #include <boost/bind.hpp>
 #include <iomanip>
@@ -32,6 +32,7 @@ using std::max;
 using std::string;
 using std::cout;
 using boost::bind;
+using dcp::locale_convert;
 
 TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
        : wxPanel (parent)
index 25cf2b5248ae46ccdfeda0ff5ce19c9e4b4a53dc..d9777834f9a113015108841b8ca329063bacdcd7 100644 (file)
@@ -30,8 +30,8 @@
 #include "lib/dcp_subtitle_content.h"
 #include "lib/audio_content.h"
 #include "lib/text_subtitle_content.h"
-#include "lib/locale_convert.h"
 #include "lib/video_content.h"
+#include <dcp/locale_convert.h>
 #include <boost/foreach.hpp>
 #include <set>
 #include <iostream>
@@ -42,6 +42,7 @@ using std::set;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
+using dcp::locale_convert;
 
 TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer)
        /* horrid hack for apparent lack of context support with wxWidgets i18n code */
index 096d340e868b8c4139547b5ca1a572b82cd32d20..794922bff190fcfff2c3cb244f13029efab1a278 100644 (file)
@@ -23,7 +23,7 @@
 #include "wx_util.h"
 #include "lib/image.h"
 #include "lib/dcp_video.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <dcp/openjpeg_image.h>
 #include <wx/rawbmp.h>
 #include <wx/graphics.h>
@@ -35,6 +35,7 @@ using std::min;
 using std::string;
 using boost::weak_ptr;
 using boost::shared_ptr;
+using dcp::locale_convert;
 
 int const VideoWaveformPlot::_vertical_margin = 8;
 
index cb9f72a42b0e689e1edd83d045570587f73609c8..05f2db121ac69496ce828c828929820ad1db65d7 100644 (file)
 #include "file_picker_ctrl.h"
 #include "lib/config.h"
 #include "lib/util.h"
-#include "lib/locale_convert.h"
+#include <dcp/locale_convert.h>
 #include <wx/spinctrl.h>
 #include <boost/thread.hpp>
 
 using namespace std;
 using namespace boost;
+using dcp::locale_convert;
 
 /** Add a wxStaticText to a wxSizer, aligning it at vertical centre.
  *  @param s Sizer to add to.