raw_convert<string> is gone, so here we use fmt::{to_string,format} instead.
Other raw_converts now use fast_float.
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'))
#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>
using std::string;
-using dcp::raw_convert;
using boost::algorithm::trim;
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());
#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;
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());
}
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <boost/filesystem.hpp>
#include <stdint.h>
#include <cmath>
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");
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 ());
#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"
using std::string;
using std::vector;
using boost::optional;
-using dcp::raw_convert;
using namespace dcpomatic;
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");
}
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <boost/regex.hpp>
#include <iostream>
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)));
}
}
}
#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 ()
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]));
}
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <iostream>
#include "i18n.h"
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()));
}
}
#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>
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());
<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");
*/
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. */
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());
/* [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:
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 */
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. */
/* [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. */
/* [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. */
/* [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");
}
}
/* [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");
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",
/* [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");
{
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);
}
#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>
using std::vector;
using boost::optional;
using dcp::locale_convert;
-using dcp::raw_convert;
using namespace dcpomatic;
}
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()));
}
}
#include "ratio.h"
#include "variant.h"
#include <dcp/raw_convert.h>
+#include <fmt/format.h>
#include <iostream>
#include <string>
}
+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 (
#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)
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));
}
#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>
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);
}
#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;
string
dcpomatic::get_process_id ()
{
- return dcp::raw_convert<string>(getpid());
+ return fmt::to_string(getpid());
}
#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>
string
dcpomatic::get_process_id ()
{
- return dcp::raw_convert<string>(GetCurrentProcessId());
+ return fmt::to_string(GetCurrentProcessId());
}
#include <dcp/reel.h>
#include <dcp/scope_guard.h>
#include <libxml++/libxml++.h>
+#include <fmt/format.h>
#include <iterator>
#include <iostream>
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"));
}
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) {
}
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) {
#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"
using std::shared_ptr;
using std::string;
using boost::optional;
-using dcp::raw_convert;
using namespace dcpomatic;
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()));
}
#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>
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>
using std::shared_ptr;
using std::string;
using dcp::ArrayData;
-using dcp::raw_convert;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
{
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);
/* 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);
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);
}
#include "disk_writer_messages.h"
#include "nanomsg.h"
#include <dcp/raw_convert.h>
+#include <fmt/format.h>
using std::string;
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;
}
#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
using boost::optional;
using dcp::ArrayData;
using dcp::Size;
-using dcp::raw_convert;
EncodeServer::EncodeServer (bool verbose, int num_threads)
/* 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) {
#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>
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
-using dcp::raw_convert;
EncodeServerFinder* EncodeServerFinder::_instance = 0;
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 (...) {
#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;
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));
}
#include "fcpxml.h"
#include "fcpxml_content.h"
#include "text_content.h"
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
#include "i18n.h"
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()));
}
#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;
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()));
}
}
#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"
using std::shared_ptr;
using std::dynamic_pointer_cast;
using boost::optional;
-using dcp::raw_convert;
using namespace dcpomatic;
}
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));
}
}
#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" {
}
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <iostream>
#include "i18n.h"
using std::string;
using boost::optional;
using std::dynamic_pointer_cast;
-using dcp::raw_convert;
FFmpegImageProxy::FFmpegImageProxy (boost::filesystem::path path)
/* 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)) {
*/
-#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>
#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"))
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
#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>
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 */
{
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);
}
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);
}
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");
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"));
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);
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");
}
}
} else {
- version = dcp::raw_convert<string>(_version_number);
+ version = fmt::to_string(_version_number);
}
isdcf_name += "-" + version;
}
}
if (video_frame_rate() != 24) {
- isdcf_name += "-" + raw_convert<string>(video_frame_rate());
+ isdcf_name += "-" + fmt::to_string(video_frame_rate());
}
if (container()) {
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);
}
}
}
#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>
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)) + ", ";
}
}
#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>
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <iostream>
#include "i18n.h"
using std::string;
using boost::optional;
using dcp::ArrayData;
-using dcp::raw_convert;
/** Construct a J2KImageProxy from a JPEG2000 file */
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()));
}
#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>
using std::string;
using boost::asio::ip::tcp;
using boost::thread;
-using dcp::raw_convert;
#define MAX_LENGTH 512
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, ";
}
}
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";
#include "pixel_quanta.h"
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
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));
}
#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>
using std::weak_ptr;
using boost::optional;
using dcp::Data;
-using dcp::raw_convert;
using namespace dcpomatic;
{
_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));
}
}
#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>
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include "i18n.h"
using std::shared_ptr;
using std::string;
using boost::optional;
-using dcp::raw_convert;
RawImageProxy::RawImageProxy(shared_ptr<const Image> image)
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())));
}
#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>
#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"
#endif
using dcp::ArrayData;
using dcp::Data;
-using dcp::raw_convert;
using namespace dcpomatic;
} 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>();
#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;
{
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);
}
#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
#include <pangommconfig.h>
LIBDCP_ENABLE_WARNINGS
#include <pango/pangocairo.h>
+#include <fmt/format.h>
#include <boost/algorithm/string.hpp>
#include <iostream>
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;
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(), {});
LIBDCP_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
using std::string;
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:
#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>
using std::shared_ptr;
using std::string;
using boost::optional;
-using dcp::raw_convert;
using namespace dcpomatic;
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()));
}
#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;
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());
}
#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>
#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.
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>();
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>();
#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"
using std::string;
using std::vector;
using boost::optional;
-using dcp::raw_convert;
using namespace dcpomatic;
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) {
}
}
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"));
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.
#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>
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()));
}
{
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();
}
#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>
using std::string;
using std::vector;
using boost::optional;
-using dcp::raw_convert;
using namespace dcpomatic;
{
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) {
#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
#ifdef __WXMSW__
#include <shellapi.h>
#endif
+#include <fmt/format.h>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <iostream>
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
-using dcp::raw_convert;
class FilmChangedClosingDialog
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);
#include "lib/util.h"
#include <dcp/file.h>
#include <dcp/filesystem.h>
-#include <dcp/raw_convert.h>
+#include <fmt/format.h>
using std::function;
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);
LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <boost/signals2.hpp>
{
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));
}
{
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)
#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>
#include <wx/richtext/richtextctrl.h>
#include <wx/notebook.h>
LIBDCP_ENABLE_WARNINGS
+#include <fmt/format.h>
#include <boost/algorithm/string.hpp>
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(
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()));
#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;
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);
#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>
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>();
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);
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);
#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>
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;
}
}
# 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])
# 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'])
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]