From 73654117144c6de0ec4efe39ddc88485df546cc9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 11 Aug 2016 11:07:18 +0100 Subject: [PATCH] Move raw_convert into libdcp. --- src/lib/audio_analysis.cc | 3 +- src/lib/audio_content.cc | 3 +- src/lib/audio_mapping.cc | 3 +- src/lib/audio_point.cc | 3 +- src/lib/colour_conversion.cc | 3 +- src/lib/config.cc | 3 +- src/lib/content.cc | 3 +- src/lib/content.h | 1 - src/lib/dcp_content.cc | 1 + src/lib/dcp_subtitle_content.cc | 3 +- src/lib/dcp_video.cc | 3 +- src/lib/encode_server.cc | 3 +- src/lib/encode_server_finder.cc | 3 +- src/lib/ffmpeg.cc | 3 +- src/lib/ffmpeg_audio_stream.cc | 3 +- src/lib/ffmpeg_content.cc | 3 +- src/lib/ffmpeg_stream.cc | 3 +- src/lib/ffmpeg_subtitle_stream.cc | 3 +- src/lib/film.cc | 3 +- src/lib/image_filename_sorter.cc | 3 +- src/lib/isdcf_metadata.cc | 3 +- src/lib/j2k_image_proxy.cc | 3 +- src/lib/json_server.cc | 3 +- src/lib/player_video.cc | 3 +- src/lib/raw_convert.cc | 44 --------------------- src/lib/raw_convert.h | 60 ----------------------------- src/lib/raw_image_proxy.cc | 3 +- src/lib/subtitle_content.cc | 3 +- src/lib/text_subtitle_content.cc | 3 +- src/lib/types.cc | 3 +- src/lib/update_checker.cc | 3 +- src/lib/user_property.h | 4 +- src/lib/util.cc | 1 + src/lib/video_content.cc | 3 +- src/lib/wscript | 1 - src/tools/dcpomatic.cc | 1 + src/tools/dcpomatic_server.cc | 1 - src/wx/audio_mapping_view.cc | 3 +- src/wx/colour_conversion_editor.cc | 3 +- src/wx/config_dialog.cc | 4 +- src/wx/content_properties_dialog.cc | 3 +- src/wx/image_sequence_dialog.cc | 4 +- src/wx/playhead_to_frame_dialog.cc | 4 +- src/wx/time_picker.cc | 3 +- src/wx/timing_panel.cc | 3 +- src/wx/video_waveform_plot.cc | 3 +- test/util_test.cc | 9 +---- test/video_content_scale_test.cc | 1 + 48 files changed, 83 insertions(+), 155 deletions(-) delete mode 100644 src/lib/raw_convert.cc delete mode 100644 src/lib/raw_convert.h 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 #include #include #include @@ -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 #include #include #include @@ -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 #include #include #include @@ -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 #include 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 #include #include #include @@ -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::_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 #include #include #include @@ -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 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 #include #include #include @@ -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 #include 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 #include #include #include @@ -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 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 +#include #include #include #include @@ -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 #include #include #include @@ -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, 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 #include #include #include @@ -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 extern "C" { #include #include @@ -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 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 #include #include 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 #include extern "C" { #include @@ -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 #include extern "C" { #include } 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 #include #include #include @@ -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 #include #include +#include #include #include #include @@ -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 #include #include #include 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 #include #include #include @@ -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 ("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 #include #include #include @@ -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 #include #include #include @@ -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 extern "C" { #include } @@ -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 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 - - 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 . - -*/ - -#include "raw_convert.h" - -using std::string; - -template <> -string -raw_convert (string v, int) -{ - return v; -} - -template <> -string -raw_convert (char const * v, int) -{ - return v; -} - -template <> -string -raw_convert (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 - - 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 . - -*/ - -#ifndef DCPOMATIC_RAW_CONVERT_H -#define DCPOMATIC_RAW_CONVERT_H - -#include -#include - -/** 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 -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 (char const * v, int); - -template <> -std::string -raw_convert (char* v, int); - -template <> -std::string -raw_convert (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 #include #include 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) 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 #include #include #include @@ -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 #include #include @@ -33,6 +33,7 @@ using std::string; using std::cout; using boost::shared_ptr; +using dcp::raw_convert; TextSubtitleContent::TextSubtitleContent (shared_ptr 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 #include #include @@ -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 #include #include #include @@ -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 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 (value_)) + , value (dcp::raw_convert (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 #include #include #include @@ -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 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 #include #include #include @@ -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 #include #include #include @@ -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 #include #include -#include #include #include #include @@ -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 #include #include @@ -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) : 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 + +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 + +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 #include #include #include @@ -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 #include #include #include @@ -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 +#include #include #include #include @@ -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; diff --git a/test/util_test.cc b/test/util_test.cc index 1f894d329..d1f6c77d5 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -22,10 +22,9 @@ * @brief Test various utility methods. */ -#include #include "lib/util.h" -#include "lib/raw_convert.h" #include "lib/exceptions.h" +#include 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 ("foo"), "foo"); - BOOST_CHECK_EQUAL (raw_convert ("foo bar"), "foo bar"); -} diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index b1a1e258d..bb6694db2 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -28,6 +28,7 @@ using std::string; using std::cerr; using boost::shared_ptr; using boost::optional; +using dcp::raw_convert; static void -- 2.30.2