Move raw_convert into libdcp.
authorCarl Hetherington <cth@carlh.net>
Thu, 11 Aug 2016 10:07:18 +0000 (11:07 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 12 Aug 2016 08:14:05 +0000 (09:14 +0100)
48 files changed:
src/lib/audio_analysis.cc
src/lib/audio_content.cc
src/lib/audio_mapping.cc
src/lib/audio_point.cc
src/lib/colour_conversion.cc
src/lib/config.cc
src/lib/content.cc
src/lib/content.h
src/lib/dcp_content.cc
src/lib/dcp_subtitle_content.cc
src/lib/dcp_video.cc
src/lib/encode_server.cc
src/lib/encode_server_finder.cc
src/lib/ffmpeg.cc
src/lib/ffmpeg_audio_stream.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_stream.cc
src/lib/ffmpeg_subtitle_stream.cc
src/lib/film.cc
src/lib/image_filename_sorter.cc
src/lib/isdcf_metadata.cc
src/lib/j2k_image_proxy.cc
src/lib/json_server.cc
src/lib/player_video.cc
src/lib/raw_convert.cc [deleted file]
src/lib/raw_convert.h [deleted file]
src/lib/raw_image_proxy.cc
src/lib/subtitle_content.cc
src/lib/text_subtitle_content.cc
src/lib/types.cc
src/lib/update_checker.cc
src/lib/user_property.h
src/lib/util.cc
src/lib/video_content.cc
src/lib/wscript
src/tools/dcpomatic.cc
src/tools/dcpomatic_server.cc
src/wx/audio_mapping_view.cc
src/wx/colour_conversion_editor.cc
src/wx/config_dialog.cc
src/wx/content_properties_dialog.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
test/util_test.cc
test/video_content_scale_test.cc

index 1863e38..1e5d089 100644 (file)
@@ -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)
 {
index 4e9d5cd..e66b8b9 100644 (file)
@@ -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;
index b436d75..bf454b5 100644 (file)
@@ -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)
index 45df0b3..b5ea2c3 100644 (file)
 */
 
 #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 ()
 {
index f17964d..e4659a5 100644 (file)
@@ -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;
 
index 6f7c8ec..7f45743 100644 (file)
@@ -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;
index 9c7e790..0fd503e 100644 (file)
@@ -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;
index 6b64779..f8b5493 100644 (file)
@@ -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>
index b41e31c..9e76759 100644 (file)
@@ -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;
index e7057ef..015aebd 100644 (file)
@@ -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)
index be69f3e..e3ba7d2 100644 (file)
@@ -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)
 
index abd8537..442ce3d 100644 (file)
 #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())
index 135a8bc..e964bb8 100644 (file)
@@ -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;
 
index bbf9bbe..1f16514 100644 (file)
 #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;
index a81f69e..1b0d39d 100644 (file)
 */
 
 #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)
index 9f8cb78..d64c829 100644 (file)
@@ -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;
index 7a8748e..86108ce 100644 (file)
 
 #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"))
index eb870c2..627b0fe 100644 (file)
@@ -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().
index 2801766..58c272e 100644 (file)
@@ -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);
index f58abba..25a8acb 100644 (file)
 
 */
 
-#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)
index 96cf04f..1b424c9 100644 (file)
@@ -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"))
index a2685bb..707a088 100644 (file)
@@ -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)
index 490f9fc..e171a63 100644 (file)
@@ -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
 
index 62dee82..a86ff14 100644 (file)
@@ -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 (file)
index bbfd437..0000000
+++ /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 (file)
index 92d8e3d..0000000
+++ /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
index 0da547d..e182c0e 100644 (file)
@@ -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)
index c7dc948..d6bf54a 100644 (file)
@@ -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;
index 24a328d..6314476 100644 (file)
@@ -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)
index f31e7a3..e3bedd6 100644 (file)
@@ -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)
 {
index 6c1217f..8aeca03 100644 (file)
@@ -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;
index a7a6f63..6e147fd 100644 (file)
@@ -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_)
        {}
 
index 5e870f1..da45919 100644 (file)
@@ -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().
index 967522e..20e0866 100644 (file)
@@ -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)
index 9883f31..911ee0a 100644 (file)
@@ -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
index 7c7b39b..a99e329 100644 (file)
@@ -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
 {
index 4e9d559..c23d1bd 100644 (file)
@@ -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>
index 53169ad..1ec9dd5 100644 (file)
 
 #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
index 3d4363c..0a775b4 100644 (file)
@@ -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)
index 3aaba17..0098ecb 100644 (file)
 #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
 {
index 04abefc..acc232d 100644 (file)
 
 #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)
index 3af48bd..6200018 100644 (file)
@@ -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)
index 462e3d5..af20c15 100644 (file)
@@ -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)
index 4706c89..1378af9 100644 (file)
@@ -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)
index 01494f1..f4de550 100644 (file)
 #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 */
index 5afe9ee..efaf76e 100644 (file)
@@ -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;
 
index 1f894d3..d1f6c77 100644 (file)
  *  @brief Test various utility methods.
  */
 
-#include <boost/test/unit_test.hpp>
 #include "lib/util.h"
-#include "lib/raw_convert.h"
 #include "lib/exceptions.h"
+#include <boost/test/unit_test.hpp>
 
 using std::string;
 using std::vector;
@@ -87,9 +86,3 @@ BOOST_AUTO_TEST_CASE (seconds_to_approximate_hms_test)
        BOOST_CHECK_EQUAL (seconds_to_approximate_hms (3600 + 40 * 60), "1h 40m");
        BOOST_CHECK_EQUAL (seconds_to_approximate_hms (13 * 3600 + 40 * 60), "14h");
 }
-
-BOOST_AUTO_TEST_CASE (raw_convert_test)
-{
-       BOOST_CHECK_EQUAL (raw_convert<string> ("foo"), "foo");
-       BOOST_CHECK_EQUAL (raw_convert<string> ("foo bar"), "foo bar");
-}
index b1a1e25..bb6694d 100644 (file)
@@ -28,6 +28,7 @@ using std::string;
 using std::cerr;
 using boost::shared_ptr;
 using boost::optional;
+using dcp::raw_convert;
 
 static
 void