#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>
using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
AudioAnalysis::AudioAnalysis (int channels)
{
#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>
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;
#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>
using std::abs;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
AudioMapping::AudioMapping ()
: _input_channels (0)
*/
#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 ()
{
#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>
using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
vector<PresetColourConversion> PresetColourConversion::_presets;
#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>
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;
#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>
using std::max;
using std::pair;
using boost::shared_ptr;
+using dcp::raw_convert;
int const ContentProperty::PATH = 400;
int const ContentProperty::POSITION = 401;
#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>
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;
#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>
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)
#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>
using boost::shared_ptr;
using dcp::Size;
using dcp::Data;
+using dcp::raw_convert;
#define DCI_COEFFICENT (48.0 / 52.37)
#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>
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())
#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>
using boost::shared_ptr;
using boost::scoped_array;
using boost::weak_ptr;
+using dcp::raw_convert;
EncodeServerFinder* EncodeServerFinder::_instance = 0;
#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>
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;
*/
#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)
#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>
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;
#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"))
*/
#include "ffmpeg_subtitle_stream.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <boost/foreach.hpp>
#include <iostream>
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().
#include "ratio.h"
#include "cross.h"
#include "environment_info.h"
-#include "raw_convert.h"
#include "audio_processor.h"
#include "digester.h"
#include "compose.hpp"
#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>
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);
*/
-#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)
*/
#include "isdcf_metadata.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <iostream>
using std::string;
using boost::shared_ptr;
+using dcp::raw_convert;
ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node)
: content_version (node->number_child<int> ("ContentVersion"))
#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>
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)
#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>
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::asio::ip::tcp;
+using dcp::raw_convert;
#define MAX_LENGTH 512
#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>
}
using boost::optional;
using boost::function;
using dcp::Data;
+using dcp::raw_convert;
PlayerVideo::PlayerVideo (
shared_ptr<const ImageProxy> in,
+++ /dev/null
-/*
- 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;
-}
+++ /dev/null
-/*
- 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
#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" {
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::raw_convert;
RawImageProxy::RawImageProxy (shared_ptr<Image> image)
: _image (image)
#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>
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;
#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>
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)
#include "types.h"
#include "dcpomatic_assert.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
using std::min;
using std::string;
using boost::shared_ptr;
+using dcp::raw_convert;
bool operator== (Crop const & a, Crop const & b)
{
#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>
using std::vector;
using boost::is_any_of;
using boost::ends_with;
+using dcp::raw_convert;
/** Singleton instance */
UpdateChecker* UpdateChecker::_instance = 0;
#ifndef DCPOMATIC_USER_PROPERTY_H
#define DCPOMATIC_USER_PROPERTY_H
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
class UserProperty
{
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_)
{}
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().
#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>
using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
+using dcp::raw_convert;
VideoContent::VideoContent (Content* parent)
: ContentPart (parent)
send_problem_report_job.cc
server.cc
string_log_entry.cc
- raw_convert.cc
subtitle_content.cc
subtitle_decoder.cc
text_subtitle.cc
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using dcp::raw_convert;
class FilmChangedDialog : public boost::noncopyable
{
#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>
#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>
using std::pair;
using std::make_pair;
using boost::shared_ptr;
+using dcp::raw_convert;
#define INDICATOR_SIZE 16
#define LEFT_WIDTH 48
*/
#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>
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)
#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>
using boost::shared_ptr;
using boost::function;
using boost::optional;
+using dcp::raw_convert;
class Page
{
#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>
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)
#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)
*/
#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)
#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>
using std::string;
using std::cout;
using boost::bind;
+using dcp::raw_convert;
TimePicker::TimePicker (wxWindow* parent, wxDateTime time)
: wxPanel (parent)
#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>
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 */
#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>
using std::string;
using boost::weak_ptr;
using boost::shared_ptr;
+using dcp::raw_convert;
int const VideoWaveformPlot::_vertical_margin = 8;
* @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;
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");
-}
using std::cerr;
using boost::shared_ptr;
using boost::optional;
+using dcp::raw_convert;
static
void