Bump libdcp for raw_convert changes.
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Dec 2024 14:43:14 +0000 (15:43 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 5 Jan 2025 11:58:13 +0000 (12:58 +0100)
raw_convert<string> is gone, so here we use fmt::{to_string,format} instead.
Other raw_converts now use fast_float.

52 files changed:
cscript
src/lib/analytics.cc
src/lib/atmos_content.cc
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/create_cli.cc
src/lib/crop.cc
src/lib/cross_common.cc
src/lib/cross_unix.cc
src/lib/cross_windows.cc
src/lib/dcp_content.cc
src/lib/dcp_subtitle_content.cc
src/lib/dcp_video.cc
src/lib/disk_writer_messages.cc
src/lib/encode_server.cc
src/lib/encode_server_finder.cc
src/lib/export_config.cc
src/lib/fcpxml_content.cc
src/lib/ffmpeg_audio_stream.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_image_proxy.cc
src/lib/ffmpeg_stream.cc
src/lib/film.cc
src/lib/hints.cc
src/lib/j2k_image_proxy.cc
src/lib/json_server.cc
src/lib/pixel_quanta.cc
src/lib/player_video.cc
src/lib/raw_image_proxy.cc
src/lib/reel_writer.cc
src/lib/remembered_asset.cc
src/lib/render_text.cc
src/lib/rough_duration.cc
src/lib/string_text_file_content.cc
src/lib/subtitle_analysis.cc
src/lib/subtitle_film_encoder.cc
src/lib/text_content.cc
src/lib/util.cc
src/lib/video_content.cc
src/tools/dcpomatic.cc
src/wx/config_dialog.cc
src/wx/timecode.h
src/wx/verify_dcp_result_panel.cc
test/j2k_video_bit_rate_test.cc
test/socket_test.cc
test/subtitle_reel_number_test.cc
wscript

diff --git a/cscript b/cscript
index ffcec3656def78ecfed440bf520db6db64c1af63..6e6239270893ad501423202f192dfe7ca8cf8a79 100644 (file)
--- a/cscript
+++ b/cscript
@@ -531,7 +531,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
 
 def dependencies(target, options):
-    deps = [('libdcp', 'v1.10.2', {'c++17': target.platform.startswith('osx')})]
+    deps = [('libdcp', 'v1.10.3', {'c++17': target.platform.startswith('osx')})]
     deps.append(('libsub', 'v1.6.52'))
     deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
     deps.append(('rtaudio', 'f619b76'))
index 9dcfdcd313915701aa98f64b5f3a1912ee1a1afe..b3c44202af52b9fdccd8dfd5da403cfb4cdf8cc8 100644 (file)
 #include "exceptions.h"
 #include "variant.h"
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 #include <libcxml/cxml.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/filesystem.hpp>
 
@@ -37,7 +37,6 @@ LIBDCP_ENABLE_WARNINGS
 
 
 using std::string;
-using dcp::raw_convert;
 using boost::algorithm::trim;
 
 
@@ -101,8 +100,8 @@ Analytics::write () const
        xmlpp::Document doc;
        auto root = doc.create_root_node ("Analytics");
 
-       cxml::add_text_child(root, "Version", raw_convert<string>(_current_version));
-       cxml::add_text_child(root, "SuccessfulDCPEncodes", raw_convert<string>(_successful_dcp_encodes));
+       cxml::add_text_child(root, "Version", fmt::to_string(_current_version));
+       cxml::add_text_child(root, "SuccessfulDCPEncodes", fmt::to_string(_successful_dcp_encodes));
 
        try {
                doc.write_to_file_formatted(write_path("analytics.xml").string());
index 22bd431a22fe9e7102de2b67cadab94516d24dbe..c83b259cc71946efe18f704378ea1602b7737a3c 100644 (file)
 
 
 #include "atmos_content.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::make_shared;
@@ -65,7 +65,7 @@ AtmosContent::from_xml (Content* parent, cxml::ConstNodePtr node)
 void
 AtmosContent::as_xml(xmlpp::Element* element) const
 {
-       cxml::add_text_child(element, "AtmosLength", dcp::raw_convert<string>(_length));
+       cxml::add_text_child(element, "AtmosLength", fmt::to_string(_length));
        cxml::add_text_child(element, "AtmosEditRate", _edit_rate.as_string());
 }
 
index ac990ee18f13e3488a4cbef06456458e31371416..8375ae770ee1822e0e0d16969f9deb0707e31b49 100644 (file)
@@ -29,6 +29,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/filesystem.hpp>
 #include <stdint.h>
 #include <cmath>
@@ -140,7 +141,7 @@ AudioAnalysis::write (boost::filesystem::path filename)
        auto doc = make_shared<xmlpp::Document>();
        auto root = doc->create_root_node("AudioAnalysis");
 
-       cxml::add_text_child(root, "Version", raw_convert<string>(_current_state_version));
+       cxml::add_text_child(root, "Version", fmt::to_string(_current_state_version));
 
        for (auto& i: _data) {
                auto channel = cxml::add_child(root, "Channel");
@@ -151,31 +152,31 @@ AudioAnalysis::write (boost::filesystem::path filename)
 
        for (size_t i = 0; i < _sample_peak.size(); ++i) {
                auto n = cxml::add_child(root, "SamplePeak");
-               n->add_child_text (raw_convert<string> (_sample_peak[i].peak));
-               n->set_attribute("time", raw_convert<string> (_sample_peak[i].time.get()));
+               n->add_child_text(fmt::to_string(_sample_peak[i].peak));
+               n->set_attribute("time", fmt::to_string(_sample_peak[i].time.get()));
        }
 
        for (auto i: _true_peak) {
-               cxml::add_text_child(root, "TruePeak", raw_convert<string>(i));
+               cxml::add_text_child(root, "TruePeak", fmt::to_string(i));
        }
 
        if (_integrated_loudness) {
-               cxml::add_text_child(root, "IntegratedLoudness", raw_convert<string>(_integrated_loudness.get()));
+               cxml::add_text_child(root, "IntegratedLoudness", fmt::to_string(_integrated_loudness.get()));
        }
 
        if (_loudness_range) {
-               cxml::add_text_child(root, "LoudnessRange", raw_convert<string>(_loudness_range.get()));
+               cxml::add_text_child(root, "LoudnessRange", fmt::to_string(_loudness_range.get()));
        }
 
        if (_analysis_gain) {
-               cxml::add_text_child(root, "AnalysisGain", raw_convert<string>(_analysis_gain.get()));
+               cxml::add_text_child(root, "AnalysisGain", fmt::to_string(_analysis_gain.get()));
        }
 
-       cxml::add_text_child(root, "SamplesPerPoint", raw_convert<string>(_samples_per_point));
-       cxml::add_text_child(root, "SampleRate", raw_convert<string>(_sample_rate));
+       cxml::add_text_child(root, "SamplesPerPoint", fmt::to_string(_samples_per_point));
+       cxml::add_text_child(root, "SampleRate", fmt::to_string(_sample_rate));
 
        if (_leqm) {
-               cxml::add_text_child(root, "Leqm", raw_convert<string>(*_leqm));
+               cxml::add_text_child(root, "Leqm", fmt::to_string(*_leqm));
        }
 
        doc->write_to_file_formatted (filename.string ());
index 2569e1cf049fe683646a17811d20642dfb6f54a9..bda0230ca02496ef73b464f56544f351128fefd0 100644 (file)
@@ -28,9 +28,9 @@
 #include "frame_rate_change.h"
 #include "maths_util.h"
 #include "video_content.h"
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -47,7 +47,6 @@ using std::shared_ptr;
 using std::string;
 using std::vector;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -127,10 +126,10 @@ void
 AudioContent::as_xml(xmlpp::Element* element) const
 {
        boost::mutex::scoped_lock lm (_mutex);
-       cxml::add_text_child(element, "AudioGain", raw_convert<string>(_gain));
-       cxml::add_text_child(element, "AudioDelay", raw_convert<string>(_delay));
-       cxml::add_text_child(element, "AudioFadeIn", raw_convert<string>(_fade_in.get()));
-       cxml::add_text_child(element, "AudioFadeOut", raw_convert<string>(_fade_out.get()));
+       cxml::add_text_child(element, "AudioGain", fmt::to_string(_gain));
+       cxml::add_text_child(element, "AudioDelay", fmt::to_string(_delay));
+       cxml::add_text_child(element, "AudioFadeIn", fmt::to_string(_fade_in.get()));
+       cxml::add_text_child(element, "AudioFadeOut", fmt::to_string(_fade_out.get()));
        cxml::add_text_child(element, "AudioUseSameFadesAsVideo", _use_same_fades_as_video ? "1" : "0");
 }
 
index 37929001dc3735490f6f36ae43153754e5777001..939a034149a7cbaa29738d51e0b1c9aff9b22df9 100644 (file)
@@ -31,6 +31,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/regex.hpp>
 #include <iostream>
 
@@ -225,15 +226,15 @@ AudioMapping::as_xml(xmlpp::Element* element) const
        auto const input = input_channels();
        auto const output = output_channels();
 
-       cxml::add_text_child(element, "InputChannels", raw_convert<string>(input));
-       cxml::add_text_child(element, "OutputChannels", raw_convert<string>(output));
+       cxml::add_text_child(element, "InputChannels", fmt::to_string(input));
+       cxml::add_text_child(element, "OutputChannels", fmt::to_string(output));
 
        for (int c = 0; c < input; ++c) {
                for (int d = 0; d < output; ++d) {
                        auto t = cxml::add_child(element, "Gain");
-                       t->set_attribute("input", raw_convert<string>(c));
-                       t->set_attribute("output", raw_convert<string>(d));
-                       t->add_child_text (raw_convert<string> (get (c, d)));
+                       t->set_attribute("input", fmt::to_string(c));
+                       t->set_attribute("output", fmt::to_string(d));
+                       t->add_child_text(fmt::to_string(get(c, d)));
                }
        }
 }
index 036904520ad1bf81c4dcf507a52c6ff097e5785f..efd342dd14dde6d716cc6e8bcbdbfcde586da586 100644 (file)
 
 
 #include "audio_point.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::string;
-using dcp::raw_convert;
 
 
 AudioPoint::AudioPoint ()
@@ -72,6 +71,6 @@ AudioPoint::operator= (AudioPoint const & other)
 void
 AudioPoint::as_xml (xmlpp::Element* parent) const
 {
-       cxml::add_text_child(parent, "Peak", raw_convert<string>(_data[PEAK]));
-       cxml::add_text_child(parent, "RMS", raw_convert<string>(_data[RMS]));
+       cxml::add_text_child(parent, "Peak", fmt::to_string(_data[PEAK]));
+       cxml::add_text_child(parent, "RMS", fmt::to_string(_data[RMS]));
 }
index f1e6258122fbf3cebb7638be85e38ecedb4f8705..447382a1eff68e34cc70ec42cd81f12788160872 100644 (file)
@@ -34,6 +34,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -157,34 +158,34 @@ ColourConversion::as_xml(xmlpp::Element* element) const
        if (dynamic_pointer_cast<const dcp::GammaTransferFunction> (_in)) {
                auto tf = dynamic_pointer_cast<const dcp::GammaTransferFunction> (_in);
                cxml::add_text_child(in_node, "Type", "Gamma");
-               cxml::add_text_child(in_node, "Gamma", raw_convert<string>(tf->gamma()));
+               cxml::add_text_child(in_node, "Gamma", fmt::to_string(tf->gamma()));
        } else if (dynamic_pointer_cast<const dcp::ModifiedGammaTransferFunction> (_in)) {
                auto tf = dynamic_pointer_cast<const dcp::ModifiedGammaTransferFunction> (_in);
                cxml::add_text_child(in_node, "Type", "ModifiedGamma");
-               cxml::add_text_child(in_node, "Power", raw_convert<string>(tf->power ()));
-               cxml::add_text_child(in_node, "Threshold", raw_convert<string>(tf->threshold ()));
-               cxml::add_text_child(in_node, "A", raw_convert<string>(tf->A()));
-               cxml::add_text_child(in_node, "B", raw_convert<string>(tf->B()));
+               cxml::add_text_child(in_node, "Power", fmt::to_string(tf->power()));
+               cxml::add_text_child(in_node, "Threshold", fmt::to_string(tf->threshold()));
+               cxml::add_text_child(in_node, "A", fmt::to_string(tf->A()));
+               cxml::add_text_child(in_node, "B", fmt::to_string(tf->B()));
        } else if (dynamic_pointer_cast<const dcp::SGamut3TransferFunction>(_in)) {
                cxml::add_text_child(in_node, "Type", "SGamut3");
        }
 
-       cxml::add_text_child(element, "YUVToRGB", raw_convert<string>(static_cast<int>(_yuv_to_rgb)));
-       cxml::add_text_child(element, "RedX", raw_convert<string>(_red.x));
-       cxml::add_text_child(element, "RedY", raw_convert<string>(_red.y));
-       cxml::add_text_child(element, "GreenX", raw_convert<string>(_green.x));
-       cxml::add_text_child(element, "GreenY", raw_convert<string>(_green.y));
-       cxml::add_text_child(element, "BlueX", raw_convert<string>(_blue.x));
-       cxml::add_text_child(element, "BlueY", raw_convert<string>(_blue.y));
-       cxml::add_text_child(element, "WhiteX", raw_convert<string>(_white.x));
-       cxml::add_text_child(element, "WhiteY", raw_convert<string>(_white.y));
+       cxml::add_text_child(element, "YUVToRGB", fmt::to_string(static_cast<int>(_yuv_to_rgb)));
+       cxml::add_text_child(element, "RedX", fmt::to_string(_red.x));
+       cxml::add_text_child(element, "RedY", fmt::to_string(_red.y));
+       cxml::add_text_child(element, "GreenX", fmt::to_string(_green.x));
+       cxml::add_text_child(element, "GreenY", fmt::to_string(_green.y));
+       cxml::add_text_child(element, "BlueX", fmt::to_string(_blue.x));
+       cxml::add_text_child(element, "BlueY", fmt::to_string(_blue.y));
+       cxml::add_text_child(element, "WhiteX", fmt::to_string(_white.x));
+       cxml::add_text_child(element, "WhiteY", fmt::to_string(_white.y));
        if (_adjusted_white) {
-               cxml::add_text_child(element, "AdjustedWhiteX", raw_convert<string>(_adjusted_white.get().x));
-               cxml::add_text_child(element, "AdjustedWhiteY", raw_convert<string>(_adjusted_white.get().y));
+               cxml::add_text_child(element, "AdjustedWhiteX", fmt::to_string(_adjusted_white.get().x));
+               cxml::add_text_child(element, "AdjustedWhiteY", fmt::to_string(_adjusted_white.get().y));
        }
 
        if (auto gf = dynamic_pointer_cast<const dcp::GammaTransferFunction>(_out)) {
-               cxml::add_text_child(element, "OutputGamma", raw_convert<string>(gf->gamma()));
+               cxml::add_text_child(element, "OutputGamma", fmt::to_string(gf->gamma()));
        }
 }
 
index 0cbf1fcb67c87948136643a592e4ab9d89ab9876..aa7c79bbe1934036ad10288c40ce333812bc2125 100644 (file)
@@ -41,6 +41,7 @@
 #include <libcxml/cxml.h>
 #include <glib.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/thread.hpp>
@@ -737,11 +738,11 @@ Config::write_config () const
        auto root = doc.create_root_node ("Config");
 
        /* [XML] Version The version number of the configuration file format. */
-       cxml::add_text_child(root, "Version", raw_convert<string>(_current_version));
+       cxml::add_text_child(root, "Version", fmt::to_string(_current_version));
        /* [XML] MasterEncodingThreads Number of encoding threads to use when running as master. */
-       cxml::add_text_child(root, "MasterEncodingThreads", raw_convert<string>(_master_encoding_threads));
+       cxml::add_text_child(root, "MasterEncodingThreads", fmt::to_string(_master_encoding_threads));
        /* [XML] ServerEncodingThreads Number of encoding threads to use when running as server. */
-       cxml::add_text_child(root, "ServerEncodingThreads", raw_convert<string>(_server_encoding_threads));
+       cxml::add_text_child(root, "ServerEncodingThreads", fmt::to_string(_server_encoding_threads));
        if (_default_directory) {
                /* [XML:opt] DefaultDirectory Default directory when creating a new film in the GUI. */
                cxml::add_text_child(root, "DefaultDirectory", _default_directory->string());
@@ -750,7 +751,7 @@ Config::write_config () const
           <code>ServerPortBase</code> + 2 are used for querying servers.  <code>ServerPortBase</code> + 3 is used
           by the batch converter to listen for job requests.
        */
-       cxml::add_text_child(root, "ServerPortBase", raw_convert<string>(_server_port_base));
+       cxml::add_text_child(root, "ServerPortBase", fmt::to_string(_server_port_base));
        /* [XML] UseAnyServers 1 to broadcast to look for encoding servers to use, 0 to use only those configured. */
        cxml::add_text_child(root, "UseAnyServers", _use_any_servers ? "1" : "0");
 
@@ -766,7 +767,7 @@ Config::write_config () const
        */
        cxml::add_text_child(root, "OnlyServersEncode", _only_servers_encode ? "1" : "0");
        /* [XML] TMSProtocol Protocol to use to copy files to a TMS; 0 to use SCP, 1 for FTP. */
-       cxml::add_text_child(root, "TMSProtocol", raw_convert<string>(static_cast<int>(_tms_protocol)));
+       cxml::add_text_child(root, "TMSProtocol", fmt::to_string(static_cast<int>(_tms_protocol)));
        /* [XML] TMSPassive True to use PASV mode with TMS FTP connections. */
        cxml::add_text_child(root, "TMSPassive", _tms_passive ? "1" : "0");
        /* [XML] TMSIP IP address of TMS. */
@@ -797,9 +798,9 @@ Config::write_config () const
        cxml::add_text_child(root, "UploadAfterMakeDCP", _upload_after_make_dcp ? "1" : "0");
 
        /* [XML] DefaultStillLength Default length (in seconds) for still images in new films. */
-       cxml::add_text_child(root, "DefaultStillLength", raw_convert<string>(_default_still_length));
+       cxml::add_text_child(root, "DefaultStillLength", fmt::to_string(_default_still_length));
        /* [XML] DefaultAudioDelay Default delay to apply to audio (positive moves audio later) in milliseconds. */
-       cxml::add_text_child(root, "DefaultAudioDelay", raw_convert<string>(_default_audio_delay));
+       cxml::add_text_child(root, "DefaultAudioDelay", fmt::to_string(_default_audio_delay));
        if (_default_audio_language) {
                /* [XML] DefaultAudioLanguage Default audio language to use for new films */
                cxml::add_text_child(root, "DefaultAudioLanguage", _default_audio_language->to_string());
@@ -812,7 +813,7 @@ Config::write_config () const
        /* [XML] MailServer Hostname of SMTP server to use. */
        cxml::add_text_child(root, "MailServer", _mail_server);
        /* [XML] MailPort Port number to use on SMTP server. */
-       cxml::add_text_child(root, "MailPort", raw_convert<string>(_mail_port));
+       cxml::add_text_child(root, "MailPort", fmt::to_string(_mail_port));
        /* [XML] MailProtocol Protocol to use on SMTP server (Auto, Plain, STARTTLS or SSL) */
        switch (_mail_protocol) {
        case EmailProtocol::AUTO:
@@ -867,9 +868,9 @@ Config::write_config () const
        cxml::add_text_child(root, "CheckForTestUpdates", _check_for_test_updates ? "1" : "0");
 
        /* [XML] MaximumJ2KVideoBitRate Maximum video bit rate (in bits per second) that can be specified in the GUI for JPEG2000 encodes. */
-       cxml::add_text_child(root, "MaximumJ2KVideoBitRate", raw_convert<string>(_maximum_video_bit_rate[VideoEncoding::JPEG2000]));
+       cxml::add_text_child(root, "MaximumJ2KVideoBitRate", fmt::to_string(_maximum_video_bit_rate[VideoEncoding::JPEG2000]));
        /* [XML] MaximumMPEG2VideoBitRate Maximum video bit rate (in bits per second) that can be specified in the GUI for MPEG2 encodes. */
-       cxml::add_text_child(root, "MaximumMPEG2VideoBitRate", raw_convert<string>(_maximum_video_bit_rate[VideoEncoding::MPEG2]));
+       cxml::add_text_child(root, "MaximumMPEG2VideoBitRate", fmt::to_string(_maximum_video_bit_rate[VideoEncoding::MPEG2]));
        /* [XML] AllowAnyDCPFrameRate 1 to allow users to specify any frame rate when creating DCPs, 0 to limit the GUI to standard rates. */
        cxml::add_text_child(root, "AllowAnyDCPFrameRate", _allow_any_dcp_frame_rate ? "1" : "0");
        /* [XML] AllowAnyContainer 1 to allow users to user any container ratio for their DCP, 0 to limit the GUI to DCI Flat/Scope */
@@ -885,7 +886,7 @@ Config::write_config () const
           to sending email, 128 debug information related to the video view, 256 information about disk writing, 512 debug information
           related to the player, 1024 debug information related to audio analyses.
        */
-       cxml::add_text_child(root, "LogTypes", raw_convert<string> (_log_types));
+       cxml::add_text_child(root, "LogTypes", fmt::to_string(_log_types));
        /* [XML] AnalyseEBUR128 1 to do EBUR128 analyses when analysing audio, otherwise 0. */
        cxml::add_text_child(root, "AnalyseEBUR128", _analyse_ebur128 ? "1" : "0");
        /* [XML] AutomaticAudioAnalysis 1 to run audio analysis automatically when audio content is added to the film, otherwise 0. */
@@ -961,7 +962,7 @@ Config::write_config () const
        /* [XML] Nagged 1 if a particular nag screen has been shown and should not be shown again, otherwise 0. */
        for (int i = 0; i < NAG_COUNT; ++i) {
                auto e = cxml::add_child(root, "Nagged");
-               e->set_attribute("id", raw_convert<string>(i));
+               e->set_attribute("id", fmt::to_string(i));
                e->add_child_text (_nagged[i] ? "1" : "0");
        }
        /* [XML] PreviewSound 1 to use sound in the GUI preview and player, otherwise 0. */
@@ -1003,11 +1004,11 @@ Config::write_config () const
        /* [XML] FramesInMemoryMultiplier value to multiply the encoding threads count by to get the maximum number of
           frames to be held in memory at once.
        */
-       cxml::add_text_child(root, "FramesInMemoryMultiplier", raw_convert<string>(_frames_in_memory_multiplier));
+       cxml::add_text_child(root, "FramesInMemoryMultiplier", fmt::to_string(_frames_in_memory_multiplier));
 
        /* [XML] DecodeReduction power of 2 to reduce DCP images by before decoding in the player. */
        if (_decode_reduction) {
-               cxml::add_text_child(root, "DecodeReduction", raw_convert<string>(_decode_reduction.get()));
+               cxml::add_text_child(root, "DecodeReduction", fmt::to_string(_decode_reduction.get()));
        }
 
        /* [XML] DefaultNotify 1 to default jobs to notify when complete, otherwise 0. */
@@ -1016,7 +1017,7 @@ Config::write_config () const
        /* [XML] Notification 1 if a notification type is enabled, otherwise 0. */
        for (int i = 0; i < NOTIFICATION_COUNT; ++i) {
                auto e = cxml::add_child(root, "Notification");
-               e->set_attribute ("id", raw_convert<string>(i));
+               e->set_attribute("id", fmt::to_string(i));
                e->add_child_text (_notification[i] ? "1" : "0");
        }
 
@@ -1071,7 +1072,7 @@ Config::write_config () const
        }
 
        /* [XML] ImageDisplay Screen number to put image on in dual-screen player mode. */
-       cxml::add_text_child(root, "ImageDisplay", raw_convert<string>(_image_display));
+       cxml::add_text_child(root, "ImageDisplay", fmt::to_string(_image_display));
        switch (_video_view_type) {
        case VIDEO_VIEW_SIMPLE:
                cxml::add_text_child(root, "VideoViewType", "simple");
@@ -1113,15 +1114,15 @@ Config::write_config () const
        cxml::add_text_child(root, "WriteKDMsToDisk", _write_kdms_to_disk ? "1" : "0");
        cxml::add_text_child(root, "EmailKDMs", _email_kdms ? "1" : "0");
        cxml::add_text_child(root, "DefaultKDMType", dcp::formulation_to_string(_default_kdm_type));
-       cxml::add_text_child(root, "AutoCropThreshold", raw_convert<string>(_auto_crop_threshold));
+       cxml::add_text_child(root, "AutoCropThreshold", fmt::to_string(_auto_crop_threshold));
        if (_last_release_notes_version) {
                cxml::add_text_child(root, "LastReleaseNotesVersion", *_last_release_notes_version);
        }
        if (_main_divider_sash_position) {
-               cxml::add_text_child(root, "MainDividerSashPosition", raw_convert<string>(*_main_divider_sash_position));
+               cxml::add_text_child(root, "MainDividerSashPosition", fmt::to_string(*_main_divider_sash_position));
        }
        if (_main_content_divider_sash_position) {
-               cxml::add_text_child(root, "MainContentDividerSashPosition", raw_convert<string>(*_main_content_divider_sash_position));
+               cxml::add_text_child(root, "MainContentDividerSashPosition", fmt::to_string(*_main_content_divider_sash_position));
        }
 
        cxml::add_text_child(root, "DefaultAddFileLocation",
@@ -1131,11 +1132,11 @@ Config::write_config () const
        /* [XML] AllowSMPTEBv20 1 to allow the user to choose SMPTE (Bv2.0 only) as a standard, otherwise 0 */
        cxml::add_text_child(root, "AllowSMPTEBv20", _allow_smpte_bv20 ? "1" : "0");
        /* [XML] ISDCFNamePartLength Maximum length of the "name" part of an ISDCF name, which should be 14 according to the standard */
-       cxml::add_text_child(root, "ISDCFNamePartLength", raw_convert<string>(_isdcf_name_part_length));
+       cxml::add_text_child(root, "ISDCFNamePartLength", fmt::to_string(_isdcf_name_part_length));
        /* [XML] EnablePlayerHTTPServer 1 to enable a HTTP server to control the player, otherwise 0 */
        cxml::add_text_child(root, "EnablePlayerHTTPServer", _enable_player_http_server ? "1" : "0");
        /* [XML] PlayerHTTPServerPort Port to use for player HTTP server (if enabled) */
-       cxml::add_text_child(root, "PlayerHTTPServerPort", raw_convert<string>(_player_http_server_port));
+       cxml::add_text_child(root, "PlayerHTTPServerPort", fmt::to_string(_player_http_server_port));
        /* [XML] RelativePaths 1 to write relative paths to project metadata files, 0 to use absolute paths */
        cxml::add_text_child(root, "RelativePaths", _relative_paths ? "1" : "0");
 
@@ -1769,7 +1770,7 @@ Config::Grok::as_xml(xmlpp::Element* node) const
 {
        node->add_child("BinaryLocation")->add_child_text(binary_location.string());
        node->add_child("Enable")->add_child_text((enable ? "1" : "0"));
-       node->add_child("Selected")->add_child_text(raw_convert<string>(selected));
+       node->add_child("Selected")->add_child_text(fmt::to_string(selected));
        node->add_child("LicenceServer")->add_child_text(licence_server);
        node->add_child("Licence")->add_child_text(licence);
 }
index be30ccf4343df694a292c2b4ffad51f51947f712..5c44cb47a426d7f055e33aebfc67c2b6c14bf146 100644 (file)
@@ -36,9 +36,9 @@
 #include "util.h"
 #include "video_content.h"
 #include <dcp/locale_convert.h>
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <boost/thread/mutex.hpp>
 #include <iostream>
 
@@ -53,7 +53,6 @@ using std::string;
 using std::vector;
 using boost::optional;
 using dcp::locale_convert;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -157,15 +156,15 @@ Content::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_beh
                        }
                        auto p = cxml::add_child(element, "Path");
                        p->add_child_text(path.string());
-                       p->set_attribute ("mtime", raw_convert<string>(_last_write_times[i]));
+                       p->set_attribute ("mtime", fmt::to_string(_last_write_times[i]));
                }
        }
        cxml::add_text_child(element, "Digest", _digest);
-       cxml::add_text_child(element, "Position", raw_convert<string>(_position.get()));
-       cxml::add_text_child(element, "TrimStart", raw_convert<string>(_trim_start.get()));
-       cxml::add_text_child(element, "TrimEnd", raw_convert<string>(_trim_end.get()));
+       cxml::add_text_child(element, "Position", fmt::to_string(_position.get()));
+       cxml::add_text_child(element, "TrimStart", fmt::to_string(_trim_start.get()));
+       cxml::add_text_child(element, "TrimEnd", fmt::to_string(_trim_end.get()));
        if (_video_frame_rate) {
-               cxml::add_text_child(element, "VideoFrameRate", raw_convert<string>(_video_frame_rate.get()));
+               cxml::add_text_child(element, "VideoFrameRate", fmt::to_string(_video_frame_rate.get()));
        }
 }
 
index 3fb978f7cd59094ca06b5797cc437227eb1bd671..10196199aec25783fbb1816ec8aa63d20d7b616c 100644 (file)
@@ -28,6 +28,7 @@
 #include "ratio.h"
 #include "variant.h"
 #include <dcp/raw_convert.h>
+#include <fmt/format.h>
 #include <iostream>
 #include <string>
 
@@ -88,6 +89,25 @@ argument_option (int& n, int argc, char* argv[], string short_name, string long_
 }
 
 
+template <>
+void
+argument_option(int& n, int argc, char* argv[], string short_name, string long_name, bool* claimed, optional<string>* error, string* out)
+{
+       string const a = argv[n];
+       if (a != short_name && a != long_name) {
+               return;
+       }
+
+       if ((n + 1) >= argc) {
+               **error = String::compose("%1: option %2 requires an argument", argv[0], long_name);
+               return;
+       }
+
+       *out = string(argv[++n]);
+       *claimed = true;
+}
+
+
 template <class T>
 void
 argument_option (
index a6f7d4bacd6948272a7db73e9a6d3ea8c7b2f241..210d7362d89477246c1d2b3ba3d8646c5097ffc0 100644 (file)
 
 
 #include "crop.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::shared_ptr;
 using std::string;
-using dcp::raw_convert;
 
 
 Crop::Crop(shared_ptr<cxml::Node> node)
@@ -44,10 +43,10 @@ Crop::Crop(shared_ptr<cxml::Node> node)
 void
 Crop::as_xml(xmlpp::Element* element) const
 {
-       cxml::add_text_child(element, "LeftCrop", raw_convert<string>(left));
-       cxml::add_text_child(element, "RightCrop", raw_convert<string>(right));
-       cxml::add_text_child(element, "TopCrop", raw_convert<string>(top));
-       cxml::add_text_child(element, "BottomCrop", raw_convert<string>(bottom));
+       cxml::add_text_child(element, "LeftCrop", fmt::to_string(left));
+       cxml::add_text_child(element, "RightCrop", fmt::to_string(right));
+       cxml::add_text_child(element, "TopCrop", fmt::to_string(top));
+       cxml::add_text_child(element, "BottomCrop", fmt::to_string(bottom));
 }
 
 
index 1e145c8fc5b19285519e93c8064e7751b8efe2cc..2e6f5c4141c1fafcd6f196760ea4554e9dcd74f2 100644 (file)
 #include "compose.hpp"
 #include "dcpomatic_assert.h"
 #include "dcpomatic_log.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 
@@ -63,7 +63,7 @@ Drive::as_xml () const
        for (auto i: _mount_points) {
                cxml::add_text_child(root, "MountPoint", i.string());
        }
-       cxml::add_text_child(root, "Size", dcp::raw_convert<string>(_size));
+       cxml::add_text_child(root, "Size", fmt::to_string(_size));
        if (_vendor) {
                cxml::add_text_child(root, "Vendor", *_vendor);
        }
index 743c11980f7b16c09717a0ac818b43d4b536f79a..0327c813629f567b9bf06ec972187e9ae03bb8f1 100644 (file)
 
 
 #include "cross.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 extern "C" {
 #include <libavformat/avio.h>
 }
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::string;
@@ -80,7 +80,7 @@ running_32_on_64 ()
 string
 dcpomatic::get_process_id ()
 {
-       return dcp::raw_convert<string>(getpid());
+       return fmt::to_string(getpid());
 }
 
 
index 9181b6c8abf1deb8861a21c65b3db63d4d62a883..13d52ee3bf24f212405914d73984814b406ab942 100644 (file)
 #include "util.h"
 #include <dcp/file.h>
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
 #include <glib.h>
 extern "C" {
 #include <libavformat/avio.h>
 }
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/dll/runtime_symbol_info.hpp>
 #include <windows.h>
@@ -660,7 +660,7 @@ disk_write_finished ()
 string
 dcpomatic::get_process_id ()
 {
-       return dcp::raw_convert<string>(GetCurrentProcessId());
+       return fmt::to_string(GetCurrentProcessId());
 }
 
 
index 6a6ed0b0c9edef4a442a81179bc5668ba82362e3..5b4f163e14fed139290e04c856f3fb1b6e219916 100644 (file)
@@ -41,6 +41,7 @@
 #include <dcp/reel.h>
 #include <dcp/scope_guard.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iterator>
 #include <iostream>
 
@@ -388,8 +389,8 @@ DCPContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_
 
        if (audio) {
                audio->as_xml(element);
-               cxml::add_text_child(element, "AudioFrameRate", raw_convert<string>(audio->stream()->frame_rate()));
-               cxml::add_text_child(element, "AudioLength", raw_convert<string>(audio->stream()->length()));
+               cxml::add_text_child(element, "AudioFrameRate", fmt::to_string(audio->stream()->frame_rate()));
+               cxml::add_text_child(element, "AudioLength", fmt::to_string(audio->stream()->length()));
                audio->stream()->mapping().as_xml(cxml::add_child(element, "AudioMapping"));
        }
 
@@ -435,13 +436,13 @@ DCPContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_
                cxml::add_text_child(element, "CPL", _cpl.get());
        }
        for (auto i: _reel_lengths) {
-               cxml::add_text_child(element, "ReelLength", raw_convert<string>(i));
+               cxml::add_text_child(element, "ReelLength", fmt::to_string(i));
        }
 
        for (auto const& i: _markers) {
                auto marker = cxml::add_child(element, "Marker");
                marker->set_attribute("type", dcp::marker_to_string(i.first));
-               marker->add_child_text(raw_convert<string>(i.second.get()));
+               marker->add_child_text(fmt::to_string(i.second.get()));
        }
 
        for (auto i: _ratings) {
@@ -454,7 +455,7 @@ DCPContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_
        }
 
        if (_active_audio_channels) {
-               cxml::add_text_child(element, "ActiveAudioChannels", raw_convert<string>(*_active_audio_channels));
+               cxml::add_text_child(element, "ActiveAudioChannels", fmt::to_string(*_active_audio_channels));
        }
 
        for (auto i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
index b18d1431845c3e32b63532903ca4ea2c25163335..21c1b4de9d9f8f6fc2b0e3ed9c543bd51348aa3e 100644 (file)
@@ -26,9 +26,9 @@
 #include "text_content.h"
 #include <dcp/interop_load_font_node.h>
 #include <dcp/interop_text_asset.h>
-#include <dcp/raw_convert.h>
 #include <dcp/smpte_text_asset.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 
 #include "i18n.h"
 
@@ -39,7 +39,6 @@ using std::make_shared;
 using std::shared_ptr;
 using std::string;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -150,5 +149,5 @@ DCPSubtitleContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehavio
                only_text()->as_xml(element);
        }
 
-       cxml::add_text_child(element, "Length", raw_convert<string>(_length.get()));
+       cxml::add_text_child(element, "Length", fmt::to_string(_length.get()));
 }
index ec88888ddb573c7b221277e0cc10e50eb1a8a8f0..f250d45053e6ae8fce14da7c050436a0ff6792a6 100644 (file)
@@ -43,7 +43,6 @@
 #include "player_video.h"
 #include "rng.h"
 #include <libcxml/cxml.h>
-#include <dcp/raw_convert.h>
 #include <dcp/openjpeg_image.h>
 #include <dcp/rgb_xyz.h>
 #include <dcp/j2k_transcode.h>
@@ -51,6 +50,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/asio.hpp>
 #include <boost/thread.hpp>
 #include <stdint.h>
@@ -65,7 +65,6 @@ using std::make_shared;
 using std::shared_ptr;
 using std::string;
 using dcp::ArrayData;
-using dcp::raw_convert;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -228,7 +227,7 @@ DCPVideo::encode_remotely (EncodeServerDescription serv, int timeout) const
 {
        boost::asio::io_service io_service;
        boost::asio::ip::tcp::resolver resolver (io_service);
-       boost::asio::ip::tcp::resolver::query query (serv.host_name(), raw_convert<string> (ENCODE_FRAME_PORT));
+       boost::asio::ip::tcp::resolver::query query(serv.host_name(), fmt::to_string(ENCODE_FRAME_PORT));
        boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
 
        auto socket = make_shared<Socket>(timeout);
@@ -239,7 +238,7 @@ DCPVideo::encode_remotely (EncodeServerDescription serv, int timeout) const
        /* Collect all XML metadata */
        xmlpp::Document doc;
        auto root = doc.create_root_node ("EncodingRequest");
-       cxml::add_text_child(root, "Version", raw_convert<string>(SERVER_LINK_VERSION));
+       cxml::add_text_child(root, "Version", fmt::to_string(SERVER_LINK_VERSION));
        add_metadata (root);
 
        LOG_DEBUG_ENCODE (N_("Sending frame %1 to remote"), _index);
@@ -278,10 +277,10 @@ DCPVideo::encode_remotely (EncodeServerDescription serv, int timeout) const
 void
 DCPVideo::add_metadata (xmlpp::Element* el) const
 {
-       cxml::add_text_child(el, "Index", raw_convert<string>(_index));
-       cxml::add_text_child(el, "FramesPerSecond", raw_convert<string>(_frames_per_second));
-       cxml::add_text_child(el, "VideoBitRate", raw_convert<string>(_video_bit_rate));
-       cxml::add_text_child(el, "Resolution", raw_convert<string>(int(_resolution)));
+       cxml::add_text_child(el, "Index", fmt::to_string(_index));
+       cxml::add_text_child(el, "FramesPerSecond", fmt::to_string(_frames_per_second));
+       cxml::add_text_child(el, "VideoBitRate", fmt::to_string(_video_bit_rate));
+       cxml::add_text_child(el, "Resolution", fmt::to_string(int(_resolution)));
        _frame->add_metadata (el);
 }
 
index 7bccdd9fc18ad3b9d4bc16afafcf93d22e1bf7d4..0a11ce6188b059ba8c506d0e5bbb18d9328c0f56 100644 (file)
@@ -23,6 +23,7 @@
 #include "disk_writer_messages.h"
 #include "nanomsg.h"
 #include <dcp/raw_convert.h>
+#include <fmt/format.h>
 
 
 using std::string;
@@ -81,15 +82,15 @@ DiskWriterBackEndResponse::write_to_nanomsg(Nanomsg& nanomsg, int timeout) const
                        break;
                case Type::FORMAT_PROGRESS:
                        message = String::compose("%1\n", DISK_WRITER_FORMAT_PROGRESS);
-                       message += dcp::raw_convert<string>(_progress) + "\n";
+                       message += fmt::to_string(_progress) + "\n";
                        break;
                case Type::COPY_PROGRESS:
                        message = String::compose("%1\n", DISK_WRITER_COPY_PROGRESS);
-                       message += dcp::raw_convert<string>(_progress) + "\n";
+                       message += fmt::to_string(_progress) + "\n";
                        break;
                case Type::VERIFY_PROGRESS:
                        message = String::compose("%1\n", DISK_WRITER_VERIFY_PROGRESS);
-                       message += dcp::raw_convert<string>(_progress) + "\n";
+                       message += fmt::to_string(_progress) + "\n";
                        break;
        }
 
index 8d175998678cd9755bd69dc51aa5bfb2ebfec645..08e661eac7f82608bbd19514d908be859da639ad 100644 (file)
 #include "util.h"
 #include "variant.h"
 #include "version.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 #include <libcxml/cxml.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/scoped_array.hpp>
 #ifdef HAVE_VALGRIND_H
@@ -72,7 +72,6 @@ using boost::scoped_array;
 using boost::optional;
 using dcp::ArrayData;
 using dcp::Size;
-using dcp::raw_convert;
 
 
 EncodeServer::EncodeServer (bool verbose, int num_threads)
@@ -300,8 +299,8 @@ EncodeServer::broadcast_received ()
                /* Reply to the client saying what we can do */
                xmlpp::Document doc;
                auto root = doc.create_root_node ("ServerAvailable");
-               cxml::add_text_child(root, "Threads", raw_convert<string>(_worker_threads.size()));
-               cxml::add_text_child(root, "Version", raw_convert<string>(SERVER_LINK_VERSION));
+               cxml::add_text_child(root, "Threads", fmt::to_string(_worker_threads.size()));
+               cxml::add_text_child(root, "Version", fmt::to_string(SERVER_LINK_VERSION));
                auto xml = doc.write_to_string ("UTF-8");
 
                if (_verbose) {
index 143569e1603b3a1d17aefefd66e100974021f5e0..22c1d37dd5cc82da2ecb444d668cadd03ba4dc8d 100644 (file)
@@ -28,8 +28,8 @@
 #include "exceptions.h"
 #include "util.h"
 #include "variant.h"
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
+#include <fmt/format.h>
 #include <boost/bind/placeholders.hpp>
 #include <boost/lambda/lambda.hpp>
 #include <iostream>
@@ -49,7 +49,6 @@ using boost::scoped_array;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
-using dcp::raw_convert;
 
 
 EncodeServerFinder* EncodeServerFinder::_instance = 0;
@@ -137,7 +136,7 @@ try
                for (auto const& i: Config::instance()->servers()) {
                        try {
                                boost::asio::ip::udp::resolver resolver (io_service);
-                               boost::asio::ip::udp::resolver::query query (i, raw_convert<string>(HELLO_PORT));
+                               boost::asio::ip::udp::resolver::query query(i, fmt::to_string(HELLO_PORT));
                                boost::asio::ip::udp::endpoint end_point (*resolver.resolve(query));
                                socket.send_to (boost::asio::buffer(data.c_str(), data.size() + 1), end_point);
                        } catch (...) {
index 79042e59c21597eedc70aea0c727dcb0fa13ba94..fc91c8676bd6fb50e484c410fac65d45ef00b259 100644 (file)
 
 #include "config.h"
 #include "export_config.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::string;
@@ -106,7 +106,7 @@ ExportConfig::write(xmlpp::Element* element) const
        cxml::add_text_child(element, "MixdownToStereo", _mixdown_to_stereo ? "1" : "0");
        cxml::add_text_child(element, "SplitReels", _split_reels ? "1" : "0");
        cxml::add_text_child(element, "SplitStreams", _split_streams ? "1" : "0");
-       cxml::add_text_child(element, "X264CRF", dcp::raw_convert<string>(_x264_crf));
+       cxml::add_text_child(element, "X264CRF", fmt::to_string(_x264_crf));
 }
 
 
index 94d1197dfa49dade4ae5c936fca1806cac8fd571..cac3305efdb04f9b2da83ed955cb88b1976ac54c 100644 (file)
@@ -22,7 +22,7 @@
 #include "fcpxml.h"
 #include "fcpxml_content.h"
 #include "text_content.h"
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
 
 #include "i18n.h"
 
@@ -103,6 +103,6 @@ FCPXMLContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour pa
                only_text()->as_xml(element);
        }
 
-       cxml::add_child(element, "Length", dcp::raw_convert<string>(_length.get()));
+       cxml::add_child(element, "Length", fmt::to_string(_length.get()));
 }
 
index 24f96b889217edf6581bcbbcfd42778dc0e8b7fb..e0da3a22dcffcd4aaa7dc6ae466ccde5bc418056 100644 (file)
 
 
 #include "ffmpeg_audio_stream.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
 #include <libcxml/cxml.h>
+#include <fmt/format.h>
 
 
 using std::string;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -55,16 +54,16 @@ void
 FFmpegAudioStream::as_xml(xmlpp::Element* root) const
 {
        FFmpegStream::as_xml (root);
-       cxml::add_text_child(root, "FrameRate", raw_convert<string>(frame_rate()));
-       cxml::add_text_child(root, "Length", raw_convert<string>(length()));
+       cxml::add_text_child(root, "FrameRate", fmt::to_string(frame_rate()));
+       cxml::add_text_child(root, "Length", fmt::to_string(length()));
        mapping().as_xml(cxml::add_child(root, "Mapping"));
        if (first_audio) {
-               cxml::add_text_child(root, "FirstAudio", raw_convert<string>(first_audio.get().get()));
+               cxml::add_text_child(root, "FirstAudio", fmt::to_string(first_audio.get().get()));
        }
        if (codec_name) {
                cxml::add_text_child(root, "CodecName", codec_name.get());
        }
        if (bit_depth()) {
-               cxml::add_text_child(root, "BitDepth", raw_convert<string>(bit_depth().get()));
+               cxml::add_text_child(root, "BitDepth", fmt::to_string(bit_depth().get()));
        }
 }
index 5a99ecaa5e178028b790791f37bec80f9b58ad80..49e4933a68c2b63779dd4eef4bfbb54b2f41b2f9 100644 (file)
 #include "text_content.h"
 #include "variant.h"
 #include "video_content.h"
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 extern "C" {
 #include <libavformat/avformat.h>
 #include <libavutil/pixdesc.h>
 }
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -59,7 +59,6 @@ using std::make_shared;
 using std::shared_ptr;
 using std::dynamic_pointer_cast;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -236,23 +235,23 @@ FFmpegContent::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour pa
        }
 
        if (_first_video) {
-               cxml::add_text_child(element, "FirstVideo", raw_convert<string>(_first_video.get().get()));
+               cxml::add_text_child(element, "FirstVideo", fmt::to_string(_first_video.get().get()));
        }
 
        if (_color_range) {
-               cxml::add_text_child(element, "ColorRange", raw_convert<string>(static_cast<int>(*_color_range)));
+               cxml::add_text_child(element, "ColorRange", fmt::to_string(static_cast<int>(*_color_range)));
        }
        if (_color_primaries) {
-               cxml::add_text_child(element, "ColorPrimaries", raw_convert<string>(static_cast<int>(*_color_primaries)));
+               cxml::add_text_child(element, "ColorPrimaries", fmt::to_string(static_cast<int>(*_color_primaries)));
        }
        if (_color_trc) {
-               cxml::add_text_child(element, "ColorTransferCharacteristic", raw_convert<string>(static_cast<int>(*_color_trc)));
+               cxml::add_text_child(element, "ColorTransferCharacteristic", fmt::to_string(static_cast<int>(*_color_trc)));
        }
        if (_colorspace) {
-               cxml::add_text_child(element, "Colorspace", raw_convert<string>(static_cast<int>(*_colorspace)));
+               cxml::add_text_child(element, "Colorspace", fmt::to_string(static_cast<int>(*_colorspace)));
        }
        if (_bits_per_pixel) {
-               cxml::add_text_child(element, "BitsPerPixel", raw_convert<string>(*_bits_per_pixel));
+               cxml::add_text_child(element, "BitsPerPixel", fmt::to_string(*_bits_per_pixel));
        }
 }
 
index 0ee41deabd1dd6af427a9a2c6c787fae35eec2b7..c9fcd04138deb770d970801e1e4ded8f244c7fcc 100644 (file)
@@ -28,7 +28,6 @@
 #include "image.h"
 #include "memory_util.h"
 #include "video_filter_graph.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 extern "C" {
@@ -38,6 +37,7 @@ extern "C" {
 }
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -52,7 +52,6 @@ using std::shared_ptr;
 using std::string;
 using boost::optional;
 using std::dynamic_pointer_cast;
-using dcp::raw_convert;
 
 
 FFmpegImageProxy::FFmpegImageProxy (boost::filesystem::path path)
@@ -143,8 +142,8 @@ FFmpegImageProxy::image (Image::Alignment alignment, optional<dcp::Size>) const
        /* These durations are in microseconds, and represent how far into the content file
           we will look for streams.
        */
-       av_dict_set (&options, "analyzeduration", raw_convert<string>(5 * 60 * 1000000).c_str(), 0);
-       av_dict_set (&options, "probesize", raw_convert<string>(5 * 60 * 1000000).c_str(), 0);
+       av_dict_set(&options, "analyzeduration", fmt::to_string(5 * 60 * 1000000).c_str(), 0);
+       av_dict_set(&options, "probesize", fmt::to_string(5 * 60 * 1000000).c_str(), 0);
 
        int e = avformat_open_input (&format_context, 0, 0, &options);
        if ((e < 0 && e == AVERROR_INVALIDDATA) || (e >= 0 && format_context->probe_score <= 25)) {
index 800c45eb6b45685d5258169074e77bace1a0eca6..0a53b1b3c166cea44c4270647871d5ce575de5dd 100644 (file)
@@ -18,9 +18,9 @@
 
 */
 
-#include "ffmpeg_stream.h"
+
 #include "dcpomatic_assert.h"
-#include <dcp/raw_convert.h>
+#include "ffmpeg_stream.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
@@ -28,9 +28,11 @@ extern "C" {
 #include <libavformat/avformat.h>
 }
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
+
 
 using std::string;
-using dcp::raw_convert;
+
 
 FFmpegStream::FFmpegStream (cxml::ConstNodePtr node)
        : name (node->string_child ("Name"))
@@ -43,7 +45,7 @@ void
 FFmpegStream::as_xml(xmlpp::Element* root) const
 {
        cxml::add_text_child(root, "Name", name);
-       cxml::add_text_child(root, "Id", raw_convert<string>(_id));
+       cxml::add_text_child(root, "Id", fmt::to_string(_id));
 }
 
 bool
index ebbdfe013edc545ff02efb079a92e26e4799c5ba..cf04ac0da4e010be1cff3b1c999996b282ab7cff 100644 (file)
@@ -71,6 +71,7 @@
 #include <dcp/reel_file_asset.h>
 #include <dcp/util.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/regex.hpp>
@@ -249,8 +250,8 @@ Film::video_identifier () const
        string s = container()->id()
                + "_" + resolution_to_string (_resolution)
                + "_" + _playlist->video_identifier()
-               + "_" + raw_convert<string>(_video_frame_rate)
-               + "_" + raw_convert<string>(video_bit_rate(video_encoding()));
+               + "_" + fmt::to_string(_video_frame_rate)
+               + "_" + fmt::to_string(video_bit_rate(video_encoding()));
 
        if (encrypted ()) {
                /* This is insecure but hey, the key is in plaintext in metadata.xml */
@@ -290,7 +291,7 @@ Film::info_file (DCPTimePeriod period) const
 {
        boost::filesystem::path p;
        p /= "info";
-       p /= video_identifier () + "_" + raw_convert<string> (period.from.get()) + "_" + raw_convert<string> (period.to.get());
+       p /= video_identifier () + "_" + fmt::to_string(period.from.get()) + "_" + fmt::to_string(period.to.get());
        return file (p);
 }
 
@@ -390,7 +391,7 @@ Film::metadata (bool with_content_paths) const
        auto doc = make_shared<xmlpp::Document>();
        auto root = doc->create_root_node ("Metadata");
 
-       cxml::add_text_child(root, "Version", raw_convert<string>(current_state_version));
+       cxml::add_text_child(root, "Version", fmt::to_string(current_state_version));
        auto last_write = cxml::add_child(root, "LastWrittenBy");
        last_write->add_child_text (dcpomatic_version);
        last_write->set_attribute("git", dcpomatic_git_commit);
@@ -406,12 +407,12 @@ Film::metadata (bool with_content_paths) const
        }
 
        cxml::add_text_child(root, "Resolution", resolution_to_string(_resolution));
-       cxml::add_text_child(root, "J2KVideoBitRate", raw_convert<string>(_video_bit_rate[VideoEncoding::JPEG2000]));
-       cxml::add_text_child(root, "MPEG2VideoBitRate", raw_convert<string>(_video_bit_rate[VideoEncoding::MPEG2]));
-       cxml::add_text_child(root, "VideoFrameRate", raw_convert<string>(_video_frame_rate));
-       cxml::add_text_child(root, "AudioFrameRate", raw_convert<string>(_audio_frame_rate));
+       cxml::add_text_child(root, "J2KVideoBitRate", fmt::to_string(_video_bit_rate[VideoEncoding::JPEG2000]));
+       cxml::add_text_child(root, "MPEG2VideoBitRate", fmt::to_string(_video_bit_rate[VideoEncoding::MPEG2]));
+       cxml::add_text_child(root, "VideoFrameRate", fmt::to_string(_video_frame_rate));
+       cxml::add_text_child(root, "AudioFrameRate", fmt::to_string(_audio_frame_rate));
        cxml::add_text_child(root, "ISDCFDate", boost::gregorian::to_iso_string(_isdcf_date));
-       cxml::add_text_child(root, "AudioChannels", raw_convert<string>(_audio_channels));
+       cxml::add_text_child(root, "AudioChannels", fmt::to_string(_audio_channels));
        cxml::add_text_child(root, "ThreeD", _three_d ? "1" : "0");
        cxml::add_text_child(root, "Sequence", _sequence ? "1" : "0");
        cxml::add_text_child(root, "Interop", _interop ? "1" : "0");
@@ -423,17 +424,17 @@ Film::metadata (bool with_content_paths) const
        if (_audio_processor) {
                cxml::add_text_child(root, "AudioProcessor", _audio_processor->id());
        }
-       cxml::add_text_child(root, "ReelType", raw_convert<string>(static_cast<int> (_reel_type)));
-       cxml::add_text_child(root, "ReelLength", raw_convert<string>(_reel_length));
+       cxml::add_text_child(root, "ReelType", fmt::to_string(static_cast<int>(_reel_type)));
+       cxml::add_text_child(root, "ReelLength", fmt::to_string(_reel_length));
        for (auto boundary: _custom_reel_boundaries) {
-               cxml::add_text_child(root, "CustomReelBoundary", raw_convert<string>(boundary.get()));
+               cxml::add_text_child(root, "CustomReelBoundary", fmt::to_string(boundary.get()));
        }
        cxml::add_text_child(root, "ReencodeJ2K", _reencode_j2k ? "1" : "0");
        cxml::add_text_child(root, "UserExplicitVideoFrameRate", _user_explicit_video_frame_rate ? "1" : "0");
        for (auto const& marker: _markers) {
                auto m = cxml::add_child(root, "Marker");
                m->set_attribute("type", dcp::marker_to_string(marker.first));
-               m->add_child_text(raw_convert<string>(marker.second.get()));
+               m->add_child_text(fmt::to_string(marker.second.get()));
        }
        for (auto i: _ratings) {
                i.as_xml(cxml::add_child(root, "Rating"));
@@ -449,7 +450,7 @@ Film::metadata (bool with_content_paths) const
        if (_sign_language_video_language) {
                cxml::add_text_child(root, "SignLanguageVideoLanguage", _sign_language_video_language->to_string());
        }
-       cxml::add_text_child(root, "VersionNumber", raw_convert<string>(_version_number));
+       cxml::add_text_child(root, "VersionNumber", fmt::to_string(_version_number));
        cxml::add_text_child(root, "Status", dcp::status_to_string(_status));
        if (_chain) {
                cxml::add_text_child(root, "Chain", *_chain);
@@ -468,7 +469,7 @@ Film::metadata (bool with_content_paths) const
        cxml::add_text_child(root, "RedBand", _red_band ? "1" : "0");
        cxml::add_text_child(root, "TwoDVersionOfThreeD", _two_d_version_of_three_d ? "1" : "0");
        if (_luminance) {
-               cxml::add_text_child(root, "LuminanceValue", raw_convert<string>(_luminance->value()));
+               cxml::add_text_child(root, "LuminanceValue", fmt::to_string(_luminance->value()));
                cxml::add_text_child(root, "LuminanceUnit", dcp::Luminance::unit_to_string(_luminance->unit()));
        }
        cxml::add_text_child(root, "UserExplicitContainer", _user_explicit_container ? "1" : "0");
@@ -933,7 +934,7 @@ Film::isdcf_name (bool if_created_now) const
                                }
                        }
                } else {
-                       version = dcp::raw_convert<string>(_version_number);
+                       version = fmt::to_string(_version_number);
                }
                isdcf_name += "-" + version;
        }
@@ -970,7 +971,7 @@ Film::isdcf_name (bool if_created_now) const
        }
 
        if (video_frame_rate() != 24) {
-               isdcf_name += "-" + raw_convert<string>(video_frame_rate());
+               isdcf_name += "-" + fmt::to_string(video_frame_rate());
        }
 
        if (container()) {
@@ -989,7 +990,7 @@ Film::isdcf_name (bool if_created_now) const
                                auto first_ratio = lrintf(scaled_size->ratio() * 100);
                                auto container_ratio = lrintf(container()->ratio() * 100);
                                if (first_ratio != container_ratio) {
-                                       isdcf_name += "-" + dcp::raw_convert<string>(first_ratio);
+                                       isdcf_name += "-" + fmt::to_string(first_ratio);
                                }
                        }
                }
index 4a13f77a07633d2583d84a57e07163944cd7abb9..b929a3746baef439fed4859eb83dd2960be1ca55 100644 (file)
@@ -40,9 +40,9 @@
 #include "writer.h"
 #include <dcp/cpl.h>
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
 #include <dcp/reel.h>
 #include <dcp/reel_text_asset.h>
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 
@@ -346,7 +346,7 @@ Hints::check_loudness ()
                        float const peak = max (sample_peak[i].peak, true_peak.empty() ? 0 : true_peak[i]);
                        float const peak_dB = linear_to_db(peak) + an->gain_correction(film()->playlist());
                        if (peak_dB > -3) {
-                               ch += dcp::raw_convert<string>(short_audio_channel_name(i)) + ", ";
+                               ch += fmt::to_string(short_audio_channel_name(i)) + ", ";
                        }
                }
 
index 023723c8b00465d2f7140a83440b81c091ed0cde..8fb3871581e2a3ce02995be957a09f78cb83b0eb 100644 (file)
@@ -27,7 +27,6 @@
 #include <dcp/j2k_transcode.h>
 #include <dcp/mono_j2k_picture_frame.h>
 #include <dcp/openjpeg_image.h>
-#include <dcp/raw_convert.h>
 #include <dcp/rgb_xyz.h>
 #include <dcp/stereo_j2k_picture_frame.h>
 #include <dcp/warnings.h>
@@ -35,6 +34,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -48,7 +48,6 @@ using std::shared_ptr;
 using std::string;
 using boost::optional;
 using dcp::ArrayData;
-using dcp::raw_convert;
 
 
 /** Construct a J2KImageProxy from a JPEG2000 file */
@@ -195,12 +194,12 @@ void
 J2KImageProxy::add_metadata(xmlpp::Element* element) const
 {
        cxml::add_text_child(element, "Type", N_("J2K"));
-       cxml::add_text_child(element, "Width", raw_convert<string>(_size.width));
-       cxml::add_text_child(element, "Height", raw_convert<string>(_size.height));
+       cxml::add_text_child(element, "Width", fmt::to_string(_size.width));
+       cxml::add_text_child(element, "Height", fmt::to_string(_size.height));
        if (_eye) {
-               cxml::add_text_child(element, "Eye", raw_convert<string>(static_cast<int>(_eye.get())));
+               cxml::add_text_child(element, "Eye", fmt::to_string(static_cast<int>(_eye.get())));
        }
-       cxml::add_text_child(element, "Size", raw_convert<string>(_data->size()));
+       cxml::add_text_child(element, "Size", fmt::to_string(_data->size()));
 }
 
 
index 92d5c117152f837e4ba11624426f8c89cecd942d..bed563f5a6e75b7f74d35436f2119077ee91dcf6 100644 (file)
@@ -24,7 +24,7 @@
 #include "job_manager.h"
 #include "json_server.h"
 #include "transcode_job.h"
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
 #include <boost/asio.hpp>
 #include <boost/bind/bind.hpp>
 #include <boost/thread.hpp>
@@ -40,7 +40,6 @@ using std::shared_ptr;
 using std::string;
 using boost::asio::ip::tcp;
 using boost::thread;
-using dcp::raw_convert;
 
 
 #define MAX_LENGTH 512
@@ -228,7 +227,7 @@ JSONServer::request (string url, shared_ptr<tcp::socket> socket)
 
                        json += "\"name\": \"" + (*i)->json_name() + "\", ";
                        if ((*i)->progress()) {
-                               json += "\"progress\": " + raw_convert<string>((*i)->progress().get()) + ", ";
+                               json += "\"progress\": " + fmt::to_string((*i)->progress().get()) + ", ";
                        } else {
                                json += "\"progress\": unknown, ";
                        }
@@ -245,7 +244,7 @@ JSONServer::request (string url, shared_ptr<tcp::socket> socket)
        }
 
        string reply = "HTTP/1.1 200 OK\r\n"
-               "Content-Length: " + raw_convert<string>(json.length()) + "\r\n"
+               "Content-Length: " + fmt::to_string(json.length()) + "\r\n"
                "Content-Type: application/json\r\n"
                "\r\n"
                + json + "\r\n";
index 07690f3ac3537cd2e5b2528fef7c6278db4775d1..91602e12c706d0d8b7b147f79396686fda7abdee 100644 (file)
@@ -20,7 +20,7 @@
 
 
 #include "pixel_quanta.h"
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
 
 
 PixelQuanta::PixelQuanta (cxml::ConstNodePtr node)
@@ -34,8 +34,8 @@ PixelQuanta::PixelQuanta (cxml::ConstNodePtr node)
 void
 PixelQuanta::as_xml (xmlpp::Element* node) const
 {
-       cxml::add_text_child(node, "X", dcp::raw_convert<std::string>(x));
-       cxml::add_text_child(node, "Y", dcp::raw_convert<std::string>(y));
+       cxml::add_text_child(node, "X", fmt::to_string(x));
+       cxml::add_text_child(node, "Y", fmt::to_string(y));
 }
 
 
index 247301d582312f83656bce2d270a2bcc1319d9b1..b2da6c33b2056396be6e8609070ab14169005b8b 100644 (file)
 #include "player.h"
 #include "player_video.h"
 #include "video_content.h"
-#include <dcp/raw_convert.h>
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iostream>
 
 
@@ -44,7 +44,6 @@ using std::string;
 using std::weak_ptr;
 using boost::optional;
 using dcp::Data;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -204,25 +203,25 @@ PlayerVideo::add_metadata(xmlpp::Element* element) const
 {
        _crop.as_xml(element);
        if (_fade) {
-               cxml::add_text_child(element, "Fade", raw_convert<string>(_fade.get()));
+               cxml::add_text_child(element, "Fade", fmt::to_string(_fade.get()));
        }
        _in->add_metadata(cxml::add_child(element, "In"));
-       cxml::add_text_child(element, "InterWidth", raw_convert<string>(_inter_size.width));
-       cxml::add_text_child(element, "InterHeight", raw_convert<string>(_inter_size.height));
-       cxml::add_text_child(element, "OutWidth", raw_convert<string>(_out_size.width));
-       cxml::add_text_child(element, "OutHeight", raw_convert<string>(_out_size.height));
-       cxml::add_text_child(element, "Eyes", raw_convert<string>(static_cast<int>(_eyes)));
-       cxml::add_text_child(element, "Part", raw_convert<string>(static_cast<int>(_part)));
-       cxml::add_text_child(element, "VideoRange", raw_convert<string>(static_cast<int>(_video_range)));
+       cxml::add_text_child(element, "InterWidth", fmt::to_string(_inter_size.width));
+       cxml::add_text_child(element, "InterHeight", fmt::to_string(_inter_size.height));
+       cxml::add_text_child(element, "OutWidth", fmt::to_string(_out_size.width));
+       cxml::add_text_child(element, "OutHeight", fmt::to_string(_out_size.height));
+       cxml::add_text_child(element, "Eyes", fmt::to_string(static_cast<int>(_eyes)));
+       cxml::add_text_child(element, "Part", fmt::to_string(static_cast<int>(_part)));
+       cxml::add_text_child(element, "VideoRange", fmt::to_string(static_cast<int>(_video_range)));
        cxml::add_text_child(element, "Error", _error ? "1" : "0");
        if (_colour_conversion) {
                _colour_conversion.get().as_xml(element);
        }
        if (_text) {
-               cxml::add_text_child(element, "SubtitleWidth", raw_convert<string>(_text->image->size().width));
-               cxml::add_text_child(element, "SubtitleHeight", raw_convert<string>(_text->image->size().height));
-               cxml::add_text_child(element, "SubtitleX", raw_convert<string>(_text->position.x));
-               cxml::add_text_child(element, "SubtitleY", raw_convert<string>(_text->position.y));
+               cxml::add_text_child(element, "SubtitleWidth", fmt::to_string(_text->image->size().width));
+               cxml::add_text_child(element, "SubtitleHeight", fmt::to_string(_text->image->size().height));
+               cxml::add_text_child(element, "SubtitleX", fmt::to_string(_text->position.x));
+               cxml::add_text_child(element, "SubtitleY", fmt::to_string(_text->position.y));
        }
 }
 
index 1ad78827c51d362ac237e489a9b38bc44b2f6ade..9e819140b6601317fe66d4790040927e67204c36 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "raw_image_proxy.h"
 #include "image.h"
-#include <dcp/raw_convert.h>
 #include <dcp/util.h>
 #include <dcp/warnings.h>
 #include <libcxml/cxml.h>
@@ -31,6 +30,7 @@ extern "C" {
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 #include "i18n.h"
 
@@ -42,7 +42,6 @@ using std::pair;
 using std::shared_ptr;
 using std::string;
 using boost::optional;
-using dcp::raw_convert;
 
 
 RawImageProxy::RawImageProxy(shared_ptr<const Image> image)
@@ -76,9 +75,9 @@ void
 RawImageProxy::add_metadata(xmlpp::Element* element) const
 {
        cxml::add_text_child(element, "Type", N_("Raw"));
-       cxml::add_text_child(element, "Width", raw_convert<string>(_image->size().width));
-       cxml::add_text_child(element, "Height", raw_convert<string>(_image->size().height));
-       cxml::add_text_child(element, "PixelFormat", raw_convert<string>(static_cast<int>(_image->pixel_format())));
+       cxml::add_text_child(element, "Width", fmt::to_string(_image->size().width));
+       cxml::add_text_child(element, "Height", fmt::to_string(_image->size().height));
+       cxml::add_text_child(element, "PixelFormat", fmt::to_string(static_cast<int>(_image->pixel_format())));
 }
 
 
index c0796e7149f801bfba52ff9ef609a0e3874903ff..a66ac00a754817418bb928c6ea3518c534dcc80d 100644 (file)
@@ -43,7 +43,6 @@
 #include <dcp/filesystem.h>
 #include <dcp/interop_text_asset.h>
 #include <dcp/mono_j2k_picture_asset.h>
-#include <dcp/raw_convert.h>
 #include <dcp/reel.h>
 #include <dcp/reel_atmos_asset.h>
 #include <dcp/reel_interop_text_asset.h>
@@ -57,6 +56,7 @@
 #include <dcp/sound_asset_writer.h>
 #include <dcp/stereo_j2k_picture_asset.h>
 #include <dcp/text_image.h>
+#include <fmt/format.h>
 
 #include "i18n.h"
 
@@ -77,7 +77,6 @@ using namespace boost::placeholders;
 #endif
 using dcp::ArrayData;
 using dcp::Data;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -806,7 +805,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool
                } else if (track->language) {
                        s->set_language (track->language->to_string());
                }
-               s->set_reel_number (raw_convert<string> (_reel_index + 1));
+               s->set_reel_number(fmt::to_string(_reel_index + 1));
                asset = s;
        } else {
                auto s = make_shared<dcp::SMPTETextAsset>();
index 20b65970cbdbf0f513628418f42d2a2747affdad..dfe0917c51dcd05adc4ba88efd1b311210255a00 100644 (file)
 #include "dcpomatic_assert.h"
 #include "remembered_asset.h"
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::string;
@@ -53,8 +53,8 @@ RememberedAsset::as_xml(xmlpp::Element* parent) const
 {
        cxml::add_text_child(parent, "Filename", _filename.string());
        auto period_node = cxml::add_child(parent, "Period");
-       cxml::add_text_child(period_node, "From", dcp::raw_convert<string>(_period.from.get()));
-       cxml::add_text_child(period_node, "To", dcp::raw_convert<string>(_period.to.get()));
+       cxml::add_text_child(period_node, "From", fmt::to_string(_period.from.get()));
+       cxml::add_text_child(period_node, "To", fmt::to_string(_period.to.get()));
        cxml::add_text_child(parent, "Identifier", _identifier);
 }
 
index 3c3d4eed70f3f720b4ad0c990612684e9a55c2d6..80161c940936c27719f75befa2c5d85b26b59109 100644 (file)
@@ -26,7 +26,6 @@
 #include "image.h"
 #include "render_text.h"
 #include "util.h"
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 #include <cairomm/cairomm.h>
 LIBDCP_DISABLE_WARNINGS
@@ -34,6 +33,7 @@ LIBDCP_DISABLE_WARNINGS
 #include <pangommconfig.h>
 LIBDCP_ENABLE_WARNINGS
 #include <pango/pangocairo.h>
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 
@@ -116,9 +116,9 @@ marked_up(vector<StringText> subtitles, int target_height, float fade_factor, st
                if (subtitle.underline()) {
                        span += "underline=\"single\" ";
                }
-               span += "size=\"" + dcp::raw_convert<string>(lrintf(subtitle.size_in_pixels(target_height) * pixels_to_1024ths_point)) + "\" ";
+               span += "size=\"" + fmt::to_string(lrintf(subtitle.size_in_pixels(target_height) * pixels_to_1024ths_point)) + "\" ";
                /* Between 1-65535 inclusive, apparently... */
-               span += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65534)) + 1) + "\" ";
+               span += "alpha=\"" + fmt::to_string(int(floor(fade_factor * 65534)) + 1) + "\" ";
                span += "color=\"#" + subtitle.colour().to_rgb_string() + "\"";
                if (!extra_attribute.empty()) {
                        span += " " + extra_attribute;
@@ -148,7 +148,7 @@ marked_up(vector<StringText> subtitles, int target_height, float fade_factor, st
                        int dummy;
                        layout->get_pixel_size(space_width, dummy);
                        auto spacing = ((i.space_before() * i.size_in_pixels(target_height) - space_width) / 2) * pixels_to_1024ths_point;
-                       out += make_span(i, " ", "letter_spacing=\"" + dcp::raw_convert<string>(std::round(spacing)) + "\"");
+                       out += make_span(i, " ", "letter_spacing=\"" + fmt::to_string(std::round(spacing)) + "\"");
                }
 
                out += make_span(i, i.text(), {});
index e6c03126c351c62941b0f5427a9a4fd3bbece9c5..f22e54ac831b5cc21158a4f8b1bc30babd055d12 100644 (file)
@@ -26,6 +26,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::string;
@@ -52,7 +53,7 @@ RoughDuration::RoughDuration (cxml::ConstNodePtr node)
 void
 RoughDuration::as_xml (xmlpp::Element* node) const
 {
-       node->add_child_text(dcp::raw_convert<string>(duration));
+       node->add_child_text(fmt::to_string(duration));
 
        switch (unit) {
        case Unit::DAYS:
index 4f7fbb24125fa76684f40268f59f442f2c76038e..6b5492af96de5445e58b28e5bd2d14fbed85adf2 100644 (file)
@@ -26,9 +26,9 @@
 #include "string_text_file_content.h"
 #include "text_content.h"
 #include "util.h"
-#include <dcp/raw_convert.h>
 #include <fontconfig/fontconfig.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iostream>
 
 
@@ -41,7 +41,6 @@ using std::make_shared;
 using std::shared_ptr;
 using std::string;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -131,7 +130,7 @@ StringTextFileContent::as_xml(xmlpp::Element* element, bool with_paths, PathBeha
                only_text()->as_xml(element);
        }
 
-       cxml::add_text_child(element, "Length", raw_convert<string>(_length.get()));
+       cxml::add_text_child(element, "Length", fmt::to_string(_length.get()));
 }
 
 
index 2968416c671c4e62b8797efe4480361f98e38604..5f7da6e022fe19a6f1e7da73363c4893e72726f5 100644 (file)
 #include "exceptions.h"
 #include <libcxml/cxml.h>
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 
 
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
-using dcp::raw_convert;
 
 
 int const SubtitleAnalysis::_current_state_version = 1;
@@ -70,18 +69,18 @@ SubtitleAnalysis::write (boost::filesystem::path path) const
        auto doc = make_shared<xmlpp::Document>();
        xmlpp::Element* root = doc->create_root_node ("SubtitleAnalysis");
 
-       cxml::add_text_child(root, "Version", raw_convert<string>(_current_state_version));
+       cxml::add_text_child(root, "Version", fmt::to_string(_current_state_version));
 
        if (_bounding_box) {
                auto bounding_box = cxml::add_child(root, "BoundingBox");
-               cxml::add_text_child(bounding_box, "X", raw_convert<string>(_bounding_box->x));
-               cxml::add_text_child(bounding_box, "Y", raw_convert<string>(_bounding_box->y));
-               cxml::add_text_child(bounding_box, "Width", raw_convert<string>(_bounding_box->width));
-               cxml::add_text_child(bounding_box, "Height", raw_convert<string>(_bounding_box->height));
+               cxml::add_text_child(bounding_box, "X", fmt::to_string(_bounding_box->x));
+               cxml::add_text_child(bounding_box, "Y", fmt::to_string(_bounding_box->y));
+               cxml::add_text_child(bounding_box, "Width", fmt::to_string(_bounding_box->width));
+               cxml::add_text_child(bounding_box, "Height", fmt::to_string(_bounding_box->height));
        }
 
-       cxml::add_text_child(root, "AnalysisXOffset", raw_convert<string>(_analysis_x_offset));
-       cxml::add_text_child(root, "AnalysisYOffset", raw_convert<string>(_analysis_y_offset));
+       cxml::add_text_child(root, "AnalysisXOffset", fmt::to_string(_analysis_x_offset));
+       cxml::add_text_child(root, "AnalysisYOffset", fmt::to_string(_analysis_y_offset));
 
        doc->write_to_file_formatted (path.string());
 }
index 8356433a8ff07a80c97bf50109d382a93d7cc340..c9520bf0b8ca2b53426ca1283e64e7d11b79c3d2 100644 (file)
@@ -26,8 +26,8 @@
 #include "subtitle_film_encoder.h"
 #include <dcp/filesystem.h>
 #include <dcp/interop_text_asset.h>
-#include <dcp/raw_convert.h>
 #include <dcp/smpte_text_asset.h>
+#include <fmt/format.h>
 #include <boost/filesystem.hpp>
 #include <boost/bind/bind.hpp>
 
@@ -44,7 +44,6 @@ using boost::optional;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
-using dcp::raw_convert;
 
 
 /** @param output Directory, if there will be multiple output files, or a filename.
@@ -110,7 +109,7 @@ SubtitleFilmEncoder::go()
                        if (_film->interop()) {
                                auto s = make_shared<dcp::InteropTextAsset>();
                                s->set_movie_title (_film->name());
-                               s->set_reel_number (raw_convert<string>(reel + 1));
+                               s->set_reel_number(fmt::to_string(reel + 1));
                                i.first = s;
                        } else {
                                auto s = make_shared<dcp::SMPTETextAsset>();
@@ -148,7 +147,7 @@ SubtitleFilmEncoder::text(PlayerText subs, TextType type, optional<DCPTextTrack>
                        if (lang.first) {
                                s->set_language (lang.first->to_string());
                        }
-                       s->set_reel_number (raw_convert<string>(_reel_index + 1));
+                       s->set_reel_number(fmt::to_string(_reel_index + 1));
                        _assets[_reel_index].first = s;
                } else {
                        auto s = make_shared<dcp::SMPTETextAsset>();
index 03336f15dd8c01a29f10e10581f813e0783e6536..4a333bb76da62a1a5a6c03013e8860f50ed311bc 100644 (file)
@@ -25,9 +25,9 @@
 #include "text_content.h"
 #include "util.h"
 #include "variant.h"
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -41,7 +41,6 @@ using std::shared_ptr;
 using std::string;
 using std::vector;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -365,14 +364,14 @@ TextContent::as_xml(xmlpp::Element* root) const
 
        cxml::add_text_child(text, "Use", _use ? "1" : "0");
        cxml::add_text_child(text, "Burn", _burn ? "1" : "0");
-       cxml::add_text_child(text, "XOffset", raw_convert<string>(_x_offset));
-       cxml::add_text_child(text, "YOffset", raw_convert<string>(_y_offset));
-       cxml::add_text_child(text, "XScale", raw_convert<string>(_x_scale));
-       cxml::add_text_child(text, "YScale", raw_convert<string>(_y_scale));
+       cxml::add_text_child(text, "XOffset", fmt::to_string(_x_offset));
+       cxml::add_text_child(text, "YOffset", fmt::to_string(_y_offset));
+       cxml::add_text_child(text, "XScale", fmt::to_string(_x_scale));
+       cxml::add_text_child(text, "YScale", fmt::to_string(_y_scale));
        if (_colour) {
-               cxml::add_text_child(text, "Red", raw_convert<string>(_colour->r));
-               cxml::add_text_child(text, "Green", raw_convert<string>(_colour->g));
-               cxml::add_text_child(text, "Blue", raw_convert<string>(_colour->b));
+               cxml::add_text_child(text, "Red", fmt::to_string(_colour->r));
+               cxml::add_text_child(text, "Green", fmt::to_string(_colour->g));
+               cxml::add_text_child(text, "Blue", fmt::to_string(_colour->b));
        }
        if (_effect) {
                switch (*_effect) {
@@ -388,18 +387,18 @@ TextContent::as_xml(xmlpp::Element* root) const
                }
        }
        if (_effect_colour) {
-               cxml::add_text_child(text, "EffectRed", raw_convert<string>(_effect_colour->r));
-               cxml::add_text_child(text, "EffectGreen", raw_convert<string>(_effect_colour->g));
-               cxml::add_text_child(text, "EffectBlue", raw_convert<string>(_effect_colour->b));
+               cxml::add_text_child(text, "EffectRed", fmt::to_string(_effect_colour->r));
+               cxml::add_text_child(text, "EffectGreen", fmt::to_string(_effect_colour->g));
+               cxml::add_text_child(text, "EffectBlue", fmt::to_string(_effect_colour->b));
        }
-       cxml::add_text_child(text, "LineSpacing", raw_convert<string>(_line_spacing));
+       cxml::add_text_child(text, "LineSpacing", fmt::to_string(_line_spacing));
        if (_fade_in) {
-               cxml::add_text_child(text, "FadeIn", raw_convert<string>(_fade_in->get()));
+               cxml::add_text_child(text, "FadeIn", fmt::to_string(_fade_in->get()));
        }
        if (_fade_out) {
-               cxml::add_text_child(text, "FadeOut", raw_convert<string>(_fade_out->get()));
+               cxml::add_text_child(text, "FadeOut", fmt::to_string(_fade_out->get()));
        }
-       cxml::add_text_child(text, "OutlineWidth", raw_convert<string>(_outline_width));
+       cxml::add_text_child(text, "OutlineWidth", fmt::to_string(_outline_width));
 
        for (auto i: _fonts) {
                i->as_xml(cxml::add_child(text, "Font"));
@@ -420,18 +419,18 @@ TextContent::as_xml(xmlpp::Element* root) const
 string
 TextContent::identifier () const
 {
-       auto s = raw_convert<string> (x_scale())
-               + "_" + raw_convert<string> (y_scale())
-               + "_" + raw_convert<string> (x_offset())
-               + "_" + raw_convert<string> (y_offset())
-               + "_" + raw_convert<string> (line_spacing())
-               + "_" + raw_convert<string> (fade_in().get_value_or(ContentTime()).get())
-               + "_" + raw_convert<string> (fade_out().get_value_or(ContentTime()).get())
-               + "_" + raw_convert<string> (outline_width())
-               + "_" + raw_convert<string> (colour().get_value_or(dcp::Colour(255, 255, 255)).to_argb_string())
-               + "_" + raw_convert<string> (dcp::effect_to_string(effect().get_value_or(dcp::Effect::NONE)))
-               + "_" + raw_convert<string> (effect_colour().get_value_or(dcp::Colour(0, 0, 0)).to_argb_string())
-               + "_" + raw_convert<string> (_parent->video_frame_rate().get_value_or(0));
+       auto s = fmt::to_string(x_scale())
+               + "_" + fmt::to_string(y_scale())
+               + "_" + fmt::to_string(x_offset())
+               + "_" + fmt::to_string(y_offset())
+               + "_" + fmt::to_string(line_spacing())
+               + "_" + fmt::to_string(fade_in().get_value_or(ContentTime()).get())
+               + "_" + fmt::to_string(fade_out().get_value_or(ContentTime()).get())
+               + "_" + fmt::to_string(outline_width())
+               + "_" + fmt::to_string(colour().get_value_or(dcp::Colour(255, 255, 255)).to_argb_string())
+               + "_" + fmt::to_string(dcp::effect_to_string(effect().get_value_or(dcp::Effect::NONE)))
+               + "_" + fmt::to_string(effect_colour().get_value_or(dcp::Colour(0, 0, 0)).to_argb_string())
+               + "_" + fmt::to_string(_parent->video_frame_rate().get_value_or(0));
 
        /* XXX: I suppose really _fonts shouldn't be in here, since not all
           types of subtitle content involve fonts.
index fde4ce15e5d6991ebdfc518719bd3c496d3d6f44..14839d80d4d06a5f4a5e70e828ff1abe0702d6a5 100644 (file)
@@ -78,6 +78,7 @@ LIBDCP_ENABLE_WARNINGS
 #include <unicode/unistr.h>
 #include <unicode/translit.h>
 #include <unicode/brkiter.h>
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/range/algorithm/replace_if.hpp>
 #include <boost/thread.hpp>
@@ -612,7 +613,7 @@ string
 simple_digest (vector<boost::filesystem::path> paths)
 {
        DCP_ASSERT(!paths.empty());
-       return digest_head_tail(paths, 1000000) + raw_convert<string>(dcp::filesystem::file_size(paths.front()));
+       return digest_head_tail(paths, 1000000) + fmt::to_string(dcp::filesystem::file_size(paths.front()));
 }
 
 
@@ -744,8 +745,8 @@ asset_filename (shared_ptr<dcp::Asset> asset, string type, int reel_index, int r
 {
        dcp::NameFormat::Map values;
        values['t'] = type;
-       values['r'] = raw_convert<string>(reel_index + 1);
-       values['n'] = raw_convert<string>(reel_count);
+       values['r'] = fmt::to_string(reel_index + 1);
+       values['n'] = fmt::to_string(reel_count);
        if (summary) {
                values['c'] = summary.get();
        }
index 058bb4ea261ec051673965d6f1476cde818efa77..6177ba7fe314a1c7e1a7711f5547651d24e32e25 100644 (file)
@@ -32,9 +32,9 @@
 #include "util.h"
 #include "video_content.h"
 #include "video_examiner.h"
-#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
+#include <fmt/format.h>
 #include <iomanip>
 #include <iostream>
 
@@ -68,7 +68,6 @@ using std::shared_ptr;
 using std::string;
 using std::vector;
 using boost::optional;
-using dcp::raw_convert;
 using namespace dcpomatic;
 
 
@@ -279,29 +278,29 @@ VideoContent::as_xml(xmlpp::Element* element) const
 {
        boost::mutex::scoped_lock lm (_mutex);
        cxml::add_text_child(element, "Use", _use ? "1" : "0");
-       cxml::add_text_child(element, "VideoLength", raw_convert<string>(_length));
+       cxml::add_text_child(element, "VideoLength", fmt::to_string(_length));
        if (_size) {
-               cxml::add_text_child(element, "VideoWidth", raw_convert<string>(_size->width));
-               cxml::add_text_child(element, "VideoHeight", raw_convert<string>(_size->height));
+               cxml::add_text_child(element, "VideoWidth", fmt::to_string(_size->width));
+               cxml::add_text_child(element, "VideoHeight", fmt::to_string(_size->height));
        }
        cxml::add_text_child(element, "VideoFrameType", video_frame_type_to_string(_frame_type));
        if (_sample_aspect_ratio) {
-               cxml::add_text_child(element, "SampleAspectRatio", raw_convert<string> (_sample_aspect_ratio.get ()));
+               cxml::add_text_child(element, "SampleAspectRatio", fmt::to_string(_sample_aspect_ratio.get()));
        }
        _crop.as_xml(element);
        if (_custom_ratio) {
-               cxml::add_text_child(element, "CustomRatio", raw_convert<string>(*_custom_ratio));
+               cxml::add_text_child(element, "CustomRatio", fmt::to_string(*_custom_ratio));
        }
        if (_custom_size) {
-               cxml::add_text_child(element, "CustomWidth", raw_convert<string>(_custom_size->width));
-               cxml::add_text_child(element, "CustomHeight", raw_convert<string>(_custom_size->height));
+               cxml::add_text_child(element, "CustomWidth", fmt::to_string(_custom_size->width));
+               cxml::add_text_child(element, "CustomHeight", fmt::to_string(_custom_size->height));
        }
        if (_colour_conversion) {
                _colour_conversion.get().as_xml(cxml::add_child(element, "ColourConversion"));
        }
        cxml::add_text_child(element, "YUV", _yuv ? "1" : "0");
-       cxml::add_text_child(element, "VideoFadeIn", raw_convert<string>(_fade_in));
-       cxml::add_text_child(element, "VideoFadeOut", raw_convert<string>(_fade_out));
+       cxml::add_text_child(element, "VideoFadeIn", fmt::to_string(_fade_in));
+       cxml::add_text_child(element, "VideoFadeOut", fmt::to_string(_fade_out));
        cxml::add_text_child(element, "Range", _range == VideoRange::FULL ? "full" : "video");
        _pixel_quanta.as_xml(cxml::add_child(element, "PixelQuanta"));
        if (_burnt_subtitle_language) {
index e80bfc333f532cdd98da58993a57b12cf294ca79..3d9d571af7712055e59c85ec84a216cbdbddbae7 100644 (file)
 #include "lib/video_content.h"
 #include <dcp/exceptions.h>
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
 #include <dcp/scope_guard.h>
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
@@ -117,6 +116,7 @@ LIBDCP_ENABLE_WARNINGS
 #ifdef __WXMSW__
 #include <shellapi.h>
 #endif
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/filesystem.hpp>
 #include <iostream>
@@ -147,7 +147,6 @@ using boost::algorithm::find;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
-using dcp::raw_convert;
 
 
 class FilmChangedClosingDialog
@@ -902,7 +901,7 @@ private:
                        try {
                                boost::asio::io_service io_service;
                                boost::asio::ip::tcp::resolver resolver (io_service);
-                               boost::asio::ip::tcp::resolver::query query ("127.0.0.1", raw_convert<string> (port));
+                               boost::asio::ip::tcp::resolver::query query("127.0.0.1", fmt::to_string(port));
                                boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
                                Socket socket (5);
                                socket.connect (*endpoint_iterator);
index 19d23c6cc47d277b5cea6f4ade4215c6cecdab49..17ee0fb21dc64ee0bd435eee35907637c72c3f48 100644 (file)
@@ -31,7 +31,7 @@
 #include "lib/util.h"
 #include <dcp/file.h>
 #include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
 
 
 using std::function;
@@ -982,7 +982,7 @@ SoundPage::config_changed ()
 
        vector<NamedChannel> output;
        for (int i = 0; i < channels; ++i) {
-               output.push_back (NamedChannel(dcp::raw_convert<string>(i), i));
+               output.push_back(NamedChannel(fmt::to_string(i), i));
        }
        _map->set_output_channels (output);
 
index 22899ddc9ba49bd07f40f8d1acb12229b7d47ea1..1116e9d87f45f0d9e9356b672c958c42ff1d745a 100644 (file)
@@ -30,6 +30,7 @@
 LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/signals2.hpp>
 
 
@@ -79,10 +80,10 @@ public:
        {
                auto const hmsf = t.split (fps);
 
-               checked_set (_hours, dcp::raw_convert<std::string>(hmsf.h));
-               checked_set (_minutes, dcp::raw_convert<std::string>(hmsf.m));
-               checked_set (_seconds, dcp::raw_convert<std::string>(hmsf.s));
-               checked_set (_frames, dcp::raw_convert<std::string>(hmsf.f));
+               checked_set(_hours, fmt::to_string(hmsf.h));
+               checked_set(_minutes, fmt::to_string(hmsf.m));
+               checked_set(_seconds, fmt::to_string(hmsf.s));
+               checked_set(_frames, fmt::to_string(hmsf.f));
 
                checked_set (_fixed, t.timecode (fps));
        }
@@ -91,10 +92,10 @@ public:
        {
                auto hmsf = t.split (fps);
 
-               _hours->SetHint (std_to_wx(dcp::raw_convert<std::string>(hmsf.h)));
-               _minutes->SetHint (std_to_wx(dcp::raw_convert<std::string>(hmsf.m)));
-               _seconds->SetHint (std_to_wx(dcp::raw_convert<std::string>(hmsf.s)));
-               _frames->SetHint (std_to_wx(dcp::raw_convert<std::string>(hmsf.f)));
+               _hours->SetHint(std_to_wx(fmt::to_string(hmsf.h)));
+               _minutes->SetHint(std_to_wx(fmt::to_string(hmsf.m)));
+               _seconds->SetHint(std_to_wx(fmt::to_string(hmsf.s)));
+               _frames->SetHint(std_to_wx(fmt::to_string(hmsf.f)));
        }
 
        void set_maximum(dcpomatic::HMSF maximum)
index d6232f984e287dc824471fc3fbc463c9b8fc82c1..36905bf13fa7ed78bacd72899548b59ffb6847ce 100644 (file)
@@ -24,7 +24,6 @@
 #include "verify_dcp_result_panel.h"
 #include "wx_util.h"
 #include "lib/verify_dcp_job.h"
-#include <dcp/raw_convert.h>
 #include <dcp/verify.h>
 #include <dcp/verify_report.h>
 #include <dcp/warnings.h>
@@ -32,6 +31,7 @@ LIBDCP_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
 #include <wx/notebook.h>
 LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
 #include <boost/algorithm/string.hpp>
 
 
@@ -111,7 +111,7 @@ VerifyDCPResultPanel::fill(shared_ptr<VerifyDCPJob> job)
                        message.Replace(char_to_wx("%calculated_hash"), std_to_wx(note.calculated_hash().get()));
                }
                if (note.frame()) {
-                       message.Replace(char_to_wx("%frame"), std_to_wx(dcp::raw_convert<string>(note.frame().get())));
+                       message.Replace(char_to_wx("%frame"), std_to_wx(fmt::to_string(note.frame().get())));
                        message.Replace(
                                char_to_wx("%timecode"),
                                std_to_wx(
@@ -125,13 +125,13 @@ VerifyDCPResultPanel::fill(shared_ptr<VerifyDCPJob> job)
                        message.Replace(char_to_wx("%f"), std_to_wx(note.file()->filename().string()));
                }
                if (note.line()) {
-                       message.Replace(char_to_wx("%l"), std_to_wx(dcp::raw_convert<string>(note.line().get())));
+                       message.Replace(char_to_wx("%l"), std_to_wx(fmt::to_string(note.line().get())));
                }
                if (note.component()) {
-                       message.Replace(char_to_wx("%component"), std_to_wx(dcp::raw_convert<string>(note.component().get())));
+                       message.Replace(char_to_wx("%component"), std_to_wx(fmt::to_string(note.component().get())));
                }
                if (note.size()) {
-                       message.Replace(char_to_wx("%size"), std_to_wx(dcp::raw_convert<string>(note.size().get())));
+                       message.Replace(char_to_wx("%size"), std_to_wx(fmt::to_string(note.size().get())));
                }
                if (note.id()) {
                        message.Replace(char_to_wx("%id"), std_to_wx(note.id().get()));
index b3eccd98a8e27d879ec79d728263b31542b3e3be..5ab1880bfff36a805bd96203c61badaeb4568689 100644 (file)
@@ -30,8 +30,8 @@
 #include "lib/film.h"
 #include "lib/image_content.h"
 #include "lib/video_content.h"
-#include <dcp/raw_convert.h>
 #include <boost/test/unit_test.hpp>
+#include <fmt/format.h>
 
 
 using std::make_shared;
@@ -45,7 +45,7 @@ check (int target_bits_per_second)
 
        int const duration = 10;
 
-       string const name = "bandwidth_test_" + dcp::raw_convert<string> (target_bits_per_second);
+       string const name = "bandwidth_test_" + fmt::to_string(target_bits_per_second);
        auto content = make_shared<ImageContent>(TestPaths::private_data() / "prophet_frame.tiff");
        auto film = new_test_film(name, { content }, &cl);
        film->set_video_bit_rate(VideoEncoding::JPEG2000, target_bits_per_second);
index bcdbcd7246f7cde15ffac522d3824260f13f90cb..395e5f720a3f22622b27fd1df50ddac9c52d0d7a 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "lib/dcpomatic_socket.h"
 #include "lib/server.h"
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
 #include <boost/test/unit_test.hpp>
 #include <boost/thread.hpp>
 #include <cstring>
@@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE (socket_basic_test)
 
        boost::asio::io_service io_service;
        tcp::resolver resolver (io_service);
-       tcp::resolver::query query ("127.0.0.1", dcp::raw_convert<string>(TEST_SERVER_PORT));
+       tcp::resolver::query query("127.0.0.1", fmt::to_string(TEST_SERVER_PORT));
        tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
 
        auto socket = make_shared<Socket>();
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE (socket_digest_test1)
 
        boost::asio::io_service io_service;
        tcp::resolver resolver (io_service);
-       tcp::resolver::query query ("127.0.0.1", dcp::raw_convert<string>(TEST_SERVER_PORT));
+       tcp::resolver::query query("127.0.0.1", fmt::to_string(TEST_SERVER_PORT));
        tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
 
        shared_ptr<Socket> socket(new Socket);
@@ -178,7 +178,7 @@ BOOST_AUTO_TEST_CASE (socket_digest_test2)
 
        boost::asio::io_service io_service;
        tcp::resolver resolver (io_service);
-       tcp::resolver::query query ("127.0.0.1", dcp::raw_convert<string>(TEST_SERVER_PORT));
+       tcp::resolver::query query("127.0.0.1", fmt::to_string(TEST_SERVER_PORT));
        tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
 
        shared_ptr<Socket> socket(new Socket);
index a74cc097d0e1b8876454793cc21ee36a712cc634..caa3cb2fe28a2acc10da6c3ec960566f05236b8a 100644 (file)
@@ -30,7 +30,7 @@
 #include <dcp/reel.h>
 #include <dcp/interop_text_asset.h>
 #include <dcp/reel_text_asset.h>
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
 #include <boost/test/unit_test.hpp>
 
 
@@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test)
                if (i->main_subtitle()) {
                        auto ass = dynamic_pointer_cast<dcp::InteropTextAsset>(i->main_subtitle()->asset());
                        BOOST_REQUIRE (ass);
-                       BOOST_CHECK_EQUAL (ass->reel_number(), dcp::raw_convert<string>(n));
+                       BOOST_CHECK_EQUAL (ass->reel_number(), fmt::to_string(n));
                        ++n;
                }
        }
diff --git a/wscript b/wscript
index 09c93897e8ec2f8b11d37d4bbd5d92f871e622f4..448f390fc9ab93c10fee98c3db499cf300dcd685 100644 (file)
--- a/wscript
+++ b/wscript
@@ -129,7 +129,7 @@ def configure(conf):
                                        # getMessengerLogger() in the grok code triggers these warnings
                                        '-Wno-nonnull',
                                        '-Wno-error=deprecated',
-                                       # I tried and failed to ignore these with _Pragma
+                                       # I tried and failed to ignore this with _Pragma
                                        '-Wno-ignored-qualifiers',
                                        '-D_FILE_OFFSET_BITS=64',
                                        '-std=c++' + cpp_std])
@@ -165,6 +165,9 @@ def configure(conf):
             # gcc 7.5.0 on Ubuntu 18.04 and gcc 8.3.0 on Debian 10 do, but
             # I didn't manage to turn it back off again with a pragma
             conf.env.append_value('CXXFLAGS', ['-Wsuggest-override'])
+        # This comes from fmt due to (apparently) a GCC bug
+        # I also tried to turn this off with a _Pragma, but failed
+        conf.env.append_value('CXXFLAGS', ['-Wno-stringop-overflow'])
 
     if conf.options.enable_debug:
         conf.env.append_value('CXXFLAGS', ['-g', '-DDCPOMATIC_DEBUG', '-fno-omit-frame-pointer'])
@@ -389,7 +392,7 @@ def configure(conf):
         check_via_pkg_config(conf, 'libdcp-1.0', 'DCP', mandatory=True, static=True, minimum_version=libdcp_version)
         conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP]
         conf.env.STLIB_DCP = ['dcp-1.0', 'asdcp-dcpomatic', 'kumu-dcpomatic', 'openjp2']
-        conf.env.LIB_DCP = ['glibmm-2.4', 'ssl', 'crypto', 'bz2', 'xslt', 'xerces-c']
+        conf.env.LIB_DCP = ['glibmm-2.4', 'ssl', 'crypto', 'bz2', 'xslt', 'xerces-c', 'fmt']
     else:
         check_via_pkg_config(conf, 'libdcp-1.0', 'DCP', mandatory=True, static=False, minimum_version=libdcp_version)
         conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP]