summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-11 11:07:18 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-12 09:14:05 +0100
commit73654117144c6de0ec4efe39ddc88485df546cc9 (patch)
tree4402a65c2988ba6e678c4cf51f6e2d48cad424e5 /src
parentb1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f (diff)
Move raw_convert into libdcp.
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_analysis.cc3
-rw-r--r--src/lib/audio_content.cc3
-rw-r--r--src/lib/audio_mapping.cc3
-rw-r--r--src/lib/audio_point.cc3
-rw-r--r--src/lib/colour_conversion.cc3
-rw-r--r--src/lib/config.cc3
-rw-r--r--src/lib/content.cc3
-rw-r--r--src/lib/content.h1
-rw-r--r--src/lib/dcp_content.cc1
-rw-r--r--src/lib/dcp_subtitle_content.cc3
-rw-r--r--src/lib/dcp_video.cc3
-rw-r--r--src/lib/encode_server.cc3
-rw-r--r--src/lib/encode_server_finder.cc3
-rw-r--r--src/lib/ffmpeg.cc3
-rw-r--r--src/lib/ffmpeg_audio_stream.cc3
-rw-r--r--src/lib/ffmpeg_content.cc3
-rw-r--r--src/lib/ffmpeg_stream.cc3
-rw-r--r--src/lib/ffmpeg_subtitle_stream.cc3
-rw-r--r--src/lib/film.cc3
-rw-r--r--src/lib/image_filename_sorter.cc3
-rw-r--r--src/lib/isdcf_metadata.cc3
-rw-r--r--src/lib/j2k_image_proxy.cc3
-rw-r--r--src/lib/json_server.cc3
-rw-r--r--src/lib/player_video.cc3
-rw-r--r--src/lib/raw_convert.cc44
-rw-r--r--src/lib/raw_convert.h60
-rw-r--r--src/lib/raw_image_proxy.cc3
-rw-r--r--src/lib/subtitle_content.cc3
-rw-r--r--src/lib/text_subtitle_content.cc3
-rw-r--r--src/lib/types.cc3
-rw-r--r--src/lib/update_checker.cc3
-rw-r--r--src/lib/user_property.h4
-rw-r--r--src/lib/util.cc1
-rw-r--r--src/lib/video_content.cc3
-rw-r--r--src/lib/wscript1
-rw-r--r--src/tools/dcpomatic.cc1
-rw-r--r--src/tools/dcpomatic_server.cc1
-rw-r--r--src/wx/audio_mapping_view.cc3
-rw-r--r--src/wx/colour_conversion_editor.cc3
-rw-r--r--src/wx/config_dialog.cc4
-rw-r--r--src/wx/content_properties_dialog.cc3
-rw-r--r--src/wx/image_sequence_dialog.cc4
-rw-r--r--src/wx/playhead_to_frame_dialog.cc4
-rw-r--r--src/wx/time_picker.cc3
-rw-r--r--src/wx/timing_panel.cc3
-rw-r--r--src/wx/video_waveform_plot.cc3
46 files changed, 81 insertions, 147 deletions
diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc
index 1863e38ee..1e5d08925 100644
--- a/src/lib/audio_analysis.cc
+++ b/src/lib/audio_analysis.cc
@@ -21,9 +21,9 @@
#include "audio_analysis.h"
#include "cross.h"
#include "util.h"
-#include "raw_convert.h"
#include "playlist.h"
#include "audio_content.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
@@ -42,6 +42,7 @@ using std::max;
using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
AudioAnalysis::AudioAnalysis (int channels)
{
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc
index 4e9d5cd5c..e66b8b998 100644
--- a/src/lib/audio_content.cc
+++ b/src/lib/audio_content.cc
@@ -23,8 +23,8 @@
#include "exceptions.h"
#include "config.h"
#include "frame_rate_change.h"
-#include "raw_convert.h"
#include "compose.hpp"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
@@ -42,6 +42,7 @@ using std::setprecision;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::raw_convert;
/** Something stream-related has changed */
int const AudioContentProperty::STREAMS = 200;
diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc
index b436d7579..bf454b5e5 100644
--- a/src/lib/audio_mapping.cc
+++ b/src/lib/audio_mapping.cc
@@ -21,7 +21,7 @@
#include "audio_mapping.h"
#include "util.h"
#include "digester.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <iostream>
@@ -36,6 +36,7 @@ using std::vector;
using std::abs;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
AudioMapping::AudioMapping ()
: _input_channels (0)
diff --git a/src/lib/audio_point.cc b/src/lib/audio_point.cc
index 45df0b3a5..b5ea2c31e 100644
--- a/src/lib/audio_point.cc
+++ b/src/lib/audio_point.cc
@@ -19,10 +19,11 @@
*/
#include "audio_point.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
using std::string;
+using dcp::raw_convert;
AudioPoint::AudioPoint ()
{
diff --git a/src/lib/colour_conversion.cc b/src/lib/colour_conversion.cc
index f17964ddc..e4659a5d9 100644
--- a/src/lib/colour_conversion.cc
+++ b/src/lib/colour_conversion.cc
@@ -22,7 +22,7 @@
#include "colour_conversion.h"
#include "util.h"
#include "digester.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <dcp/chromaticity.h>
#include <dcp/colour_matrix.h>
#include <dcp/gamma_transfer_function.h>
@@ -41,6 +41,7 @@ using std::vector;
using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
vector<PresetColourConversion> PresetColourConversion::_presets;
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 6f7c8ec55..7f457439d 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -29,7 +29,7 @@
#include "cinema.h"
#include "util.h"
#include "cross.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <dcp/name_format.h>
#include <dcp/colour_matrix.h>
#include <dcp/certificate_chain.h>
@@ -58,6 +58,7 @@ using std::cerr;
using boost::shared_ptr;
using boost::optional;
using boost::algorithm::trim;
+using dcp::raw_convert;
Config* Config::_instance = 0;
boost::signals2::signal<void ()> Config::FailedToLoad;
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 9c7e79040..0fd503edd 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -29,7 +29,7 @@
#include "film.h"
#include "job.h"
#include "compose.hpp"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/thread/mutex.hpp>
@@ -44,6 +44,7 @@ using std::vector;
using std::max;
using std::pair;
using boost::shared_ptr;
+using dcp::raw_convert;
int const ContentProperty::PATH = 400;
int const ContentProperty::POSITION = 401;
diff --git a/src/lib/content.h b/src/lib/content.h
index 6b647790f..f8b5493c0 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -28,7 +28,6 @@
#include "types.h"
#include "signaller.h"
#include "dcpomatic_time.h"
-#include "raw_convert.h"
#include "user_property.h"
#include <libcxml/cxml.h>
#include <boost/filesystem.hpp>
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index b41e31c0c..9e767596c 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -50,6 +50,7 @@ using boost::shared_ptr;
using boost::scoped_ptr;
using boost::optional;
using boost::function;
+using dcp::raw_convert;
int const DCPContentProperty::CAN_BE_PLAYED = 600;
int const DCPContentProperty::REFERENCE_VIDEO = 601;
diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc
index e7057efc4..015aebd72 100644
--- a/src/lib/dcp_subtitle_content.cc
+++ b/src/lib/dcp_subtitle_content.cc
@@ -20,9 +20,9 @@
#include "font.h"
#include "dcp_subtitle_content.h"
-#include "raw_convert.h"
#include "film.h"
#include "subtitle_content.h"
+#include <dcp/raw_convert.h>
#include <dcp/interop_subtitle_asset.h>
#include <dcp/smpte_subtitle_asset.h>
#include <dcp/interop_load_font_node.h>
@@ -35,6 +35,7 @@ using std::string;
using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, boost::filesystem::path path)
: Content (film, path)
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc
index be69f3eed..e3ba7d20f 100644
--- a/src/lib/dcp_video.cc
+++ b/src/lib/dcp_video.cc
@@ -37,9 +37,9 @@
#include "log.h"
#include "cross.h"
#include "player_video.h"
-#include "raw_convert.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
+#include <dcp/raw_convert.h>
#include <dcp/openjpeg_image.h>
#include <dcp/rgb_xyz.h>
#include <dcp/j2k.h>
@@ -62,6 +62,7 @@ using std::cout;
using boost::shared_ptr;
using dcp::Size;
using dcp::Data;
+using dcp::raw_convert;
#define DCI_COEFFICENT (48.0 / 52.37)
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc
index abd8537c0..442ce3d6f 100644
--- a/src/lib/encode_server.cc
+++ b/src/lib/encode_server.cc
@@ -31,10 +31,10 @@
#include "config.h"
#include "cross.h"
#include "player_video.h"
-#include "raw_convert.h"
#include "compose.hpp"
#include "log.h"
#include "encoded_log_entry.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/algorithm/string.hpp>
@@ -64,6 +64,7 @@ using boost::scoped_array;
using boost::optional;
using dcp::Size;
using dcp::Data;
+using dcp::raw_convert;
EncodeServer::EncodeServer (shared_ptr<Log> log, bool verbose, int num_threads)
: Server (Config::instance()->server_port_base())
diff --git a/src/lib/encode_server_finder.cc b/src/lib/encode_server_finder.cc
index 135a8bce8..e964bb8b3 100644
--- a/src/lib/encode_server_finder.cc
+++ b/src/lib/encode_server_finder.cc
@@ -25,7 +25,7 @@
#include "cross.h"
#include "encode_server_description.h"
#include "dcpomatic_socket.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <boost/lambda/lambda.hpp>
#include <iostream>
@@ -39,6 +39,7 @@ using std::cout;
using boost::shared_ptr;
using boost::scoped_array;
using boost::weak_ptr;
+using dcp::raw_convert;
EncodeServerFinder* EncodeServerFinder::_instance = 0;
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index bbf9bbed9..1f16514d7 100644
--- a/src/lib/ffmpeg.cc
+++ b/src/lib/ffmpeg.cc
@@ -23,12 +23,12 @@
#include "film.h"
#include "exceptions.h"
#include "util.h"
-#include "raw_convert.h"
#include "log.h"
#include "ffmpeg_subtitle_stream.h"
#include "ffmpeg_audio_stream.h"
#include "digester.h"
#include "compose.hpp"
+#include <dcp/raw_convert.h>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
@@ -46,6 +46,7 @@ using std::cerr;
using std::vector;
using boost::shared_ptr;
using boost::optional;
+using dcp::raw_convert;
boost::mutex FFmpeg::_mutex;
boost::weak_ptr<Log> FFmpeg::_ffmpeg_log;
diff --git a/src/lib/ffmpeg_audio_stream.cc b/src/lib/ffmpeg_audio_stream.cc
index a81f69e65..1b0d39db2 100644
--- a/src/lib/ffmpeg_audio_stream.cc
+++ b/src/lib/ffmpeg_audio_stream.cc
@@ -19,12 +19,13 @@
*/
#include "ffmpeg_audio_stream.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
using std::string;
using boost::optional;
+using dcp::raw_convert;
FFmpegAudioStream::FFmpegAudioStream (cxml::ConstNodePtr node, int version)
: FFmpegStream (node)
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 9f8cb78a6..d64c82971 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -32,8 +32,8 @@
#include "log.h"
#include "exceptions.h"
#include "frame_rate_change.h"
-#include "raw_convert.h"
#include "subtitle_content.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
#include <libavformat/avformat.h>
@@ -57,6 +57,7 @@ using std::max;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::raw_convert;
int const FFmpegContentProperty::SUBTITLE_STREAMS = 100;
int const FFmpegContentProperty::SUBTITLE_STREAM = 101;
diff --git a/src/lib/ffmpeg_stream.cc b/src/lib/ffmpeg_stream.cc
index 7a8748e4e..86108ce4d 100644
--- a/src/lib/ffmpeg_stream.cc
+++ b/src/lib/ffmpeg_stream.cc
@@ -20,13 +20,14 @@
#include "ffmpeg_stream.h"
#include "dcpomatic_assert.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
extern "C" {
#include <libavformat/avformat.h>
}
using std::string;
+using dcp::raw_convert;
FFmpegStream::FFmpegStream (cxml::ConstNodePtr node)
: name (node->string_child ("Name"))
diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc
index eb870c241..627b0fef1 100644
--- a/src/lib/ffmpeg_subtitle_stream.cc
+++ b/src/lib/ffmpeg_subtitle_stream.cc
@@ -19,7 +19,7 @@
*/
#include "ffmpeg_subtitle_stream.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
#include <iostream>
@@ -29,6 +29,7 @@ using std::map;
using std::list;
using std::cout;
using std::make_pair;
+using dcp::raw_convert;
/** Construct a SubtitleStream from a value returned from to_string().
* @param t String returned from to_string().
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 28017669b..58c272eb1 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -39,7 +39,6 @@
#include "ratio.h"
#include "cross.h"
#include "environment_info.h"
-#include "raw_convert.h"
#include "audio_processor.h"
#include "digester.h"
#include "compose.hpp"
@@ -57,6 +56,7 @@
#include <dcp/util.h>
#include <dcp/local_time.h>
#include <dcp/decrypted_kdm.h>
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
@@ -88,6 +88,7 @@ using boost::weak_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
using boost::is_any_of;
+using dcp::raw_convert;
#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
diff --git a/src/lib/image_filename_sorter.cc b/src/lib/image_filename_sorter.cc
index f58abba15..25a8acb3d 100644
--- a/src/lib/image_filename_sorter.cc
+++ b/src/lib/image_filename_sorter.cc
@@ -18,13 +18,14 @@
*/
-#include "raw_convert.h"
#include "image_filename_sorter.h"
+#include <dcp/raw_convert.h>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <iostream>
using std::list;
+using dcp::raw_convert;
bool
ImageFilenameSorter::operator() (boost::filesystem::path a, boost::filesystem::path b)
diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc
index 96cf04faa..1b424c925 100644
--- a/src/lib/isdcf_metadata.cc
+++ b/src/lib/isdcf_metadata.cc
@@ -19,7 +19,7 @@
*/
#include "isdcf_metadata.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <iostream>
@@ -28,6 +28,7 @@
using std::string;
using boost::shared_ptr;
+using dcp::raw_convert;
ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node)
: content_version (node->number_child<int> ("ContentVersion"))
diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc
index a2685bb49..707a088e9 100644
--- a/src/lib/j2k_image_proxy.cc
+++ b/src/lib/j2k_image_proxy.cc
@@ -21,7 +21,7 @@
#include "j2k_image_proxy.h"
#include "dcpomatic_socket.h"
#include "image.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <dcp/openjpeg_image.h>
#include <dcp/mono_picture_frame.h>
#include <dcp/stereo_picture_frame.h>
@@ -40,6 +40,7 @@ using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
using dcp::Data;
+using dcp::raw_convert;
/** Construct a J2KImageProxy from a JPEG2000 file */
J2KImageProxy::J2KImageProxy (boost::filesystem::path path, dcp::Size size, AVPixelFormat pixel_format)
diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc
index 490f9fc5f..e171a6307 100644
--- a/src/lib/json_server.cc
+++ b/src/lib/json_server.cc
@@ -24,7 +24,7 @@
#include "util.h"
#include "film.h"
#include "transcode_job.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
@@ -38,6 +38,7 @@ using boost::thread;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::asio::ip::tcp;
+using dcp::raw_convert;
#define MAX_LENGTH 512
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc
index 62dee823f..a86ff1451 100644
--- a/src/lib/player_video.cc
+++ b/src/lib/player_video.cc
@@ -23,7 +23,7 @@
#include "image_proxy.h"
#include "j2k_image_proxy.h"
#include "film.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
extern "C" {
#include <libavutil/pixfmt.h>
}
@@ -37,6 +37,7 @@ using boost::dynamic_pointer_cast;
using boost::optional;
using boost::function;
using dcp::Data;
+using dcp::raw_convert;
PlayerVideo::PlayerVideo (
shared_ptr<const ImageProxy> in,
diff --git a/src/lib/raw_convert.cc b/src/lib/raw_convert.cc
deleted file mode 100644
index bbfd4375d..000000000
--- a/src/lib/raw_convert.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (C) 2014-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 "raw_convert.h"
-
-using std::string;
-
-template <>
-string
-raw_convert<string, string> (string v, int)
-{
- return v;
-}
-
-template <>
-string
-raw_convert<string, char const *> (char const * v, int)
-{
- return v;
-}
-
-template <>
-string
-raw_convert<string, char*> (char * v, int)
-{
- return v;
-}
diff --git a/src/lib/raw_convert.h b/src/lib/raw_convert.h
deleted file mode 100644
index 92d8e3d32..000000000
--- a/src/lib/raw_convert.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright (C) 2014-2015 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_RAW_CONVERT_H
-#define DCPOMATIC_RAW_CONVERT_H
-
-#include <locked_sstream.h>
-#include <iomanip>
-
-/** A sort-of version of boost::lexical_cast that does uses the "C"
- * locale (i.e. no thousands separators and a . for the decimal separator).
- */
-template <typename P, typename Q>
-P
-raw_convert (Q v, int precision = 16)
-{
- locked_stringstream s;
- s.imbue (std::locale::classic ());
- s << std::setprecision (precision);
- s << v;
- /* If the s >> r below fails to convert anything, we want r to
- be left as a defined value. This construct (I believe) achieves
- this by setting r to the default value of type P, even if P
- is a POD type.
- */
- P r = P ();
- s >> r;
- return r;
-}
-
-template <>
-std::string
-raw_convert<std::string, char const *> (char const * v, int);
-
-template <>
-std::string
-raw_convert<std::string, char*> (char* v, int);
-
-template <>
-std::string
-raw_convert<std::string, std::string> (std::string v, int);
-
-#endif
diff --git a/src/lib/raw_image_proxy.cc b/src/lib/raw_image_proxy.cc
index 0da547d0a..e182c0e5d 100644
--- a/src/lib/raw_image_proxy.cc
+++ b/src/lib/raw_image_proxy.cc
@@ -20,7 +20,7 @@
#include "raw_image_proxy.h"
#include "image.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <dcp/util.h>
#include <libcxml/cxml.h>
extern "C" {
@@ -34,6 +34,7 @@ using std::string;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::raw_convert;
RawImageProxy::RawImageProxy (shared_ptr<Image> image)
: _image (image)
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc
index c7dc94875..d6bf54aef 100644
--- a/src/lib/subtitle_content.cc
+++ b/src/lib/subtitle_content.cc
@@ -22,8 +22,8 @@
#include "util.h"
#include "exceptions.h"
#include "font.h"
-#include "raw_convert.h"
#include "content.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
@@ -37,6 +37,7 @@ using std::cout;
using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
int const SubtitleContentProperty::X_OFFSET = 500;
int const SubtitleContentProperty::Y_OFFSET = 501;
diff --git a/src/lib/text_subtitle_content.cc b/src/lib/text_subtitle_content.cc
index 24a328d08..63144766a 100644
--- a/src/lib/text_subtitle_content.cc
+++ b/src/lib/text_subtitle_content.cc
@@ -23,8 +23,8 @@
#include "text_subtitle.h"
#include "film.h"
#include "font.h"
-#include "raw_convert.h"
#include "subtitle_content.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <iostream>
@@ -33,6 +33,7 @@
using std::string;
using std::cout;
using boost::shared_ptr;
+using dcp::raw_convert;
TextSubtitleContent::TextSubtitleContent (shared_ptr<const Film> film, boost::filesystem::path path)
: Content (film, path)
diff --git a/src/lib/types.cc b/src/lib/types.cc
index f31e7a3ec..e3bedd667 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -20,7 +20,7 @@
#include "types.h"
#include "dcpomatic_assert.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
@@ -28,6 +28,7 @@ using std::max;
using std::min;
using std::string;
using boost::shared_ptr;
+using dcp::raw_convert;
bool operator== (Crop const & a, Crop const & b)
{
diff --git a/src/lib/update_checker.cc b/src/lib/update_checker.cc
index 6c1217f86..8aeca030b 100644
--- a/src/lib/update_checker.cc
+++ b/src/lib/update_checker.cc
@@ -21,7 +21,7 @@
#include "update_checker.h"
#include "version.h"
#include "util.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <curl/curl.h>
#include <boost/algorithm/string.hpp>
@@ -36,6 +36,7 @@ using std::string;
using std::vector;
using boost::is_any_of;
using boost::ends_with;
+using dcp::raw_convert;
/** Singleton instance */
UpdateChecker* UpdateChecker::_instance = 0;
diff --git a/src/lib/user_property.h b/src/lib/user_property.h
index a7a6f63da..6e147fd76 100644
--- a/src/lib/user_property.h
+++ b/src/lib/user_property.h
@@ -21,7 +21,7 @@
#ifndef DCPOMATIC_USER_PROPERTY_H
#define DCPOMATIC_USER_PROPERTY_H
-#include "raw_convert.h"
+#include <dcp/raw_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 (raw_convert<std::string> (value_))
+ , value (dcp::raw_convert<std::string> (value_))
, unit (unit_)
{}
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 5e870f1e2..da45919b4 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -91,6 +91,7 @@ using boost::optional;
using boost::lexical_cast;
using boost::bad_lexical_cast;
using dcp::Size;
+using dcp::raw_convert;
/** Path to our executable, required by the stacktrace stuff and filled
* in during App::onInit().
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 967522e36..20e0866a1 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -30,7 +30,7 @@
#include "exceptions.h"
#include "frame_rate_change.h"
#include "log.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <dcp/colour_matrix.h>
#include <libxml++/libxml++.h>
@@ -62,6 +62,7 @@ using std::pair;
using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
VideoContent::VideoContent (Content* parent)
: ContentPart (parent)
diff --git a/src/lib/wscript b/src/lib/wscript
index 9883f31d6..911ee0af4 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -118,7 +118,6 @@ sources = """
send_problem_report_job.cc
server.cc
string_log_entry.cc
- raw_convert.cc
subtitle_content.cc
subtitle_decoder.cc
text_subtitle.cc
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 7c7b39b04..a99e32980 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -95,6 +95,7 @@ using std::exception;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::raw_convert;
class FilmChangedDialog : public boost::noncopyable
{
diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc
index 4e9d5592d..c23d1bd89 100644
--- a/src/tools/dcpomatic_server.cc
+++ b/src/tools/dcpomatic_server.cc
@@ -25,7 +25,6 @@
#include "lib/encode_server.h"
#include "lib/config.h"
#include "lib/log.h"
-#include "lib/raw_convert.h"
#include "lib/signaller.h"
#include "lib/cross.h"
#include <wx/taskbar.h>
diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc
index 53169ad3e..1ec9dd5b2 100644
--- a/src/wx/audio_mapping_view.cc
+++ b/src/wx/audio_mapping_view.cc
@@ -24,10 +24,10 @@
#include "lib/audio_mapping.h"
#include "lib/util.h"
-#include "lib/raw_convert.h"
#include "audio_mapping_view.h"
#include "wx_util.h"
#include "audio_gain_dialog.h"
+#include <dcp/raw_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::raw_convert;
#define INDICATOR_SIZE 16
#define LEFT_WIDTH 48
diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc
index 3d4363cb9..0a775b489 100644
--- a/src/wx/colour_conversion_editor.cc
+++ b/src/wx/colour_conversion_editor.cc
@@ -19,9 +19,9 @@
*/
#include "lib/colour_conversion.h"
-#include "lib/raw_convert.h"
#include "wx_util.h"
#include "colour_conversion_editor.h"
+#include <dcp/raw_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::raw_convert;
ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv)
: wxPanel (parent, wxID_ANY)
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index 3aaba1793..0098ecb2b 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -39,12 +39,11 @@
#include "lib/dcp_content_type.h"
#include "lib/log.h"
#include "lib/util.h"
-#include "lib/raw_convert.h"
#include "lib/cross.h"
#include "lib/exceptions.h"
+#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
-#include <dcp/raw_convert.h>
#include <wx/stdpaths.h>
#include <wx/preferences.h>
#include <wx/spinctrl.h>
@@ -64,6 +63,7 @@ using boost::bind;
using boost::shared_ptr;
using boost::function;
using boost::optional;
+using dcp::raw_convert;
class Page
{
diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc
index 04abefc14..acc232df4 100644
--- a/src/wx/content_properties_dialog.cc
+++ b/src/wx/content_properties_dialog.cc
@@ -20,10 +20,10 @@
#include "content_properties_dialog.h"
#include "wx_util.h"
-#include "lib/raw_convert.h"
#include "lib/content.h"
#include "lib/video_content.h"
#include "lib/audio_content.h"
+#include <dcp/raw_convert.h>
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
@@ -33,6 +33,7 @@ using std::pair;
using std::map;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<Content> content)
: TableDialog (parent, _("Content Properties"), 2, 1, false)
diff --git a/src/wx/image_sequence_dialog.cc b/src/wx/image_sequence_dialog.cc
index 3af48bda6..6200018d1 100644
--- a/src/wx/image_sequence_dialog.cc
+++ b/src/wx/image_sequence_dialog.cc
@@ -20,7 +20,9 @@
#include "wx_util.h"
#include "image_sequence_dialog.h"
-#include "lib/raw_convert.h"
+#include <dcp/raw_convert.h>
+
+using dcp::raw_convert;
ImageSequenceDialog::ImageSequenceDialog (wxWindow* parent)
: TableDialog (parent, _("Add image sequence"), 2, 1, true)
diff --git a/src/wx/playhead_to_frame_dialog.cc b/src/wx/playhead_to_frame_dialog.cc
index 462e3d5e1..af20c1592 100644
--- a/src/wx/playhead_to_frame_dialog.cc
+++ b/src/wx/playhead_to_frame_dialog.cc
@@ -19,7 +19,9 @@
*/
#include "playhead_to_frame_dialog.h"
-#include "lib/raw_convert.h"
+#include <dcp/raw_convert.h>
+
+using dcp::raw_convert;
PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps)
: TableDialog (parent, _("Go to frame"), 2, 1, true)
diff --git a/src/wx/time_picker.cc b/src/wx/time_picker.cc
index 4706c896b..1378af967 100644
--- a/src/wx/time_picker.cc
+++ b/src/wx/time_picker.cc
@@ -20,7 +20,7 @@
#include "time_picker.h"
#include "wx_util.h"
-#include "lib/raw_convert.h"
+#include <dcp/raw_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::raw_convert;
TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
: wxPanel (parent)
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc
index 01494f17b..f4de55028 100644
--- a/src/wx/timing_panel.cc
+++ b/src/wx/timing_panel.cc
@@ -26,12 +26,12 @@
#include "move_to_dialog.h"
#include "lib/content.h"
#include "lib/image_content.h"
-#include "lib/raw_convert.h"
#include "lib/subtitle_content.h"
#include "lib/dcp_subtitle_content.h"
#include "lib/audio_content.h"
#include "lib/text_subtitle_content.h"
#include "lib/video_content.h"
+#include <dcp/raw_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::raw_convert;
TimingPanel::TimingPanel (ContentPanel* p, FilmViewer* viewer)
/* horrid hack for apparent lack of context support with wxWidgets i18n code */
diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc
index 5afe9ee4b..efaf76e28 100644
--- a/src/wx/video_waveform_plot.cc
+++ b/src/wx/video_waveform_plot.cc
@@ -22,9 +22,9 @@
#include "film_viewer.h"
#include "wx_util.h"
#include "lib/image.h"
-#include "lib/raw_convert.h"
#include "lib/dcp_video.h"
#include <dcp/openjpeg_image.h>
+#include <dcp/raw_convert.h>
#include <wx/rawbmp.h>
#include <wx/graphics.h>
#include <boost/bind.hpp>
@@ -35,6 +35,7 @@ using std::min;
using std::string;
using boost::weak_ptr;
using boost::shared_ptr;
+using dcp::raw_convert;
int const VideoWaveformPlot::_vertical_margin = 8;