#include "analyse_audio_job.h"
#include "audio_analysis.h"
-#include "compose.hpp"
#include "dcpomatic_log.h"
#include "film.h"
#include "filter.h"
#include "player.h"
#include "playlist.h"
#include "config.h"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
#include "analytics.h"
-#include "compose.hpp"
#include "exceptions.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
DCPOMATIC_DISABLE_WARNINGS
boost::bind(
boost::ref(Message),
_("Congratulations!"),
- String::compose (_(
+ dcp::compose (_(
"<h2>You have made %1 DCPs with DCP-o-matic!</h2>"
"<img width=\"20%%\" src=\"memory:me.jpg\" align=\"center\">"
"<p>Hello. I'm Carl and I'm the "
#include "atmos_content.h"
#include "atmos_mxf_content.h"
-#include "compose.hpp"
#include "film.h"
#include "job.h"
#include <asdcp/KM_log.h>
#include <dcp/atmos_asset.h>
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
string
AtmosMXFContent::summary () const
{
- return String::compose (_("%1 [Atmos]"), path_summary());
+ return dcp::compose (_("%1 [Atmos]"), path_summary());
}
#include "audio_content.h"
-#include "compose.hpp"
#include "config.h"
#include "exceptions.h"
#include "film.h"
#include "frame_rate_change.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
{
string s = "audio: ";
for (auto i: streams()) {
- s += String::compose ("stream channels %1 rate %2 ", i->channels(), i->frame_rate());
+ s += dcp::compose ("stream channels %1 rate %2 ", i->channels(), i->frame_rate());
}
return s;
}
if (not_resampled && resampled) {
- return String::compose (_("Some audio will be resampled to %1Hz"), resampled_frame_rate(film));
+ return dcp::compose (_("Some audio will be resampled to %1Hz"), resampled_frame_rate(film));
}
if (!not_resampled && resampled) {
if (same) {
- return String::compose (_("Audio will be resampled from %1Hz to %2Hz"), common_frame_rate.get(), resampled_frame_rate(film));
+ return dcp::compose (_("Audio will be resampled from %1Hz to %2Hz"), common_frame_rate.get(), resampled_frame_rate(film));
} else {
- return String::compose (_("Audio will be resampled to %1Hz"), resampled_frame_rate(film));
+ return dcp::compose (_("Audio will be resampled to %1Hz"), resampled_frame_rate(film));
}
}
int stream = 1;
for (auto i: streams()) {
for (int j = 0; j < i->channels(); ++j) {
- n.push_back (NamedChannel(String::compose ("%1:%2", stream, j + 1), index++));
+ n.push_back (NamedChannel(dcp::compose ("%1:%2", stream, j + 1), index++));
}
++stream;
}
#include "dcpomatic_log.h"
#include "log.h"
#include "resampler.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
#include "audio_filter_graph.h"
#include "audio_buffers.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
extern "C" {
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
if (r < 0) {
char buffer[256];
av_strerror (r, buffer, sizeof(buffer));
- throw DecodeError (String::compose (N_("could not push buffer into filter chain (%1)"), &buffer[0]));
+ throw DecodeError (dcp::compose (N_("could not push buffer into filter chain (%1)"), &buffer[0]));
}
while (true) {
#include "log.h"
#include "dcpomatic_log.h"
#include "cross.h"
-#include "compose.hpp"
#include "exceptions.h"
#include "video_content.h"
+#include <dcp/compose.h>
using std::cout;
optional<DCPTime> pos = _audio.peek();
if (pos) {
throw ProgrammingError
- (__FILE__, __LINE__, String::compose ("Butler video buffers reached %1 frames (audio is %2 at %3)", _video.size(), _audio.size(), pos->get()));
+ (__FILE__, __LINE__, dcp::compose ("Butler video buffers reached %1 frames (audio is %2 at %3)", _video.size(), _audio.size(), pos->get()));
} else {
throw ProgrammingError
- (__FILE__, __LINE__, String::compose ("Butler video buffers reached %1 frames (audio is %2)", _video.size(), _audio.size()));
+ (__FILE__, __LINE__, dcp::compose ("Butler video buffers reached %1 frames (audio is %2)", _video.size(), _audio.size()));
}
}
optional<DCPTime> pos = _audio.peek();
if (pos) {
throw ProgrammingError
- (__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames at %2 (video is %3)", _audio.size(), pos->get(), _video.size()));
+ (__FILE__, __LINE__, dcp::compose ("Butler audio buffers reached %1 frames at %2 (video is %3)", _audio.size(), pos->get(), _video.size()));
} else {
throw ProgrammingError
- (__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames (video is %3)", _audio.size(), _video.size()));
+ (__FILE__, __LINE__, dcp::compose ("Butler audio buffers reached %1 frames (video is %3)", _audio.size(), _video.size()));
}
}
case Error::AGAIN:
return "Butler not ready";
case Error::DIED:
- return String::compose("Butler died (%1)", message);
+ return dcp::compose("Butler died (%1)", message);
case Error::FINISHED:
return "Butler finished";
}
#include "combine_dcp_job.h"
-#include "compose.hpp"
#include "config.h"
#include <dcp/combine.h>
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include "i18n.h"
dcp::combine (
_inputs,
_output,
- String::compose("libdcp %1", dcp::version),
- String::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
+ dcp::compose("libdcp %1", dcp::version),
dcp::LocalTime().as_string(),
_annotation_text,
Config::instance()->signer_chain()
+++ /dev/null
-/* -*- c-basic-offset: 2 -*-
- * Defines String::compose(fmt, arg...) for easy, i18n-friendly
- * composition of strings.
- *
- * Version 1.0.
- *
- * Copyright (c) 2002 Ole Laursen <olau@hardworking.dk>.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-//
-// Basic usage is like
-//
-// std::cout << String::compose("This is a %1x%2 matrix.", rows, cols);
-//
-// See http://www.cs.aau.dk/~olau/compose/ or the included README.compose for
-// more details.
-//
-
-#ifndef DCPOMATIC_STRING_COMPOSE_H
-#define DCPOMATIC_STRING_COMPOSE_H
-
-#include <dcp/locale_convert.h>
-#include <boost/filesystem.hpp>
-#include <string>
-#include <list>
-#include <map>
-#include <inttypes.h>
-#include <cstdio>
-
-namespace StringPrivate
-{
- // the actual composition class - using string::compose is cleaner, so we
- // hide it here
- class Composition
- {
- public:
- // initialize and prepare format string on the form "text %1 text %2 etc."
- explicit Composition(std::string fmt);
-
- // supply an replacement argument starting from %1
- template <typename T>
- Composition &arg(const T &obj);
-
- // compose and return string
- std::string str() const;
-
- private:
- std::string os;
- int arg_no;
-
- // we store the output as a list - when the output string is requested, the
- // list is concatenated to a string; this way we can keep iterators into
- // the list instead of into a string where they're possibly invalidated on
- // inserting a specification string
- typedef std::list<std::string> output_list;
- output_list output;
-
- // the initial parse of the format string fills in the specification map
- // with positions for each of the various %?s
- typedef std::multimap<int, output_list::iterator> specification_map;
- specification_map specs;
- };
-
- // helper for converting spec string numbers
- inline int char_to_int(char c)
- {
- switch (c) {
- case '0': return 0;
- case '1': return 1;
- case '2': return 2;
- case '3': return 3;
- case '4': return 4;
- case '5': return 5;
- case '6': return 6;
- case '7': return 7;
- case '8': return 8;
- case '9': return 9;
- default: return -1000;
- }
- }
-
- inline bool is_number(int n)
- {
- switch (n) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- return true;
-
- default:
- return false;
- }
- }
-
- // implementation of class Composition
- template <typename T>
- inline Composition &Composition::arg(const T &obj)
- {
- os += dcp::locale_convert<std::string>(obj);
-
- if (!os.empty()) { // manipulators don't produce output
- for (specification_map::const_iterator i = specs.lower_bound(arg_no), end = specs.upper_bound(arg_no); i != end; ++i) {
- output_list::iterator pos = i->second;
- ++pos;
-
- output.insert(pos, os);
- }
-
- os = "";
- ++arg_no;
- }
-
- return *this;
- }
-
- inline Composition::Composition(std::string fmt)
- : arg_no(1)
- {
- std::string::size_type b = 0, i = 0;
-
- // fill in output with the strings between the %1 %2 %3 etc. and
- // fill in specs with the positions
- while (i < fmt.length()) {
- if (fmt[i] == '%' && i + 1 < fmt.length()) {
- if (fmt[i + 1] == '%') { // catch %%
- fmt.replace(i, 2, "%");
- ++i;
- }
- else if (is_number(fmt[i + 1])) { // aha! a spec!
- // save string
- output.push_back(fmt.substr(b, i - b));
-
- int n = 1; // number of digits
- int spec_no = 0;
-
- do {
- spec_no += char_to_int(fmt[i + n]);
- spec_no *= 10;
- ++n;
- } while (i + n < fmt.length() && is_number(fmt[i + n]));
-
- spec_no /= 10;
- output_list::iterator pos = output.end();
- --pos; // safe since we have just inserted a string>
-
- specs.insert(specification_map::value_type(spec_no, pos));
-
- // jump over spec string
- i += n;
- b = i;
- }
- else
- ++i;
- }
- else
- ++i;
- }
-
- if (i - b > 0) // add the rest of the string
- output.push_back(fmt.substr(b, i - b));
- }
-
- inline std::string Composition::str() const
- {
- // assemble string
- std::string str;
-
- for (output_list::const_iterator i = output.begin(), end = output.end();
- i != end; ++i)
- str += *i;
-
- return str;
- }
-}
-
-// now for the real thing(s)
-namespace String
-{
- // a series of functions which accept a format string on the form "text %1
- // more %2 less %3" and a number of templated parameters and spits out the
- // composited string
- template <typename T1>
- inline std::string compose(const std::string &fmt, const T1 &o1)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1);
- return c.str();
- }
-
- template <typename T1, typename T2>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12,
- const T13 &o13)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12).arg(o13);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12,
- const T13 &o13, const T14 &o14)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14);
- return c.str();
- }
-
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14,
- typename T15>
- inline std::string compose(const std::string &fmt,
- const T1 &o1, const T2 &o2, const T3 &o3,
- const T4 &o4, const T5 &o5, const T6 &o6,
- const T7 &o7, const T8 &o8, const T9 &o9,
- const T10 &o10, const T11 &o11, const T12 &o12,
- const T13 &o13, const T14 &o14, const T15 &o15)
- {
- StringPrivate::Composition c(fmt);
- c.arg(o1).arg(o2).arg(o3).arg(o4).arg(o5).arg(o6).arg(o7).arg(o8).arg(o9)
- .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14).arg(o15);
- return c.str();
- }
-}
-
-
-#endif // STRING_COMPOSE_H
#include "cross.h"
#include "film.h"
#include "dkdm_wrapper.h"
-#include "compose.hpp"
#include "crypto.h"
#include "dkdm_recipient.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <dcp/name_format.h>
#include <dcp/certificate_chain.h>
/* Make a copy of the configuration */
try {
int n = 1;
- while (n < 100 && boost::filesystem::exists(path(String::compose("config.xml.%1", n)))) {
+ while (n < 100 && boost::filesystem::exists(path(dcp::compose("config.xml.%1", n)))) {
++n;
}
- boost::filesystem::copy_file(path("config.xml", false), path(String::compose("config.xml.%1", n), false));
- boost::filesystem::copy_file(path("cinemas.xml", false), path(String::compose("cinemas.xml.%1", n), false));
- boost::filesystem::copy_file(path("dkdm_recipients.xml", false), path(String::compose("dkdm_recipients.xml.%1", n), false));
+ boost::filesystem::copy_file(path("config.xml", false), path(dcp::compose("config.xml.%1", n), false));
+ boost::filesystem::copy_file(path("cinemas.xml", false), path(dcp::compose("cinemas.xml.%1", n), false));
+ boost::filesystem::copy_file(path("dkdm_recipients.xml", false), path(dcp::compose("dkdm_recipients.xml.%1", n), false));
} catch (...) {}
}
#include "exceptions.h"
#include "film.h"
#include "job.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <dcp/locale_convert.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
string
Content::technical_summary () const
{
- auto s = String::compose ("%1 %2 %3", path_summary(), digest(), position().seconds());
+ auto s = dcp::compose ("%1 %2 %3", path_summary(), digest(), position().seconds());
if (_video_frame_rate) {
- s += String::compose(" %1", *_video_frame_rate);
+ s += dcp::compose(" %1", *_video_frame_rate);
}
return s;
}
#include "log_entry.h"
#include "dcpomatic_log.h"
#include "log.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <libcxml/cxml.h>
#include <dcp/smpte_subtitle_asset.h>
#include <boost/algorithm/string.hpp>
#include "disk_writer_messages.h"
#include "copy_to_drive_job.h"
-#include "compose.hpp"
#include "exceptions.h"
#include "dcpomatic_log.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <nanomsg/nn.h>
#include <unistd.h>
string
CopyToDriveJob::name () const
{
- return String::compose (_("Copying %1\nto %2"), _dcp.filename().string(), _drive.description());
+ return dcp::compose (_("Copying %1\nto %2"), _dcp.filename().string(), _drive.description());
}
string
CopyToDriveJob::run ()
{
LOG_DISK("Sending write request to disk writer for %1 %2", _dcp.string(), _drive.device());
- if (!_nanomsg.send(String::compose(DISK_WRITER_WRITE "\n%1\n%2\n", _dcp.string(), _drive.device()), 2000)) {
+ if (!_nanomsg.send(dcp::compose(DISK_WRITER_WRITE "\n%1\n%2\n", _dcp.string(), _drive.device()), 2000)) {
LOG_DISK_NC("Failed to send write request.");
throw CommunicationFailedError ();
}
*/
-#include "compose.hpp"
#include "config.h"
#include "create_cli.h"
#include "dcp_content_type.h"
#include "ratio.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <iostream>
#include <string>
}
if ((n + 1) >= argc) {
- **error = String::compose("%1: option %2 requires an argument", argv[0], long_name);
+ **error = dcp::compose("%1: option %2 requires an argument", argv[0], long_name);
return;
}
} else if (a == "-h" || a == "--help") {
error = "Create a film directory (ready for making a DCP) or metadata file from some content files.\n"
"A film directory will be created if -o or --output is specified, otherwise a metadata file\n"
- "will be written to stdout.\n" + String::compose(_help, argv[0]);
+ "will be written to stdout.\n" + dcp::compose(_help, argv[0]);
return;
}
if (!claimed) {
if (a.length() > 2 && a.substr(0, 2) == "--") {
- error = String::compose("%1: unrecognised option '%2'", argv[0], a) + String::compose(_help, argv[0]);
+ error = dcp::compose("%1: unrecognised option '%2'", argv[0], a) + dcp::compose(_help, argv[0]);
return;
} else {
Content c;
dcp_content_type = DCPContentType::from_isdcf_name(dcp_content_type_string);
if (!dcp_content_type) {
- error = String::compose("%1: unrecognised DCP content type '%2'", argv[0], dcp_content_type_string);
+ error = dcp::compose("%1: unrecognised DCP content type '%2'", argv[0], dcp_content_type_string);
return;
}
if (!container_ratio_string.empty()) {
container_ratio = Ratio::from_id (container_ratio_string);
if (!container_ratio) {
- error = String::compose("%1: unrecognised container ratio %2", argv[0], container_ratio_string);
+ error = dcp::compose("%1: unrecognised container ratio %2", argv[0], container_ratio_string);
return;
}
}
if (standard_string != "SMPTE" && standard_string != "interop") {
- error = String::compose("%1: standard must be SMPTE or interop", argv[0]);
+ error = dcp::compose("%1: standard must be SMPTE or interop", argv[0]);
return;
}
}
if (content.empty()) {
- error = String::compose("%1: no content specified", argv[0]);
+ error = dcp::compose("%1: no content specified", argv[0]);
return;
}
}
if (j2k_bandwidth && (*j2k_bandwidth < 10000000 || *j2k_bandwidth > Config::instance()->maximum_j2k_bandwidth())) {
- error = String::compose("%1: j2k-bandwidth must be between 10 and %2 Mbit/s", argv[0], (Config::instance()->maximum_j2k_bandwidth() / 1000000));
+ error = dcp::compose("%1: j2k-bandwidth must be between 10 and %2 Mbit/s", argv[0], (Config::instance()->maximum_j2k_bandwidth() / 1000000));
return;
}
}
#include "cross.h"
-#include "compose.hpp"
#include "dcpomatic_log.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
name = _("Unknown");
}
- return String::compose(_("%1 (%2 GB) [%3]"), name, gb, _device);
+ return dcp::compose(_("%1 (%2 GB) [%3]"), name, gb, _device);
}
mp = mp.substr (0, mp.length() - 1);
}
- return String::compose(
+ return dcp::compose(
"Device %1 mounted on %2 size %3 vendor %4 model %5",
_device, mp, _size, _vendor.get_value_or("[none]"), _model.get_value_or("[none]")
);
*/
-#include "compose.hpp"
#include "config.h"
#include "cross.h"
#include "dcpomatic_log.h"
#include "exceptions.h"
#include "log.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <glib.h>
DCPOMATIC_DISABLE_WARNINGS
#include "cross.h"
-#include "compose.hpp"
#include "log.h"
#include "dcpomatic_log.h"
#include "config.h"
#include "exceptions.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <glib.h>
extern "C" {
#include "cross.h"
-#include "compose.hpp"
#include "log.h"
#include "dcpomatic_log.h"
#include "config.h"
#include "exceptions.h"
#include "dcpomatic_assert.h"
#include "util.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <glib.h>
extern "C" {
continue;
}
- string const physical_drive = String::compose("\\\\.\\PHYSICALDRIVE%1", *device_number);
+ string const physical_drive = dcp::compose("\\\\.\\PHYSICALDRIVE%1", *device_number);
HANDLE device = CreateFileA (
physical_drive.c_str(), 0,
{
LOG_DISK("Unmounting %1 with %2 mount points", _device, _mount_points.size());
DCPOMATIC_ASSERT (_mount_points.size() == 1);
- string const device_name = String::compose ("\\\\.\\%1", _mount_points.front());
+ string const device_name = dcp::compose ("\\\\.\\%1", _mount_points.front());
string const truncated = device_name.substr (0, device_name.length() - 1);
//LOG_DISK("Actually opening %1", _device);
//HANDLE device = CreateFileA (_device.c_str(), (GENERIC_READ | GENERIC_WRITE), FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
#include "exceptions.h"
#include "config.h"
#include "cross.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
curl_easy_setopt (
_curl, CURLOPT_URL,
/* Use generic_string so that we get forward-slashes in the path, even on Windows */
- String::compose ("ftp://%1/%2/%3", Config::instance()->tms_ip(), Config::instance()->tms_path(), to.generic_string ()).c_str ()
+ dcp::compose ("ftp://%1/%2/%3", Config::instance()->tms_ip(), Config::instance()->tms_path(), to.generic_string ()).c_str ()
);
_file = fopen_boost (from, "rb");
if (!_file) {
- throw NetworkError (String::compose (_("Could not open %1 to send"), from));
+ throw NetworkError (dcp::compose (_("Could not open %1 to send"), from));
}
_transferred = &transferred;
_total_size = total_size;
auto const r = curl_easy_perform (_curl);
if (r != CURLE_OK) {
- throw NetworkError (String::compose (_("Could not write to remote file (%1)"), curl_easy_strerror (r)));
+ throw NetworkError (dcp::compose (_("Could not write to remote file (%1)"), curl_easy_strerror (r)));
}
fclose (_file);
*/
-#include "compose.hpp"
#include "dcp.h"
#include "dcp_content.h"
#include "dcpomatic_log.h"
#include "log.h"
#include "util.h"
+#include <dcp/compose.h>
#include <dcp/dcp.h>
#include <dcp/decrypted_kdm.h>
#include <dcp/exceptions.h>
#include "film.h"
#include "config.h"
#include "overlaps.h"
-#include "compose.hpp"
#include "dcp_decoder.h"
#include "log.h"
#include "dcpomatic_log.h"
#include "text_content.h"
+#include <dcp/compose.h>
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
DCPContent::summary () const
{
boost::mutex::scoped_lock lm (_mutex);
- return String::compose (_("%1 [DCP]"), _name);
+ return dcp::compose (_("%1 [DCP]"), _name);
}
string
#include "player.h"
#include "job.h"
#include "writer.h"
-#include "compose.hpp"
#include "referenced_reel_asset.h"
#include "text_content.h"
#include "player_video.h"
+#include <dcp/compose.h>
#include <boost/signals2.hpp>
#include <iostream>
#include "dcp_subtitle.h"
#include "exceptions.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <dcp/interop_subtitle_asset.h>
#include <dcp/smpte_subtitle_asset.h>
}
if (!sc) {
- throw FileError(String::compose(_("Could not read subtitles (%1 / %2)"), interop_error, smpte_error), file);
+ throw FileError(dcp::compose(_("Could not read subtitles (%1 / %2)"), interop_error, smpte_error), file);
}
return sc;
#include "dcp_text_track.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <string>
#include "i18n.h"
string
DCPTextTrack::summary () const
{
- return String::compose("%1 (%2)", name, language ? language->to_string() : _("Unknown"));
+ return dcp::compose("%1 (%2)", name, language ? language->to_string() : _("Unknown"));
}
void
*/
-#include "compose.hpp"
#include "config.h"
#include "cross.h"
#include "dcp_video.h"
#include "rng.h"
#include "warnings.h"
#include <libcxml/cxml.h>
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <dcp/openjpeg_image.h>
#include <dcp/rgb_xyz.h>
#include "log.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
/** The current log; set up by the front-ends when they have a Film to log into */
extern std::shared_ptr<Log> dcpomatic_log;
-#define LOG_GENERAL(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
#define LOG_GENERAL_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_ERROR);
+#define LOG_ERROR(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_ERROR);
#define LOG_ERROR_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_ERROR);
-#define LOG_WARNING(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_WARNING);
+#define LOG_WARNING(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_WARNING);
#define LOG_WARNING_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_TIMING(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_DEBUG_ENCODE(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-#define LOG_DEBUG_VIDEO_VIEW(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_VIDEO_VIEW);
-#define LOG_DEBUG_THREE_D(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_THREE_D);
+#define LOG_TIMING(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_TIMING);
+#define LOG_DEBUG_ENCODE(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
+#define LOG_DEBUG_VIDEO_VIEW(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_VIDEO_VIEW);
+#define LOG_DEBUG_THREE_D(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_THREE_D);
#define LOG_DEBUG_THREE_D_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DEBUG_THREE_D);
-#define LOG_DISK(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DISK);
+#define LOG_DISK(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_DISK);
#define LOG_DISK_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DISK);
-#define LOG_DEBUG_PLAYER(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_PLAYER);
+#define LOG_DEBUG_PLAYER(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_PLAYER);
#define LOG_DEBUG_PLAYER_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DEBUG_PLAYER);
-#define LOG_DEBUG_AUDIO_ANALYSIS(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_AUDIO_ANALYSIS);
+#define LOG_DEBUG_AUDIO_ANALYSIS(...) dcpomatic_log->log(dcp::compose(__VA_ARGS__), LogEntry::TYPE_DEBUG_AUDIO_ANALYSIS);
#define LOG_DEBUG_AUDIO_ANALYSIS_NC(...) dcpomatic_log->log(__VA_ARGS__, LogEntry::TYPE_DEBUG_AUDIO_ANALYSIS);
*/
#include "dcpomatic_socket.h"
-#include "compose.hpp"
#include "exceptions.h"
#include "dcpomatic_assert.h"
+#include <dcp/compose.h>
#include <boost/bind/bind.hpp>
#include <boost/lambda/lambda.hpp>
#include <iostream>
} while (ec == boost::asio::error::would_block);
if (ec) {
- throw NetworkError (String::compose (_("error during async_connect (%1)"), ec.value ()));
+ throw NetworkError (dcp::compose (_("error during async_connect (%1)"), ec.value ()));
}
if (!_socket.is_open ()) {
} while (ec == boost::asio::error::would_block);
if (ec) {
- throw NetworkError (String::compose (_("error during async_write (%1)"), ec.value ()));
+ throw NetworkError (dcp::compose (_("error during async_write (%1)"), ec.value ()));
}
if (_write_digester) {
} while (ec == boost::asio::error::would_block);
if (ec) {
- throw NetworkError (String::compose (_("error during async_read (%1)"), ec.value ()));
+ throw NetworkError (dcp::compose (_("error during async_read (%1)"), ec.value ()));
}
if (_read_digester) {
*/
-#include "compose.hpp"
#include "dkdm_wrapper.h"
#include "dcpomatic_assert.h"
#include "warnings.h"
+#include <dcp/compose.h>
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
string
DKDM::name () const
{
- return String::compose ("%1 (%2)", _dkdm.content_title_text(), _dkdm.cpl_id());
+ return dcp::compose ("%1 (%2)", _dkdm.content_title_text(), _dkdm.cpl_id());
}
*/
-#include "compose.hpp"
#include "config.h"
#include "emailer.h"
#include "exceptions.h"
+#include <dcp/compose.h>
#include <curl/curl.h>
#include <boost/algorithm/string.hpp>
#include <boost/date_time/c_local_time_adjustor.hpp>
if ((protocol == EmailProtocol::AUTO && port == 465) || protocol == EmailProtocol::SSL) {
/* "SSL" or "Implicit TLS"; I think curl wants us to use smtps here */
- curl_easy_setopt (curl, CURLOPT_URL, String::compose("smtps://%1:%2", server, port).c_str());
+ curl_easy_setopt (curl, CURLOPT_URL, dcp::compose("smtps://%1:%2", server, port).c_str());
} else {
- curl_easy_setopt (curl, CURLOPT_URL, String::compose("smtp://%1:%2", server, port).c_str());
+ curl_easy_setopt (curl, CURLOPT_URL, dcp::compose("smtp://%1:%2", server, port).c_str());
}
if (!user.empty ()) {
#include "config.h"
#include "cross.h"
#include "player_video.h"
-#include "compose.hpp"
#include "log.h"
#include "dcpomatic_log.h"
#include "encoded_log_entry.h"
#include "version.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
DCPOMATIC_DISABLE_WARNINGS
*/
-#include "compose.hpp"
#include "cross.h"
#include "log.h"
#include "version.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/version.h>
#include <libssh/libssh.h>
DCPOMATIC_DISABLE_WARNINGS
{
list<string> info;
- info.push_back (String::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary()));
+ info.push_back (dcp::compose ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary()));
{
char buffer[128];
gethostname (buffer, sizeof (buffer));
- info.push_back (String::compose ("Host name %1", &buffer[0]));
+ info.push_back (dcp::compose ("Host name %1", &buffer[0]));
}
#ifdef DCPOMATIC_DEBUG
os_info.dwOSVersionInfoSize = sizeof (os_info);
GetVersionEx (&os_info);
info.push_back (
- String::compose (
+ dcp::compose (
"Windows version %1.%2.%3",
(int) os_info.dwMajorVersion, (int) os_info.dwMinorVersion, (int) os_info.dwBuildNumber
)
#endif
#endif
- info.push_back (String::compose ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency()));
+ info.push_back (dcp::compose ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency()));
for (auto const& i: mount_info()) {
- info.push_back (String::compose("Mount: %1 %2", i.first, i.second));
+ info.push_back (dcp::compose("Mount: %1 %2", i.first, i.second));
}
return info;
#include "exceptions.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include "i18n.h"
/** @param f File that we were trying to open */
OpenFileError::OpenFileError (boost::filesystem::path f, int error, Mode mode)
: FileError (
- String::compose (
+ dcp::compose (
mode == READ_WRITE ? _("could not open file %1 for read/write (%2)") :
(mode == READ ? _("could not open file %1 for read (%2)") : _("could not open file %1 for write (%2)")),
f.string(),
FileNotFoundError::FileNotFoundError (boost::filesystem::path f)
- : runtime_error(String::compose("File %1 not found", f.string()))
+ : runtime_error(dcp::compose("File %1 not found", f.string()))
, _file (f)
{
ReadFileError::ReadFileError (boost::filesystem::path f, int e)
- : FileError (String::compose(_("could not read from file %1 (%2)"), f.string(), strerror(e)), f)
+ : FileError (dcp::compose(_("could not read from file %1 (%2)"), f.string(), strerror(e)), f)
{
}
WriteFileError::WriteFileError (boost::filesystem::path f, int e)
- : FileError (String::compose(_("could not write to file %1 (%2)"), f.string(), strerror(e)), f)
+ : FileError (dcp::compose(_("could not write to file %1 (%2)"), f.string(), strerror(e)), f)
{
}
MissingSettingError::MissingSettingError (string s)
- : SettingError (s, String::compose(_("Missing required setting %1"), s))
+ : SettingError (s, dcp::compose(_("Missing required setting %1"), s))
{
}
PixelFormatError::PixelFormatError (string o, AVPixelFormat f)
- : runtime_error (String::compose(_("Cannot handle pixel format %1 during %2"), (int) f, o))
+ : runtime_error (dcp::compose(_("Cannot handle pixel format %1 during %2"), (int) f, o))
{
}
TextSubtitleError::TextSubtitleError (string saw, string expecting, boost::filesystem::path f)
- : FileError (String::compose(_("Error in subtitle file: saw %1 while expecting %2"), saw.empty() ? "[nothing]" : saw, expecting), f)
+ : FileError (dcp::compose(_("Error in subtitle file: saw %1 while expecting %2"), saw.empty() ? "[nothing]" : saw, expecting), f)
{
}
InvalidSignerError::InvalidSignerError (string reason)
- : runtime_error (String::compose(_("The certificate chain for signing is invalid (%1)"), reason))
+ : runtime_error (dcp::compose(_("The certificate chain for signing is invalid (%1)"), reason))
{
}
ProgrammingError::ProgrammingError (string file, int line, string message)
- : runtime_error (String::compose(_("Programming error at %1:%2 %3"), file, line, message))
+ : runtime_error (dcp::compose(_("Programming error at %1:%2 %3"), file, line, message))
{
}
KDMError::KDMError (string s, string d)
- : runtime_error (String::compose("%1 (%2)", s, d))
+ : runtime_error (dcp::compose("%1 (%2)", s, d))
, _summary (s)
, _detail (d)
{
GLError::GLError (char const * last, int e)
- : runtime_error (String::compose("%1 failed %2", last, e))
+ : runtime_error (dcp::compose("%1 failed %2", last, e))
{
}
CopyError::CopyError (string m, optional<int> n)
- : runtime_error (String::compose("%1%2", m, n ? String::compose(" (%1)", *n) : ""))
+ : runtime_error (dcp::compose("%1%2", m, n ? dcp::compose(" (%1)", *n) : ""))
, _message (m)
, _number (n)
{
VerifyError::VerifyError (string m, int n)
- : runtime_error (String::compose("%1 (%2)", m, n))
+ : runtime_error (dcp::compose("%1 (%2)", m, n))
, _message (m)
, _number (n)
{
#define DCPOMATIC_EXCEPTIONS_H
-#include "compose.hpp"
+#include <dcp/compose.h>
extern "C" {
#include <libavutil/pixfmt.h>
}
{}
DecodeError (std::string function, std::string caller)
- : std::runtime_error (String::compose("%1 failed [%2]", function, caller))
+ : std::runtime_error (dcp::compose("%1 failed [%2]", function, caller))
{}
DecodeError (std::string function, std::string caller, int error)
- : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error))
+ : std::runtime_error (dcp::compose("%1 failed [%2] (%3)", function, caller, error))
{}
DecodeError (std::string function, std::string caller, boost::filesystem::path file)
- : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, file.string()))
+ : std::runtime_error (dcp::compose("%1 failed [%2] (%3)", function, caller, file.string()))
{}
DecodeError (std::string function, std::string caller, int error, boost::filesystem::path file)
- : std::runtime_error (String::compose("%1 failed [%2] (%3) (%4)", function, caller, error, file.string()))
+ : std::runtime_error (dcp::compose("%1 failed [%2] (%3) (%4)", function, caller, error, file.string()))
{}
};
{}
explicit EncodeError (std::string function, std::string caller)
- : std::runtime_error (String::compose("%1 failed [%2]", function, caller))
+ : std::runtime_error (dcp::compose("%1 failed [%2]", function, caller))
{}
explicit EncodeError (std::string function, std::string caller, int error)
- : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error))
+ : std::runtime_error (dcp::compose("%1 failed [%2] (%3)", function, caller, error))
{}
};
* @param f Name of the file that this exception concerns.
*/
FileError (std::string m, boost::filesystem::path f)
- : std::runtime_error (String::compose("%1 with %2", m, f.string()))
+ : std::runtime_error (dcp::compose("%1 with %2", m, f.string()))
, _file (f)
{}
*/
-#include "compose.hpp"
#include "cross.h"
#include "dcpomatic_log.h"
#include "digester.h"
#include "exceptions.h"
#include "ext.h"
#include "nanomsg.h"
+#include <dcp/compose.h>
#ifdef DCPOMATIC_LINUX
#include <linux/fs.h>
ext4_file out;
int r = ext4_fopen(&out, to.generic_string().c_str(), "wb");
if (r != EOK) {
- throw CopyError (String::compose("Failed to open file %1", to.generic_string()), r);
+ throw CopyError (dcp::compose("Failed to open file %1", to.generic_string()), r);
}
FILE* in = fopen_boost (from, "rb");
if (!in) {
ext4_fclose (&out);
- throw CopyError (String::compose("Failed to open file %1", from.string()), 0);
+ throw CopyError (dcp::compose("Failed to open file %1", from.string()), 0);
}
uint8_t* buffer = new uint8_t[block_size];
fclose (in);
ext4_fclose (&out);
delete[] buffer;
- throw CopyError (String::compose("Short read; expected %1 but read %2", this_time, read), 0);
+ throw CopyError (dcp::compose("Short read; expected %1 but read %2", this_time, read), 0);
}
digester.add (buffer, this_time);
fclose (in);
ext4_fclose (&out);
delete[] buffer;
- throw CopyError (String::compose("Short write; expected %1 but wrote %2", this_time, written), 0);
+ throw CopyError (dcp::compose("Short write; expected %1 but wrote %2", this_time, written), 0);
}
remaining -= this_time;
total_remaining -= this_time;
++progress_count;
if ((progress_count % progress_frequency) == 0 && nanomsg) {
- nanomsg->send(String::compose(DISK_WRITER_COPY_PROGRESS "\n%1\n", (1 - float(total_remaining) / total)), SHORT_TIMEOUT);
+ nanomsg->send(dcp::compose(DISK_WRITER_COPY_PROGRESS "\n%1\n", (1 - float(total_remaining) / total)), SHORT_TIMEOUT);
}
}
LOG_DISK("Opening %1 for read", to.generic_string());
int r = ext4_fopen(&in, to.generic_string().c_str(), "rb");
if (r != EOK) {
- throw VerifyError (String::compose("Failed to open file %1", to.generic_string()), r);
+ throw VerifyError (dcp::compose("Failed to open file %1", to.generic_string()), r);
}
LOG_DISK("Opened %1 for read", to.generic_string());
if (read != this_time) {
ext4_fclose (&in);
delete[] buffer;
- throw VerifyError (String::compose("Short read; expected %1 but read %2", this_time, read), 0);
+ throw VerifyError (dcp::compose("Short read; expected %1 but read %2", this_time, read), 0);
}
digester.add (buffer, this_time);
remaining -= this_time;
total_remaining -= this_time;
if (nanomsg) {
- nanomsg->send(String::compose(DISK_WRITER_VERIFY_PROGRESS "\n%1\n", (1 - float(total_remaining) / total)), SHORT_TIMEOUT);
+ nanomsg->send(dcp::compose(DISK_WRITER_VERIFY_PROGRESS "\n%1\n", (1 - float(total_remaining) / total)), SHORT_TIMEOUT);
}
}
if (is_directory(from)) {
int r = ext4_dir_mk (cr.generic_string().c_str());
if (r != EOK) {
- throw CopyError (String::compose("Failed to create directory %1", cr.generic_string()), r);
+ throw CopyError (dcp::compose("Failed to create directory %1", cr.generic_string()), r);
}
for (directory_iterator i = directory_iterator(from); i != directory_iterator(); ++i) {
format_progress (void* context, float progress)
{
if (context) {
- reinterpret_cast<Nanomsg*>(context)->send(String::compose(DISK_WRITER_FORMAT_PROGRESS "\n%1\n", progress), SHORT_TIMEOUT);
+ reinterpret_cast<Nanomsg*>(context)->send(dcp::compose(DISK_WRITER_FORMAT_PROGRESS "\n%1\n", progress), SHORT_TIMEOUT);
}
}
} catch (CopyError& e) {
LOG_DISK("CopyError (from write): %1 %2", e.message(), e.number().get_value_or(0));
if (nanomsg) {
- nanomsg->send(String::compose(DISK_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number().get_value_or(0)), LONG_TIMEOUT);
+ nanomsg->send(dcp::compose(DISK_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number().get_value_or(0)), LONG_TIMEOUT);
}
} catch (VerifyError& e) {
LOG_DISK("VerifyError (from write): %1 %2", e.message(), e.number());
if (nanomsg) {
- nanomsg->send(String::compose(DISK_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number()), LONG_TIMEOUT);
+ nanomsg->send(dcp::compose(DISK_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number()), LONG_TIMEOUT);
}
} catch (exception& e) {
LOG_DISK("Exception (from write): %1", e.what());
if (nanomsg) {
- nanomsg->send(String::compose(DISK_WRITER_ERROR "\n%1\n0\n", e.what()), LONG_TIMEOUT);
+ nanomsg->send(dcp::compose(DISK_WRITER_ERROR "\n%1\n0\n", e.what()), LONG_TIMEOUT);
}
}
#include "ffmpeg_subtitle_stream.h"
#include "ffmpeg_audio_stream.h"
#include "digester.h"
-#include "compose.hpp"
#include "config.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
extern "C" {
#include <libavcodec/avcodec.h>
av_log_format_line (ptr, level, fmt, vl, line, sizeof (line), &prefix);
string str (line);
boost::algorithm::trim (str);
- dcpomatic_log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL);
+ dcpomatic_log->log (dcp::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL);
}
throw DecodeError (N_("avcodec_open2"), N_("FFmpeg::setup_decoders"), r);
}
} else {
- dcpomatic_log->log (String::compose ("No codec found for stream %1", i), LogEntry::TYPE_WARNING);
+ dcpomatic_log->log (dcp::compose ("No codec found for stream %1", i), LogEntry::TYPE_WARNING);
}
}
}
#include "ffmpeg_examiner.h"
#include "ffmpeg_subtitle_stream.h"
#include "ffmpeg_audio_stream.h"
-#include "compose.hpp"
#include "job.h"
#include "util.h"
#include "filter.h"
#include "exceptions.h"
#include "frame_rate_change.h"
#include "text_content.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
if (f) {
_filters.push_back (f);
} else {
- notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content()));
+ notes.push_back (dcp::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content()));
}
}
FFmpegContent::summary () const
{
if (video && audio) {
- return String::compose (_("%1 [movie]"), path_summary());
+ return dcp::compose (_("%1 [movie]"), path_summary());
} else if (video) {
- return String::compose (_("%1 [video]"), path_summary());
+ return dcp::compose (_("%1 [video]"), path_summary());
} else if (audio) {
- return String::compose (_("%1 [audio]"), path_summary());
+ return dcp::compose (_("%1 [audio]"), path_summary());
}
return path_summary ();
s += " - " + audio->technical_summary ();
}
- return s + String::compose (
+ return s + dcp::compose (
"ffmpeg: audio %1 subtitle %2 filters %3", as, ss, filt
);
}
/// file is limited, so that not all possible values are valid.
p.push_back (
UserProperty (
- UserProperty::VIDEO, _("Colour range"), String::compose(_("Limited (%1-%2)"), lim_start, lim_end)
+ UserProperty::VIDEO, _("Colour range"), dcp::compose(_("Limited (%1-%2)"), lim_start, lim_end)
)
);
break;
case AVCOL_RANGE_JPEG:
/// TRANSLATORS: this means that the range of pixel values used in this
/// file is full, so that all possible pixel values are valid.
- p.push_back (UserProperty (UserProperty::VIDEO, _("Colour range"), String::compose (_("Full (0-%1)"), total)));
+ p.push_back (UserProperty (UserProperty::VIDEO, _("Colour range"), dcp::compose (_("Full (0-%1)"), total)));
break;
default:
DCPOMATIC_ASSERT (false);
#include "video_decoder.h"
#include "film.h"
#include "audio_decoder.h"
-#include "compose.hpp"
#include "text_content.h"
#include "audio_content.h"
#include "frame_interval_checker.h"
+#include <dcp/compose.h>
#include <dcp/subtitle_string.h>
#include <sub/ssa_reader.h>
#include <sub/subtitle.h>
break;
default:
- throw DecodeError (String::compose(_("Unrecognised audio sample format (%1)"), static_cast<int>(format)));
+ throw DecodeError (dcp::compose(_("Unrecognised audio sample format (%1)"), static_cast<int>(format)));
}
return audio;
#include "image.h"
#include "cross.h"
#include "butler.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
if (files > 1) {
/// TRANSLATORS: _reel%1 here is to be added to an export filename to indicate
/// which reel it is. Preserve the %1; it will be replaced with the reel number.
- filename = filename.string() + String::compose(_("_reel%1"), i + 1);
+ filename = filename.string() + dcp::compose(_("_reel%1"), i + 1);
}
file_encoders.push_back (
auto v = _butler->get_video (true, &e);
_butler->rethrow ();
if (!v.first) {
- throw DecodeError(String::compose("Error during decoding: %1", e.summary()));
+ throw DecodeError(dcp::compose("Error during decoding: %1", e.summary()));
}
auto fe = encoder->get (v.first->eyes());
if (fe) {
/// TRANSLATORS: L here is an abbreviation for "left", to indicate the left-eye part of a 3D export
_encoders[Eyes::LEFT] = make_shared<FFmpegFileEncoder>(
video_frame_size, video_frame_rate, audio_frame_rate, channels, format,
- audio_stream_per_channel, x264_crf, String::compose("%1_%2%3", output.string(), _("L"), extension)
+ audio_stream_per_channel, x264_crf, dcp::compose("%1_%2%3", output.string(), _("L"), extension)
);
/// TRANSLATORS: R here is an abbreviation for "right", to indicate the right-eye part of a 3D export
_encoders[Eyes::RIGHT] = make_shared<FFmpegFileEncoder>(
video_frame_size, video_frame_rate, audio_frame_rate, channels, format,
- audio_stream_per_channel, x264_crf, String::compose("%1_%2%3", output.string(), _("R"), extension)
+ audio_stream_per_channel, x264_crf, dcp::compose("%1_%2%3", output.string(), _("R"), extension)
);
} else {
_encoders[Eyes::BOTH] = make_shared<FFmpegFileEncoder>(
video_frame_size, video_frame_rate, audio_frame_rate, channels, format,
- audio_stream_per_channel, x264_crf, String::compose("%1%2", output.string(), extension)
+ audio_stream_per_channel, x264_crf, dcp::compose("%1%2", output.string(), extension)
);
}
}
#include "log.h"
#include "image.h"
#include "cross.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
{
_codec = avcodec_find_encoder_by_name (codec_name.c_str());
if (!_codec) {
- throw EncodeError (String::compose("avcodec_find_encoder_by_name failed for %1", codec_name));
+ throw EncodeError (dcp::compose("avcodec_find_encoder_by_name failed for %1", codec_name));
}
_codec_context = avcodec_alloc_context3 (_codec);
r = avio_open_boost (&_format_context->pb, _output, AVIO_FLAG_WRITE);
if (r < 0) {
- throw EncodeError (String::compose(_("Could not open output file %1 (%2)"), _output.string(), r));
+ throw EncodeError (dcp::compose(_("Could not open output file %1 (%2)"), _output.string(), r));
}
AVDictionary* options = nullptr;
{
_video_codec = avcodec_find_encoder_by_name (_video_codec_name.c_str());
if (!_video_codec) {
- throw EncodeError (String::compose("avcodec_find_encoder_by_name failed for %1", _video_codec_name));
+ throw EncodeError (dcp::compose("avcodec_find_encoder_by_name failed for %1", _video_codec_name));
}
_video_codec_context = avcodec_alloc_context3 (_video_codec);
*/
-#include "compose.hpp"
#include "cross.h"
#include "dcpomatic_socket.h"
#include "exceptions.h"
#include "image.h"
#include "util.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
DCPOMATIC_DISABLE_WARNINGS
extern "C" {
if (_path) {
throw OpenFileError (_path->string(), e, OpenFileError::READ);
} else {
- boost::throw_exception(DecodeError(String::compose(_("Could not decode image (%1)"), e)));
+ boost::throw_exception(DecodeError(dcp::compose(_("Could not decode image (%1)"), e)));
}
}
*/
-#include "compose.hpp"
#include "cross.h"
#include "dcpomatic_assert.h"
#include "exceptions.h"
#include "file_group.h"
+#include <dcp/compose.h>
#include <sndfile.h>
#include <cstdio>
}
if (ferror(_current_file)) {
- throw FileError (String::compose("fread error %1", errno), _paths[_current_path]);
+ throw FileError (dcp::compose("fread error %1", errno), _paths[_current_path]);
}
if (eof) {
#include "environment_info.h"
#include "audio_processor.h"
#include "digester.h"
-#include "compose.hpp"
#include "screen.h"
#include "audio_content.h"
#include "video_content.h"
#include "ffmpeg_subtitle_stream.h"
#include "font.h"
#include <libcxml/cxml.h>
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/certificate_chain.h>
#include <dcp/util.h>
throw runtime_error (_("This film was created with a newer version of DCP-o-matic, and it cannot be loaded into this version. Sorry!"));
} else if (_state_version < current_state_version) {
/* This is an older version; save a copy (if we haven't already) */
- auto const older = path->parent_path() / String::compose("metadata.%1.xml", _state_version);
+ auto const older = path->parent_path() / dcp::compose("metadata.%1.xml", _state_version);
if (!boost::filesystem::is_regular_file(older)) {
try {
boost::filesystem::copy_file(*path, older);
auto fl = _luminance->value_in_foot_lamberts();
char buffer[64];
snprintf (buffer, sizeof(buffer), "%.1f", fl);
- d += String::compose("-%1fl", buffer);
+ d += dcp::compose("-%1fl", buffer);
}
if (video_frame_rate() != 24) {
if (!ch.first && !ch.second) {
d += "_MOS";
} else if (ch.first) {
- d += String::compose("_%1%2", ch.first, ch.second);
+ d += dcp::compose("_%1%2", ch.first, ch.second);
}
if (audio_channels() > static_cast<int>(dcp::Channel::HI) && find(mapped.begin(), mapped.end(), static_cast<int>(dcp::Channel::HI)) != mapped.end()) {
#include "filter.h"
#include "exceptions.h"
#include "image.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
extern "C" {
#include <libavfilter/buffersrc.h>
#include <libavfilter/buffersink.h>
int e = avfilter_graph_config (_graph, 0);
if (e < 0) {
- throw DecodeError (String::compose(N_("could not configure filter graph (%1)"), e));
+ throw DecodeError (dcp::compose(N_("could not configure filter graph (%1)"), e));
}
}
#include "types.h"
#include "content.h"
#include "film.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <cmath>
#include "i18n.h"
} else if (repeat == 2) {
description = _("Each content frame will be doubled in the DCP.\n");
} else if (repeat > 2) {
- description = String::compose (_("Each content frame will be repeated %1 more times in the DCP.\n"), repeat - 1);
+ description = dcp::compose (_("Each content frame will be repeated %1 more times in the DCP.\n"), repeat - 1);
}
if (change_speed) {
#include "audio_analysis.h"
#include "audio_content.h"
#include "audio_processor.h"
-#include "compose.hpp"
#include "content.h"
#include "cross.h"
#include "dcp_content_type.h"
#include "util.h"
#include "video_content.h"
#include "writer.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/raw_convert.h>
#include <dcp/reel.h>
case 25:
{
/* You might want to go to 24 */
- string base = String::compose(_("You are set up for a DCP at a frame rate of %1 fps. This frame rate is not supported by all projectors. You may want to consider changing your frame rate to %2 fps."), 25, 24);
+ string base = dcp::compose(_("You are set up for a DCP at a frame rate of %1 fps. This frame rate is not supported by all projectors. You may want to consider changing your frame rate to %2 fps."), 25, 24);
if (f->interop()) {
base += " ";
base += _("If you do use 25fps you should change your DCP standard to SMPTE.");
case 50:
case 60:
/* You almost certainly want to go to half frame rate */
- hint (String::compose(_("You are set up for a DCP at a frame rate of %1 fps. This frame rate is not supported by all projectors. You are advised to change the DCP frame rate to %2 fps."), f->video_frame_rate(), f->video_frame_rate() / 2));
+ hint (dcp::compose(_("You are set up for a DCP at a frame rate of %1 fps. This frame rate is not supported by all projectors. You are advised to change the DCP frame rate to %2 fps."), f->video_frame_rate(), f->video_frame_rate() / 2));
break;
}
}
}
if (vob > 1) {
- hint (String::compose (_("You have %1 files that look like they are VOB files from DVD. You should join them to ensure smooth joins between the files."), vob));
+ hint (dcp::compose (_("You have %1 files that look like they are VOB files from DVD. You should join them to ensure smooth joins between the files."), vob));
}
}
ch = ch.substr (0, ch.length() - 2);
if (!ch.empty()) {
- hint(String::compose(
+ hint(dcp::compose(
_("Your audio level is very high (on %1). You should reduce the gain of your audio content."),
ch
)
if (!_long_ccap) {
_long_ccap = true;
hint (
- String::compose(
+ dcp::compose(
"At least one of your closed caption lines has more than %1 characters. "
"It is advisable to make each line %1 characters at most in length.",
MAX_CLOSED_CAPTION_LENGTH,
}
if (!_too_many_ccap_lines && lines > MAX_CLOSED_CAPTION_LINES) {
- hint (String::compose(_("Some of your closed captions span more than %1 lines, so they will be truncated."), MAX_CLOSED_CAPTION_LINES));
+ hint (dcp::compose(_("Some of your closed captions span more than %1 lines, so they will be truncated."), MAX_CLOSED_CAPTION_LINES));
_too_many_ccap_lines = true;
}
*/
-#include "compose.hpp"
#include "dcpomatic_socket.h"
#include "exceptions.h"
#include "image.h"
#include "timer.h"
#include "util.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/rgb_xyz.h>
#include <dcp/transfer_function.h>
DCPOMATIC_DISABLE_WARNINGS
void
Image::png_error (char const * message)
{
- throw EncodeError (String::compose ("Error during PNG write: %1", message));
+ throw EncodeError (dcp::compose ("Error during PNG write: %1", message));
}
dcp::ArrayData
#include "image_content.h"
#include "video_content.h"
#include "image_examiner.h"
-#include "compose.hpp"
#include "film.h"
#include "job.h"
#include "frame_rate_change.h"
#include "exceptions.h"
#include "image_filename_sorter.h"
+#include <dcp/compose.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <iostream>
#include "exceptions.h"
#include "config.h"
#include "cross.h"
-#include "compose.hpp"
#include "ffmpeg_image_proxy.h"
#include "image.h"
+#include <dcp/compose.h>
#include <dcp/openjpeg_image.h>
#include <dcp/exceptions.h>
#include <dcp/j2k_transcode.h>
_video_size = dcp::decompress_j2k (buffer, size, 0)->size ();
} catch (dcp::ReadError& e) {
delete[] buffer;
- throw DecodeError (String::compose (_("Could not decode JPEG2000 file %1 (%2)"), path, e.what ()));
+ throw DecodeError (dcp::compose (_("Could not decode JPEG2000 file %1 (%2)"), path, e.what ()));
}
delete[] buffer;
} else {
#include "scoped_temporary.h"
-#include "compose.hpp"
#include "exceptions.h"
#include "cross.h"
#include "util.h"
+#include <dcp/compose.h>
#include <curl/curl.h>
#include <zip.h>
#include <boost/optional.hpp>
temp.close ();
curl_easy_cleanup (curl);
if (cr != CURLE_OK) {
- return String::compose (_("Download failed (%1 error %2)"), url, (int) cr);
+ return dcp::compose (_("Download failed (%1 error %2)"), url, (int) cr);
}
return optional<string>();
zip_error_init (&error);
auto zip = zip_open_from_source (zip_source, ZIP_RDONLY, &error);
if (!zip) {
- return String::compose (_("Could not open downloaded ZIP file (%1:%2: %3)"), error.zip_err, error.sys_err, error.str ? error.str : "");
+ return dcp::compose (_("Could not open downloaded ZIP file (%1:%2: %3)"), error.zip_err, error.sys_err, error.str ? error.str : "");
}
#else
#include "player.h"
#include "player_video.h"
#include "encode_server_description.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <libcxml/cxml.h>
#include <iostream>
#include "film.h"
#include "log.h"
#include "dcpomatic_log.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <sub/exceptions.h>
#include <boost/thread.hpp>
void
Job::run_wrapper ()
{
- start_of_thread (String::compose("Job-%1", json_name()));
+ start_of_thread (dcp::compose("Job-%1", json_name()));
try {
} catch (dcp::FileError& e) {
- string m = String::compose (_("An error occurred whilst handling the file %1."), boost::filesystem::path (e.filename()).leaf());
+ string m = dcp::compose (_("An error occurred whilst handling the file %1."), boost::filesystem::path (e.filename()).leaf());
try {
auto const s = boost::filesystem::space (e.filename());
} catch (OpenFileError& e) {
set_error (
- String::compose (_("Could not open %1"), e.file().string()),
- String::compose (
+ dcp::compose (_("Could not open %1"), e.file().string()),
+ dcp::compose (
_("DCP-o-matic could not open the file %1 (%2). Perhaps it does not exist or is in an unexpected format."),
boost::filesystem::absolute (e.file()).string(),
e.what()
if (e.code() == boost::system::errc::no_such_file_or_directory) {
set_error (
- String::compose (_("Could not open %1"), e.path1().string ()),
- String::compose (
+ dcp::compose (_("Could not open %1"), e.path1().string ()),
+ dcp::compose (
_("DCP-o-matic could not open the file %1 (%2). Perhaps it does not exist or is in an unexpected format."),
boost::filesystem::absolute (e.path1()).string(),
e.what()
Job::set_error (string s, string d)
{
if (_film) {
- _film->log()->log (String::compose ("Error in job: %1 (%2)", s, d), LogEntry::TYPE_ERROR);
+ _film->log()->log (dcp::compose ("Error in job: %1 (%2)", s, d), LogEntry::TYPE_ERROR);
}
boost::mutex::scoped_lock lm (_state_mutex);
if (now.date() != finish.date()) {
/// TRANSLATORS: the %1 in this string will be filled in with a day of the week
/// to say what day a job will finish.
- day = String::compose (_(" on %1"), day_of_week_to_string(finish.date().day_of_week()));
+ day = dcp::compose (_(" on %1"), day_of_week_to_string(finish.date().day_of_week()));
}
/// TRANSLATORS: "remaining; finishing at" here follows an amount of time that is remaining
/// on an operation; after it is an estimated wall-clock completion time.
- s += String::compose(
+ s += dcp::compose(
_("; %1 remaining; finishing at %2%3"),
seconds_to_approximate_hms(r), finish_string, day
);
}
} else if (finished_ok ()) {
- s = String::compose (_("OK (ran for %1)"), seconds_to_hms (_ran_for));
+ s = dcp::compose (_("OK (ran for %1)"), seconds_to_hms (_ran_for));
} else if (finished_in_error ()) {
- s = String::compose (_("Error: %1"), error_summary ());
+ s = dcp::compose (_("Error: %1"), error_summary ());
} else if (finished_cancelled ()) {
s = _("Cancelled");
}
}
if (server) {
if ((_endpoint = nn_bind(_socket, NANOMSG_URL)) < 0) {
- throw runtime_error(String::compose("Could not bind nanomsg socket (%1)", errno));
+ throw runtime_error(dcp::compose("Could not bind nanomsg socket (%1)", errno));
}
} else {
if ((_endpoint = nn_connect(_socket, NANOMSG_URL)) < 0) {
- throw runtime_error(String::compose("Could not connect nanomsg socket (%1)", errno));
+ throw runtime_error(dcp::compose("Could not connect nanomsg socket (%1)", errno));
}
}
}
if (errno == ETIMEDOUT || errno == EAGAIN) {
return false;
}
- throw runtime_error(String::compose("Could not send to nanomsg socket (%1)", errno));
+ throw runtime_error(dcp::compose("Could not send to nanomsg socket (%1)", errno));
} else if (r != int(s.length())) {
throw runtime_error("Could not send to nanomsg socket (message too big)");
}
#include "audio_content.h"
#include "dcp_decoder.h"
#include "image_decoder.h"
-#include "compose.hpp"
#include "shuffler.h"
#include "timer.h"
+#include <dcp/compose.h>
#include <dcp/reel.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_subtitle_asset.h>
/* Let's not worry about less than a frame at 24fps */
int64_t const too_much_error = DCPTime::from_frames(1, 24).get();
if (error >= too_much_error) {
- _film->log()->log(String::compose("Silence starting before or after last audio by %1", error), LogEntry::TYPE_ERROR);
+ _film->log()->log(dcp::compose("Silence starting before or after last audio by %1", error), LogEntry::TYPE_ERROR);
}
DCPOMATIC_ASSERT (error < too_much_error);
period.from = *_last_audio_time;
{
/* Log if the assert below is about to fail */
if (_last_audio_time && labs(time.get() - _last_audio_time->get()) > 1) {
- _film->log()->log(String::compose("Out-of-sequence emit %1 vs %2", to_string(time), to_string(*_last_audio_time)), LogEntry::TYPE_WARNING);
+ _film->log()->log(dcp::compose("Out-of-sequence emit %1 vs %2", to_string(time), to_string(*_last_audio_time)), LogEntry::TYPE_WARNING);
}
/* This audio must follow on from the previous, allowing for half a sample (at 48kHz) leeway */
#include "config.h"
#include "util.h"
#include "digester.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/bind/placeholders.hpp>
string note = _("Your project contains video content that was not aligned to a frame boundary.");
note += " ";
if (old_pos < content->position()) {
- note += String::compose(
+ note += dcp::compose(
_("The file %1 has been moved %2 milliseconds later."),
content->path_summary(), DCPTime(content->position() - old_pos).seconds() * 1000
);
} else {
- note += String::compose(
+ note += dcp::compose(
_("The file %1 has been moved %2 milliseconds earlier."),
content->path_summary(), DCPTime(content->position() - old_pos).seconds() * 1000
);
string note = _("Your project contains video content whose trim was not aligned to a frame boundary.");
note += " ";
if (old_trim < content->trim_start()) {
- note += String::compose(
+ note += dcp::compose(
_("The file %1 has been trimmed by %2 milliseconds more."),
content->path_summary(), ContentTime(content->trim_start() - old_trim).seconds() * 1000
);
} else {
- note += String::compose(
+ note += dcp::compose(
_("The file %1 has been trimmed by %2 milliseconds less."),
content->path_summary(), ContentTime(old_trim - content->trim_start()).seconds() * 1000
);
#include "dcpomatic_log.h"
#include "digester.h"
#include "font_data.h"
-#include "compose.hpp"
#include "config.h"
#include "audio_buffers.h"
#include "image.h"
#include <dcp/atmos_asset.h>
#include <dcp/atmos_asset_writer.h>
#include <dcp/certificate_chain.h>
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/interop_subtitle_asset.h>
boost::filesystem::rename (film()->file(aaf), audio_to, ec);
if (ec) {
throw FileError (
- String::compose (_("could not move audio asset into the DCP (%1)"), ec.value ()), aaf
+ dcp::compose (_("could not move audio asset into the DCP (%1)"), ec.value ()), aaf
);
}
boost::filesystem::rename (film()->file(aaf), atmos_to, ec);
if (ec) {
throw FileError (
- String::compose (_("could not move atmos asset into the DCP (%1)"), ec.value ()), aaf
+ dcp::compose (_("could not move atmos asset into the DCP (%1)"), ec.value ()), aaf
);
}
if (!text_only && reel_asset->actual_duration() != period_duration) {
throw ProgrammingError (
__FILE__, __LINE__,
- String::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
+ dcp::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
);
}
reel->add (reel_asset);
if (reel_asset->duration() != period_duration) {
throw ProgrammingError (
__FILE__, __LINE__,
- String::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
+ dcp::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
);
}
reel->add (reel_asset);
if (reel_asset->actual_duration() != period_duration) {
throw ProgrammingError (
__FILE__, __LINE__,
- String::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
+ dcp::compose ("%1 vs %2", reel_asset->actual_duration(), period_duration)
);
}
#include "resampler.h"
#include "audio_buffers.h"
#include "exceptions.h"
-#include "compose.hpp"
#include "dcpomatic_assert.h"
+#include <dcp/compose.h>
#include <samplerate.h>
#include <iostream>
#include <cmath>
int error;
_src = src_new (SRC_SINC_BEST_QUALITY, _channels, &error);
if (!_src) {
- throw runtime_error (String::compose(N_("could not create sample-rate converter (%1)"), error));
+ throw runtime_error (dcp::compose(N_("could not create sample-rate converter (%1)"), error));
}
}
int error;
_src = src_new (SRC_LINEAR, _channels, &error);
if (!_src) {
- throw runtime_error (String::compose(N_("could not create sample-rate converter (%1)"), error));
+ throw runtime_error (dcp::compose(N_("could not create sample-rate converter (%1)"), error));
}
}
int const r = src_process (_src, &data);
if (r) {
throw EncodeError (
- String::compose (
+ dcp::compose (
N_("could not run sample-rate converter (%1) [processing %2 to %3, %4 channels]"),
src_strerror (r),
in_frames,
int const r = src_process (_src, &data);
if (r) {
- throw EncodeError (String::compose(N_("could not run sample-rate converter (%1)"), src_strerror(r)));
+ throw EncodeError (dcp::compose(N_("could not run sample-rate converter (%1)"), src_strerror(r)));
}
out->ensure_size (out_offset + data.output_frames_gen);
#include "job.h"
#include "config.h"
#include "cross.h"
-#include "compose.hpp"
#include "warnings.h"
+#include <dcp/compose.h>
#include <sys/stat.h>
#include "i18n.h"
{
_session = ssh_new ();
if (!_session) {
- throw NetworkError (String::compose(_("SSH error [%1]"), "ssh_new"));
+ throw NetworkError (dcp::compose(_("SSH error [%1]"), "ssh_new"));
}
ssh_options_set (_session, SSH_OPTIONS_HOST, Config::instance()->tms_ip().c_str());
int r = ssh_connect (_session);
if (r != SSH_OK) {
- throw NetworkError (String::compose(_("Could not connect to server %1 (%2)"), Config::instance()->tms_ip(), ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("Could not connect to server %1 (%2)"), Config::instance()->tms_ip(), ssh_get_error(_session)));
}
DCPOMATIC_DISABLE_WARNINGS
r = ssh_is_server_known (_session);
if (r == SSH_SERVER_ERROR) {
- throw NetworkError (String::compose(_("SSH error [%1] (%2)"), "ssh_is_server_known", ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("SSH error [%1] (%2)"), "ssh_is_server_known", ssh_get_error(_session)));
}
DCPOMATIC_ENABLE_WARNINGS
r = ssh_userauth_password (_session, 0, Config::instance()->tms_password().c_str ());
if (r != SSH_AUTH_SUCCESS) {
- throw NetworkError (String::compose(_("Failed to authenticate with server (%1)"), ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("Failed to authenticate with server (%1)"), ssh_get_error(_session)));
}
_scp = ssh_scp_new (_session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, Config::instance()->tms_path().c_str());
if (!_scp) {
- throw NetworkError (String::compose(_("SSH error [%1] (%2)"), "ssh_scp_new", ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("SSH error [%1] (%2)"), "ssh_scp_new", ssh_get_error(_session)));
}
r = ssh_scp_init (_scp);
if (r != SSH_OK) {
- throw NetworkError (String::compose(_("SSH error [%1] (%2)"), "ssh_scp_init", ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("SSH error [%1] (%2)"), "ssh_scp_init", ssh_get_error(_session)));
}
}
/* Use generic_string so that we get forward-slashes in the path, even on Windows */
int const r = ssh_scp_push_directory (_scp, directory.generic_string().c_str(), S_IRWXU);
if (r != SSH_OK) {
- throw NetworkError (String::compose(_("Could not create remote directory %1 (%2)"), directory, ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("Could not create remote directory %1 (%2)"), directory, ssh_get_error(_session)));
}
}
auto f = fopen_boost (from, "rb");
if (f == nullptr) {
- throw NetworkError (String::compose(_("Could not open %1 to send"), from));
+ throw NetworkError (dcp::compose(_("Could not open %1 to send"), from));
}
boost::uintmax_t buffer_size = 64 * 1024;
int const r = ssh_scp_write (_scp, buffer, t);
if (r != SSH_OK) {
fclose (f);
- throw NetworkError (String::compose(_("Could not write to remote file (%1)"), ssh_get_error(_session)));
+ throw NetworkError (dcp::compose(_("Could not write to remote file (%1)"), ssh_get_error(_session)));
}
to_do -= t;
transferred += t;
#include "send_kdm_email_job.h"
-#include "compose.hpp"
#include "kdm_with_metadata.h"
#include "film.h"
+#include <dcp/compose.h>
#include <list>
#include "i18n.h"
return _("Email KDMs");
}
- return String::compose (_("Email KDMs for %2"), *f);
+ return dcp::compose (_("Email KDMs for %2"), *f);
}
#include "exceptions.h"
#include "config.h"
#include "emailer.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <list>
#include "i18n.h"
#include "send_problem_report_job.h"
-#include "compose.hpp"
#include "film.h"
#include "cross.h"
#include "film.h"
#include "version.h"
#include "emailer.h"
#include "environment_info.h"
+#include <dcp/compose.h>
#include <libxml++/libxml++.h>
#include "i18n.h"
return _("Email problem report");
}
- return String::compose (_("Email problem report for %1"), _film->name());
+ return dcp::compose (_("Email problem report for %1"), _film->name());
}
);
if (!store_front_in_sequence) {
- string const store = _store.empty() ? "store empty" : String::compose("store front frame=%1 eyes=%2", _store.front().second.frame, static_cast<int>(_store.front().second.eyes));
- string const last = _last ? String::compose("last frame=%1 eyes=%2", _last->frame, static_cast<int>(_last->eyes)) : "no last";
+ string const store = _store.empty() ? "store empty" : dcp::compose("store front frame=%1 eyes=%2", _store.front().second.frame, static_cast<int>(_store.front().second.eyes));
+ string const last = _last ? dcp::compose("last frame=%1 eyes=%2", _last->frame, static_cast<int>(_last->eyes)) : "no last";
LOG_DEBUG_THREE_D("Shuffler not in sequence: %1 %2", store, last);
}
*/
-#include "compose.hpp"
#include "font_data.h"
#include "job.h"
#include "player.h"
#include "subtitle_encoder.h"
+#include <dcp/compose.h>
#include <dcp/interop_subtitle_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/smpte_subtitle_asset.h>
if (files > 1) {
/// TRANSLATORS: _reel%1 here is to be added to an export filename to indicate
/// which reel it is. Preserve the %1; it will be replaced with the reel number.
- filename /= String::compose("%1_reel%2", initial_name, i + 1);
+ filename /= dcp::compose("%1_reel%2", initial_name, i + 1);
} else {
filename /= initial_name;
}
#include "text_content.h"
#include "util.h"
#include "log.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <sub/subtitle.h>
#include <boost/algorithm/string.hpp>
#include <iostream>
*/
-#include "compose.hpp"
#include "timer.h"
#include "util.h"
+#include <dcp/compose.h>
#include <sys/time.h>
#include <iostream>
char buffer[64];
snprintf (buffer, 64, "%.4f", i.second.total_time);
string total_time (buffer);
- sorted.push_back (make_pair(i.second.total_time, String::compose("\t%1%2 %3 %4", name, total_time, i.second.number, (i.second.total_time / i.second.number))));
+ sorted.push_back (make_pair(i.second.total_time, dcp::compose("\t%1%2 %3 %4", name, total_time, i.second.number, (i.second.total_time / i.second.number))));
}
sorted.sort ([](pair<double, string> const& a, pair<double, string> const& b) {
#include "analytics.h"
-#include "compose.hpp"
#include "config.h"
#include "dcp_encoder.h"
#include "dcpomatic_log.h"
#include "log.h"
#include "transcode_job.h"
#include "upload_job.h"
+#include <dcp/compose.h>
#include <iomanip>
#include <iostream>
string
TranscodeJob::name () const
{
- return String::compose (_("Transcoding %1"), _film->name());
+ return dcp::compose (_("Transcoding %1"), _film->name());
}
*/
#include "types.h"
-#include "compose.hpp"
#include "dcpomatic_assert.h"
#include "warnings.h"
#include <dcp/raw_convert.h>
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/reel_file_asset.h>
} else if (s == "closed-caption") {
return TextType::CLOSED_CAPTION;
} else {
- throw MetadataError (String::compose ("Unknown text type %1", s));
+ throw MetadataError (dcp::compose ("Unknown text type %1", s));
}
}
*/
-#include "compose.hpp"
#include "config.h"
#include "curl_uploader.h"
#include "dcpomatic_log.h"
#include "log.h"
#include "scp_uploader.h"
#include "upload_job.h"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
#include "uploader.h"
#include "dcpomatic_assert.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include "i18n.h"
if (is_directory(i.path())) {
upload_directory (base, i.path(), transferred, total_size);
} else {
- _set_status (String::compose(_("copying %1"), i.path().leaf()));
+ _set_status (dcp::compose(_("copying %1"), i.path().leaf()));
upload_file (i.path(), remove_prefix (base, i.path()), transferred, total_size);
}
}
#include "digester.h"
#include "audio_processor.h"
#include "crypto.h"
-#include "compose.hpp"
#include "audio_buffers.h"
#include "string_text.h"
#include "font.h"
#include "text_decoder.h"
#include "job_manager.h"
#include "warnings.h"
+#include <dcp/compose.h>
#include <dcp/decrypted_kdm.h>
#include <dcp/locale_convert.h>
#include <dcp/util.h>
#ifdef DCPOMATIC_WINDOWS
putenv ("PANGOCAIRO_BACKEND=fontconfig");
- putenv (String::compose("FONTCONFIG_PATH=%1", resources_path().string()).c_str());
+ putenv (dcp::compose("FONTCONFIG_PATH=%1", resources_path().string()).c_str());
#endif
#ifdef DCPOMATIC_OSX
/* Override our environment language. Note that the caller must not
free the string passed into putenv().
*/
- string s = String::compose ("LANGUAGE=%1", lang);
+ string s = dcp::compose ("LANGUAGE=%1", lang);
putenv (strdup (s.c_str ()));
- s = String::compose ("LANG=%1", lang);
+ s = dcp::compose ("LANG=%1", lang);
putenv (strdup (s.c_str ()));
- s = String::compose ("LC_ALL=%1", lang);
+ s = dcp::compose ("LC_ALL=%1", lang);
putenv (strdup (s.c_str ()));
}
if (N != size) {
if (ferror(stream)) {
fclose (stream);
- throw FileError (String::compose("fwrite error %1", errno), path);
+ throw FileError (dcp::compose("fwrite error %1", errno), path);
} else {
fclose (stream);
throw FileError ("Unexpected short write", path);
if (N != size) {
if (ferror(stream)) {
fclose (stream);
- throw FileError (String::compose("fread error %1", errno), path);
+ throw FileError (dcp::compose("fread error %1", errno), path);
} else {
fclose (stream);
throw FileError ("Unexpected short read", path);
#include "video_content.h"
#include "content.h"
#include "video_examiner.h"
-#include "compose.hpp"
#include "ratio.h"
#include "config.h"
#include "colour_conversion.h"
#include "frame_rate_change.h"
#include "log.h"
#include "dcpomatic_log.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
string
VideoContent::technical_summary () const
{
- string s = String::compose (
+ string s = dcp::compose (
N_("video: length %1 frames, size %2x%3"),
length_after_3d_combine(),
size().width,
);
if (sample_aspect_ratio ()) {
- s += String::compose (N_(", sample aspect ratio %1"), (sample_aspect_ratio().get ()));
+ s += dcp::compose (N_(", sample aspect ratio %1"), (sample_aspect_ratio().get ()));
}
return s;
char buffer[256];
if (size().width && size().height) {
- d += String::compose (
+ d += dcp::compose (
_("Content video is %1x%2"),
size_after_3d_split().width,
size_after_3d_split().height
if ((crop().left || crop().right || crop().top || crop().bottom) && size() != dcp::Size (0, 0)) {
dcp::Size cropped = size_after_crop ();
- d += String::compose (
+ d += dcp::compose (
_("\nCropped to %1x%2"),
cropped.width, cropped.height
);
auto const scaled = scaled_size (container_size);
if (scaled != size_after_crop ()) {
- d += String::compose (
+ d += dcp::compose (
_("\nScaled to %1x%2"),
scaled.width, scaled.height
);
}
if (scaled != container_size) {
- d += String::compose (
+ d += dcp::compose (
_("\nPadded with black to fit container %1 (%2x%3)"),
film->container()->container_nickname (),
container_size.width, container_size.height
VideoContent::add_properties (list<UserProperty>& p) const
{
p.push_back (UserProperty (UserProperty::VIDEO, _("Length"), length (), _("video frames")));
- p.push_back (UserProperty (UserProperty::VIDEO, _("Size"), String::compose ("%1x%2", size().width, size().height)));
+ p.push_back (UserProperty (UserProperty::VIDEO, _("Size"), dcp::compose ("%1x%2", size().width, size().height)));
}
void
*/
-#include "compose.hpp"
#include "film.h"
#include "frame_interval_checker.h"
#include "image.h"
#include "log.h"
#include "raw_image_proxy.h"
#include "video_decoder.h"
+#include <dcp/compose.h>
#include <iostream>
#include "i18n.h"
if (_frame_interval_checker->guess() == FrameIntervalChecker::PROBABLY_NOT_3D && vft == VideoFrameType::THREE_D) {
boost::throw_exception (
DecodeError(
- String::compose(
+ dcp::compose(
_("The content file %1 is set as 3D but does not appear to contain 3D images. Please set it to 2D. "
"You can still make a 3D DCP from this content by ticking the 3D option in the DCP video tab."),
_content->path(0)
*/
-#include "compose.hpp"
#include "image.h"
#include "video_filter_graph.h"
#include "warnings.h"
+#include <dcp/compose.h>
extern "C" {
#include <libavfilter/buffersrc.h>
#include <libavfilter/buffersink.h>
} else {
int r = av_buffersrc_write_frame (_buffer_src_context, frame);
if (r < 0) {
- throw DecodeError (String::compose(N_("could not push buffer into filter chain (%1)."), r));
+ throw DecodeError (dcp::compose(N_("could not push buffer into filter chain (%1)."), r));
}
while (true) {
#include "video_content.h"
#include "job.h"
#include "film.h"
-#include "compose.hpp"
#include <asdcp/KM_log.h>
+#include <dcp/compose.h>
#include <dcp/mono_picture_asset.h>
#include <dcp/stereo_picture_asset.h>
#include <dcp/exceptions.h>
string
VideoMXFContent::summary () const
{
- return String::compose (_("%1 [video]"), path_summary());
+ return dcp::compose (_("%1 [video]"), path_summary());
}
#include "video_ring_buffers.h"
#include "player_video.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
#include <list>
#include <iostream>
for (auto const& i: _data) {
m += i.first->memory_used();
}
- return make_pair(m, String::compose("%1 frames", _data.size()));
+ return make_pair(m, dcp::compose("%1 frames", _data.size()));
}
#include "writer.h"
-#include "compose.hpp"
#include "film.h"
#include "ratio.h"
#include "log.h"
#include "util.h"
#include "reel_writer.h"
#include "text_content.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/locale_convert.h>
#include <dcp/reel_file_asset.h>
auto creator = Config::instance()->dcp_creator();
if (creator.empty()) {
- creator = String::compose("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
+ creator = dcp::compose("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
}
auto issuer = Config::instance()->dcp_issuer();
if (issuer.empty()) {
- issuer = String::compose("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
+ issuer = dcp::compose("DCP-o-matic %1 %2", dcpomatic_version, dcpomatic_git_commit);
}
cpl->set_creator (creator);
}
if (size > (1000000000L)) {
- boost::algorithm::replace_all (text, "$SIZE", String::compose("%1GB", dcp::locale_convert<string>(size / 1000000000.0, 1, true)));
+ boost::algorithm::replace_all (text, "$SIZE", dcp::compose("%1GB", dcp::locale_convert<string>(size / 1000000000.0, 1, true)));
} else {
- boost::algorithm::replace_all (text, "$SIZE", String::compose("%1MB", dcp::locale_convert<string>(size / 1000000.0, 1, true)));
+ boost::algorithm::replace_all (text, "$SIZE", dcp::compose("%1MB", dcp::locale_convert<string>(size / 1000000.0, 1, true)));
}
auto ch = audio_channel_types (film()->mapped_audio_channels(), film()->audio_channels());
- auto description = String::compose("%1.%2", ch.first, ch.second);
+ auto description = dcp::compose("%1.%2", ch.first, ch.second);
if (description == "0.0") {
description = _("None");
auto const hmsf = film()->length().split(film()->video_frame_rate());
string length;
if (hmsf.h == 0 && hmsf.m == 0) {
- length = String::compose("%1s", hmsf.s);
+ length = dcp::compose("%1s", hmsf.s);
} else if (hmsf.h == 0 && hmsf.m > 0) {
- length = String::compose("%1m%2s", hmsf.m, hmsf.s);
+ length = dcp::compose("%1m%2s", hmsf.m, hmsf.s);
} else if (hmsf.h > 0 && hmsf.m > 0) {
- length = String::compose("%1h%2m%3s", hmsf.h, hmsf.m, hmsf.s);
+ length = dcp::compose("%1h%2m%3s", hmsf.h, hmsf.m, hmsf.s);
}
boost::algorithm::replace_all (text, "$LENGTH", length);
#include "lib/update_checker.h"
#include "lib/cross.h"
#include "lib/content_factory.h"
-#include "lib/compose.hpp"
#include "lib/dcpomatic_socket.h"
#include "lib/hints.h"
#include "lib/dcp_content.h"
#include "lib/dcpomatic_log.h"
#include "lib/subtitle_encoder.h"
#include "lib/warnings.h"
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <dcp/raw_convert.h>
DCPOMATIC_DISABLE_WARNINGS
#ifdef DCPOMATIC_LINUX
int r = system ("which nautilus");
if (WEXITSTATUS (r) == 0) {
- r = system (String::compose("nautilus \"%1\"", _film->directory()->string()).c_str());
+ r = system (dcp::compose("nautilus \"%1\"", _film->directory()->string()).c_str());
if (WEXITSTATUS (r)) {
error_dialog (this, _("Could not show DCP."), _("Could not run nautilus"));
}
} else {
int r = system ("which konqueror");
if (WEXITSTATUS (r) == 0) {
- r = system (String::compose ("konqueror \"%1\"", _film->directory()->string()).c_str());
+ r = system (dcp::compose ("konqueror \"%1\"", _film->directory()->string()).c_str());
if (WEXITSTATUS (r)) {
error_dialog (this, _("Could not show DCP"), _("Could not run konqueror"));
}
#endif
#ifdef DCPOMATIC_OSX
- int r = system (String::compose ("open -R \"%1\"", _film->dir (_film->dcp_name(false)).string()).c_str());
+ int r = system (dcp::compose ("open -R \"%1\"", _film->dir (_film->dcp_name(false)).string()).c_str());
if (WEXITSTATUS (r)) {
error_dialog (this, _("Could not show DCP"));
}
for (size_t i = 0; i < history.size(); ++i) {
string s;
if (i < 9) {
- s = String::compose ("&%1 %2", i + 1, history[i].string());
+ s = dcp::compose ("&%1 %2", i + 1, history[i].string());
} else {
s = history[i].string();
}
try {
_frame->load_film (_film_to_load);
} catch (exception& e) {
- error_dialog (nullptr, std_to_wx(String::compose(wx_to_std(_("Could not load film %1 (%2)")), _film_to_load)), std_to_wx(e.what()));
+ error_dialog (nullptr, std_to_wx(dcp::compose(wx_to_std(_("Could not load film %1 (%2)")), _film_to_load)), std_to_wx(e.what()));
}
}
#include "wx/servers_list_dialog.h"
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/dcpomatic_socket.h"
#include "lib/film.h"
#include "lib/transcode_job.h"
#include "lib/util.h"
#include "lib/version.h"
+#include <dcp/compose.h>
#include <wx/aboutdlg.h>
#include <wx/cmdline.h>
#include <wx/preferences.h>
} catch (exception& e) {
error_dialog (
0,
- std_to_wx(String::compose(wx_to_std(_("Could not load film %1")), i.string())),
+ std_to_wx(dcp::compose(wx_to_std(_("Could not load film %1")), i.string())),
std_to_wx(e.what())
);
}
if (!confirm_dialog (
this,
std_to_wx (
- String::compose(wx_to_std(_("The directory %1 already exists and is not empty. "
+ dcp::compose(wx_to_std(_("The directory %1 already exists and is not empty. "
"Are you sure you want to use it?")),
output.string())
)
} else if (is_regular_file(output)) {
error_dialog (
this,
- String::compose (wx_to_std(_("%1 already exists as a file, so you cannot use it for a DCP.")), output.string())
+ dcp::compose (wx_to_std(_("%1 already exists as a file, so you cannot use it for a DCP.")), output.string())
);
return;
}
#ifdef DCPOMATIC_OSX
void uninstall()
{
- system(String::compose("osascript \"%1/uninstall_disk.applescript\"", resources_path().string()).c_str());
+ system(dcp::compose("osascript \"%1/uninstall_disk.applescript\"", resources_path().string()).c_str());
}
#endif
*/
-#include "lib/compose.hpp"
#include "lib/cross.h"
#include "lib/dcpomatic_log.h"
#include "lib/digester.h"
#include "lib/nanomsg.h"
#include "lib/version.h"
#include "lib/warnings.h"
+#include <dcp/compose.h>
#ifdef DCPOMATIC_POSIX
#include <sys/ioctl.h>
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
#include "lib/cinema.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/cross.h"
#include "lib/dkdm_wrapper.h"
#include "lib/screen.h"
#include "lib/send_kdm_email_job.h"
#include "lib/util.h"
+#include <dcp/compose.h>
#include <dcp/encrypted_kdm.h>
#include <dcp/decrypted_kdm.h>
#include <dcp/exceptions.h>
#include "lib/util.h"
#include "lib/internet.h"
#include "lib/update_checker.h"
-#include "lib/compose.hpp"
#include "lib/dcp_content.h"
#include "lib/job_manager.h"
#include "lib/job.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcpomatic_log.h"
#include "lib/file_log.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
try {
load_dcp (history[n]);
} catch (exception& e) {
- error_dialog (0, std_to_wx(String::compose(wx_to_std(_("Could not load DCP %1.")), history[n])), std_to_wx(e.what()));
+ error_dialog (0, std_to_wx(dcp::compose(wx_to_std(_("Could not load DCP %1.")), history[n])), std_to_wx(e.what()));
}
}
}
for (size_t i = 0; i < history.size(); ++i) {
string s;
if (i < 9) {
- s = String::compose ("&%1 %2", i + 1, history[i].string());
+ s = dcp::compose ("&%1 %2", i + 1, history[i].string());
} else {
s = history[i].string();
}
try {
_frame->load_dcp (_dcp_to_load);
} catch (exception& e) {
- error_dialog (0, std_to_wx (String::compose (wx_to_std (_("Could not load DCP %1.")), _dcp_to_load)), std_to_wx(e.what()));
+ error_dialog (0, std_to_wx (dcp::compose (wx_to_std (_("Could not load DCP %1.")), _dcp_to_load)), std_to_wx(e.what()));
}
}
#else
string const colour = gui_is_dark() ? "white" : "black";
wxBitmap bitmap (
- bitmap_path(String::compose("dcpomatic_small_%1", colour)),
+ bitmap_path(dcp::compose("dcpomatic_small_%1", colour)),
wxBITMAP_TYPE_PNG
);
wxIcon icon;
#include "wx_util.h"
#include "static_text.h"
#include "lib/version.h"
-#include "lib/compose.hpp"
#include "lib/warnings.h"
+#include <dcp/compose.h>
DCPOMATIC_DISABLE_WARNINGS
#include <wx/notebook.h>
#include <wx/hyperlink.h>
wxString s;
if (strcmp (dcpomatic_git_commit, "release") == 0) {
- t = new StaticText (this, std_to_wx(String::compose("Version %1", dcpomatic_version)));
+ t = new StaticText (this, std_to_wx(dcp::compose("Version %1", dcpomatic_version)));
} else {
- t = new StaticText (this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
+ t = new StaticText (this, std_to_wx(dcp::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit)));
}
t->SetFont (version_font);
sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2));
#include "film_viewer.h"
#include "lib/audio_decoder.h"
#include "lib/audio_analysis.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <wx/graphics.h>
#include <boost/bind/bind.hpp>
#include <iostream>
int const y = (metrics.height - (i - _minimum) * metrics.y_scale) - metrics.y_origin;
h_grid.MoveToPoint (metrics.db_label_width - 4, y);
h_grid.AddLineToPoint (metrics.db_label_width + data_width, y);
- gc->DrawText (std_to_wx (String::compose ("%1dB", i)), 0, y - (db_label_height / 2));
+ gc->DrawText (std_to_wx (dcp::compose ("%1dB", i)), 0, y - (db_label_height / 2));
}
gc->SetPen (wxPen (wxColour (200, 200, 200)));
#include "download_certificate_dialog.h"
#include "wx_util.h"
#include "lib/internet.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
+#include <dcp/compose.h>
using std::string;
using boost::optional;
BarcoAlchemyCertificatePanel::do_download ()
{
string const serial = wx_to_std (_serial->GetValue());
- string const url = String::compose (
+ string const url = dcp::compose (
"ftp://%1:%2@certificates.barco.com/%3xxx/%4/Barco-ICMP.%5_cert.pem",
Config::instance()->barco_username().get(),
Config::instance()->barco_password().get(),
#include "download_certificate_dialog.h"
#include "wx_util.h"
#include "lib/internet.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
+#include <dcp/compose.h>
using std::string;
using boost::optional;
void
ChristieCertificatePanel::do_download ()
{
- string const prefix = String::compose(
+ string const prefix = dcp::compose(
"ftp://%1:%2@certificates.christiedigital.com/Certificates/",
Config::instance()->christie_username().get(),
Config::instance()->christie_password().get()
string serial = wx_to_std (_serial->GetValue());
serial.insert (0, 12 - serial.length(), '0');
- string const url = String::compose ("%1F-IMB/F-IMB_%2_sha256.pem", prefix, serial);
+ string const url = dcp::compose ("%1F-IMB/F-IMB_%2_sha256.pem", prefix, serial);
optional<string> all_errors;
bool ok = true;
if (error) {
all_errors = *error;
- string const url = String::compose ("%1IMB-S2/IMB-S2_%2_sha256.pem", prefix, serial);
+ string const url = dcp::compose ("%1IMB-S2/IMB-S2_%2_sha256.pem", prefix, serial);
error = get_from_url (url, true, false, boost::bind(&DownloadCertificatePanel::load_certificate_from_chain, this, _1));
if (error) {
#include "lib/string_text.h"
#include "lib/butler.h"
#include "lib/text_content.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <boost/bind/bind.hpp>
using std::list;
_track->Clear ();
for (auto const& i: _tracks) {
- _track->Append (std_to_wx(String::compose("%1 (%2)", i.name, i.language ? i.language->to_string() : wx_to_std(_("Unknown")))));
+ _track->Append (std_to_wx(dcp::compose("%1 (%2)", i.name, i.language ? i.language->to_string() : wx_to_std(_("Unknown")))));
}
if (_track->GetCount() > 0) {
#include "wx_util.h"
#include "lib/audio_content.h"
#include "lib/case_insensitive_sorter.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/content_factory.h"
#include "lib/cross.h"
#include "lib/string_text_file_content.h"
#include "lib/text_content.h"
#include "lib/video_content.h"
+#include <dcp/compose.h>
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/listctrl.h>
#include "content_panel.h"
#include "wx_util.h"
#include "lib/dcp_content.h"
-#include "lib/compose.hpp"
#include "lib/log.h"
+#include <dcp/compose.h>
#include <wx/notebook.h>
using std::list;
#include "dolby_doremi_certificate_panel.h"
#include "download_certificate_dialog.h"
#include "wx_util.h"
-#include "lib/compose.hpp"
#include "lib/internet.h"
#include "lib/signal_manager.h"
#include "lib/util.h"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <curl/curl.h>
#include <zip.h>
static void
try_dcp2000 (list<string>& urls, list<string>& files, string prefix, string serial)
{
- urls.push_back (String::compose("%1%2xxx/dcp2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
- files.push_back (String::compose("dcp2000-%1.cert.sha256.pem", serial));
+ urls.push_back (dcp::compose("%1%2xxx/dcp2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
+ files.push_back (dcp::compose("dcp2000-%1.cert.sha256.pem", serial));
- urls.push_back (String::compose("%1%2xxx/dcp2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
- files.push_back (String::compose("dcp2000-%1.cert.sha256.pem", serial));
+ urls.push_back (dcp::compose("%1%2xxx/dcp2000-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
+ files.push_back (dcp::compose("dcp2000-%1.cert.sha256.pem", serial));
- urls.push_back (String::compose("%1%2xxx/dcp2000-%3.certs.zip", prefix, serial.substr(0, 3), serial));
- files.push_back (String::compose("dcp2000-%1.cert.sha256.pem", serial));
+ urls.push_back (dcp::compose("%1%2xxx/dcp2000-%3.certs.zip", prefix, serial.substr(0, 3), serial));
+ files.push_back (dcp::compose("dcp2000-%1.cert.sha256.pem", serial));
}
static void
try_imb (list<string>& urls, list<string>& files, string prefix, string serial)
{
- urls.push_back (String::compose("%1%2xxx/imb-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
- files.push_back (String::compose("imb-%1.cert.sha256.pem", serial));
+ urls.push_back (dcp::compose("%1%2xxx/imb-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
+ files.push_back (dcp::compose("imb-%1.cert.sha256.pem", serial));
}
static void
try_ims (list<string>& urls, list<string>& files, string prefix, string serial)
{
- urls.push_back (String::compose("%1%2xxx/ims-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
- files.push_back (String::compose("ims-%1.cert.sha256.pem", serial));
+ urls.push_back (dcp::compose("%1%2xxx/ims-%3.dcicerts.zip", prefix, serial.substr(0, 3), serial));
+ files.push_back (dcp::compose("ims-%1.cert.sha256.pem", serial));
}
cat862 = "CAT862_617000_and_higher";
} else {
int const lower = serial_int - (serial_int % 1000);
- cat862 = String::compose ("CAT862_%1-%2", lower, lower + 999);
+ cat862 = dcp::compose ("CAT862_%1-%2", lower, lower + 999);
}
- urls.push_back (String::compose("%1%2/cert_Dolby256-CAT862-%3.zip", prefix, cat862, serial_int));
- files.push_back (String::compose("cert_Dolby256-CAT862-%1.pem.crt", serial_int));
+ urls.push_back (dcp::compose("%1%2/cert_Dolby256-CAT862-%3.zip", prefix, cat862, serial_int));
+ files.push_back (dcp::compose("cert_Dolby256-CAT862-%1.pem.crt", serial_int));
}
dsp100 = "DSP100_3000_and_higher";
} else {
int const lower = serial_int - (serial_int % 1000);
- dsp100 = String::compose ("DSP100_%1_thru_%2", lower, lower + 999);
+ dsp100 = dcp::compose ("DSP100_%1_thru_%2", lower, lower + 999);
}
- urls.push_back (String::compose("%1%2/cert_Dolby256-DSP100-%3.zip", prefix, dsp100, serial_int));
- files.push_back (String::compose("cert_Dolby256-DSP100-%1.pem.crt", serial_int));
+ urls.push_back (dcp::compose("%1%2/cert_Dolby256-DSP100-%3.zip", prefix, dsp100, serial_int));
+ files.push_back (dcp::compose("cert_Dolby256-DSP100-%1.pem.crt", serial_int));
}
cat745 = "CAT745_6000_and_higher";
} else {
int const lower = serial_int - (serial_int % 1000);
- cat745 = String::compose("CAT745_%1_thru_%2", lower, lower + 999);
+ cat745 = dcp::compose("CAT745_%1_thru_%2", lower, lower + 999);
}
- urls.push_back (String::compose("%1%2/cert_Dolby-CAT745-%3.zip", prefix, cat745, serial_int));
- files.push_back (String::compose("cert_Dolby-CAT745-%1.pem.crt", serial_int));
+ urls.push_back (dcp::compose("%1%2/cert_Dolby-CAT745-%3.zip", prefix, cat745, serial_int));
+ files.push_back (dcp::compose("cert_Dolby-CAT745-%1.pem.crt", serial_int));
}
int const serial_int = raw_convert<int> (serial.substr (1));
int const lower = serial_int - (serial_int % 1000);
- urls.push_back (String::compose ("%1CP850_CAT1600_F%2-F%3/cert_RMB_SPB_MDE_FMA.Dolby-CP850-F%4.zip", prefix, lower, lower + 999, serial_int));
- files.push_back (String::compose ("cert_RMB_SPB_MDE_FMA.Dolby-CP850-F%1.pem.crt", serial_int));
+ urls.push_back (dcp::compose ("%1CP850_CAT1600_F%2-F%3/cert_RMB_SPB_MDE_FMA.Dolby-CP850-F%4.zip", prefix, lower, lower + 999, serial_int));
+ files.push_back (dcp::compose ("cert_RMB_SPB_MDE_FMA.Dolby-CP850-F%1.pem.crt", serial_int));
}
static void
try_ims3000 (list<string>& urls, list<string>& files, string prefix, string serial)
{
- urls.push_back (String::compose ("%1%2xxx/cert_Dolby-IMS3000-%3-SMPTE.zip", prefix, serial.substr(0, 3), serial));
- files.push_back (String::compose("cert_Dolby-IMS3000-%1-SMPTE.pem", serial));
+ urls.push_back (dcp::compose ("%1%2xxx/cert_Dolby-IMS3000-%3-SMPTE.zip", prefix, serial.substr(0, 3), serial));
+ files.push_back (dcp::compose("cert_Dolby-IMS3000-%1-SMPTE.pem", serial));
}
#include "download_certificate_dialog.h"
#include "download_certificate_panel.h"
#include "wx_util.h"
-#include "lib/compose.hpp"
#include "lib/signal_manager.h"
#include <dcp/certificate_chain.h>
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <dcp/util.h>
#include <boost/bind/bind.hpp>
try {
_certificate = dcp::Certificate (dcp::file_to_string(file));
} catch (dcp::MiscError& e) {
- return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
+ return dcp::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
}
return {};
}
try {
_certificate = dcp::CertificateChain (dcp::file_to_string(file)).leaf();
} catch (dcp::MiscError& e) {
- return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
+ return dcp::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
}
return {};
}
#include "dir_picker_ctrl.h"
#endif
#include "lib/config.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <wx/stdpaths.h>
#include <boost/filesystem.hpp>
if (!confirm_dialog (
this,
std_to_wx (
- String::compose(wx_to_std(_("The directory %1 already exists and is not empty. "
+ dcp::compose(wx_to_std(_("The directory %1 already exists and is not empty. "
"Are you sure you want to use it?")),
path().string().c_str())
)
} else if (boost::filesystem::is_regular_file(path())) {
error_dialog (
this,
- String::compose (wx_to_std(_("%1 already exists as a file, so you cannot use it for a film.")), path().c_str())
+ dcp::compose (wx_to_std(_("%1 already exists as a file, so you cannot use it for a film.")), path().c_str())
);
return false;
}
#include "lib/butler.h"
#include "lib/log.h"
#include "lib/config.h"
-#include "lib/compose.hpp"
#include "lib/dcpomatic_log.h"
#include "lib/text_content.h"
extern "C" {
#include <libavutil/pixfmt.h>
}
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <wx/tglbtn.h>
#include <iostream>
#include "download_certificate_dialog.h"
#include "wx_util.h"
#include "lib/internet.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
+#include <dcp/compose.h>
using std::string;
using boost::optional;
/* We're adding the A ourselves */
serial = serial.substr(1);
}
- string const url = String::compose(
+ string const url = dcp::compose(
"ftp://%1:%2@ftp.gdc-tech.com/SHA256/A%3.crt.pem",
Config::instance()->gdc_username().get(),
Config::instance()->gdc_password().get(),
#include "lib/job.h"
#include "lib/util.h"
#include "lib/exceptions.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <iostream>
#include "dcpomatic_button.h"
#include "lib/job.h"
#include "lib/job_manager.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/send_notification_email_job.h"
#include "lib/transcode_job.h"
#include "lib/analyse_audio_job.h"
+#include <dcp/compose.h>
#include <wx/wx.h>
#include <boost/algorithm/string.hpp>
_panel->SetSizer (_sizer);
for (auto const& i: titles) {
- auto t = new StaticText (_panel, std_to_wx (String::compose ("%%%1 %2", i.first, i.second)));
+ auto t = new StaticText (_panel, std_to_wx (dcp::compose ("%%%1 %2", i.first, i.second)));
_sizer->Add (t);
auto font = t->GetFont();
font.SetStyle (wxFONTSTYLE_ITALIC);
#define DCPOMATIC_NAME_FORMAT_EDITOR_H
-#include "lib/compose.hpp"
#include "lib/warnings.h"
+#include <dcp/compose.h>
#include <dcp/name_format.h>
DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
#include "wx_util.h"
#include "film_viewer.h"
#include "lib/playlist.h"
-#include "lib/compose.hpp"
#include "lib/video_content.h"
#include "lib/audio_content.h"
#include "lib/dcp_content.h"
#include "lib/film.h"
+#include <dcp/compose.h>
using std::cout;
using std::string;
vfr = dcp->video_frame_rate ();
DCPOMATIC_ASSERT (vfr);
- string const len = String::compose(
+ string const len = dcp::compose(
wx_to_std(_("Length: %1 (%2 frames)")),
time_to_hmsf(dcp->full_length(fv->film()), lrint(*vfr)),
dcp->full_length(fv->film()).frames_round(*vfr)
#include "lib/scoped_temporary.h"
#include "lib/internet.h"
#include "lib/ffmpeg_content.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
#include <wx/listctrl.h>
#include "download_certificate_dialog.h"
#include "wx_util.h"
#include "lib/internet.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
+#include <dcp/compose.h>
#include <boost/algorithm/string/predicate.hpp>
void
QubeCertificatePanel::do_download ()
{
- auto files = ls_url(String::compose("%1SMPTE-%2/", base, _type));
+ auto files = ls_url(dcp::compose("%1SMPTE-%2/", base, _type));
if (files.empty()) {
error_dialog (this, _("Could not read certificates from Qube server."));
return;
auto const serial = wx_to_std(_serial->GetValue());
optional<string> name;
for (auto i: files) {
- if (boost::algorithm::starts_with(i, String::compose("%1-%2-", _type, serial))) {
+ if (boost::algorithm::starts_with(i, dcp::compose("%1-%2-", _type, serial))) {
name = i;
break;
}
return;
}
- auto error = get_from_url (String::compose("%1SMPTE-%2/%3", base, _type, *name), true, false, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1));
+ auto error = get_from_url (dcp::compose("%1SMPTE-%2/%3", base, _type, *name), true, false, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1));
if (error) {
_dialog->message()->SetLabel(wxT(""));
#include "download_certificate_dialog.h"
#include "table_dialog.h"
#include "dcpomatic_button.h"
-#include "lib/compose.hpp"
#include "lib/util.h"
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
#include "lib/warnings.h"
#include "static_text.h"
#include "table_dialog.h"
#include "wx_util.h"
-#include "lib/compose.hpp"
#include "lib/util.h"
#include "lib/warnings.h"
+#include <dcp/compose.h>
#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
DCPOMATIC_DISABLE_WARNINGS
#include "film_editor.h"
#include "timeline_dialog.h"
#include "wx_util.h"
-#include "lib/compose.hpp"
#include "lib/cross.h"
#include "lib/playlist.h"
+#include <dcp/compose.h>
#include <wx/graphics.h>
#include <iostream>
#include <list>
base = resources_path();
#endif
- auto p = base / String::compose("%1.png", name);
+ auto p = base / dcp::compose("%1.png", name);
return std_to_wx (p.string());
}
make_and_verify_dcp (ov);
/* Remove <Hash> tags from the CPL */
- for (auto i: directory_iterator(String::compose("build/test/%1/%2", ov_name, ov->dcp_name()))) {
+ for (auto i: directory_iterator(dcp::compose("build/test/%1/%2", ov_name, ov->dcp_name()))) {
if (boost::algorithm::starts_with(i.path().filename().string(), "cpl_")) {
auto in = fopen_boost(i.path(), "r");
BOOST_REQUIRE (in);
}
string const vf_name = "hash_added_to_imported_dcp_test_vf";
- auto ov_content = make_shared<DCPContent>(String::compose("build/test/%1/%2", ov_name, ov->dcp_name()));
+ auto ov_content = make_shared<DCPContent>(dcp::compose("build/test/%1/%2", ov_name, ov->dcp_name()));
auto vf = new_test_film2 (
vf_name, { ov_content }
);
/* Check for Hash tags in the VF DCP */
int hashes = 0;
- for (auto i: directory_iterator(String::compose("build/test/%1/%2", vf_name, vf->dcp_name()))) {
+ for (auto i: directory_iterator(dcp::compose("build/test/%1/%2", vf_name, vf->dcp_name()))) {
if (boost::algorithm::starts_with(i.path().filename().string(), "cpl_")) {
auto in = fopen_boost(i.path(), "r");
BOOST_REQUIRE (in);
#include "lib/film.h"
#include "lib/image_content.h"
#include "lib/dcp_content_type.h"
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "test.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
#include <dcp/reel_picture_asset.h>
static string
openssl_hash (boost::filesystem::path file)
{
- auto pipe = popen (String::compose ("openssl sha1 -binary %1 | openssl base64 -e", file.string()).c_str (), "r");
+ auto pipe = popen (dcp::compose ("openssl sha1 -binary %1 | openssl base64 -e", file.string()).c_str (), "r");
BOOST_REQUIRE (pipe);
char buffer[128];
string output;
#include "lib/audio_content.h"
-#include "lib/compose.hpp"
#include "lib/content_factory.h"
#include "lib/dcp_content.h"
#include "lib/ffmpeg_content.h"
#include "lib/transcode_job.h"
#include "lib/video_content.h"
#include "test.h"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
BOOST_REQUIRE (false);
}
- name = String::compose("%1_test%2", name, number);
+ name = dcp::compose("%1_test%2", name, number);
auto c = make_shared<FFmpegContent>(content);
shared_ptr<Film> film = new_test_film2 (name, {c}, &cl);
film->write_metadata ();
auto job = make_shared<TranscodeJob>(film);
- auto file = boost::filesystem::path("build") / "test" / String::compose("%1.%2", name, extension);
+ auto file = boost::filesystem::path("build") / "test" / dcp::compose("%1.%2", name, extension);
cl.add (file);
FFmpegEncoder encoder (film, job, file, format, false, false, false, 23);
encoder.go ();
check (
TextType::CLOSED_CAPTION,
"hint_closed_caption_too_long",
- String::compose("At least one of your closed caption lines has more than %1 characters. It is advisable to make each line %1 characters at most in length.", MAX_CLOSED_CAPTION_LENGTH, MAX_CLOSED_CAPTION_LENGTH)
+ dcp::compose("At least one of your closed caption lines has more than %1 characters. It is advisable to make each line %1 characters at most in length.", MAX_CLOSED_CAPTION_LENGTH, MAX_CLOSED_CAPTION_LENGTH)
);
}
check (
TextType::CLOSED_CAPTION,
"hint_many_closed_caption_lines",
- String::compose("Some of your closed captions span more than %1 lines, so they will be truncated.", MAX_CLOSED_CAPTION_LINES)
+ dcp::compose("Some of your closed captions span more than %1 lines, so they will be truncated.", MAX_CLOSED_CAPTION_LINES)
);
}
content->text.front()->set_type (TextType::OPEN_SUBTITLE);
content->text.front()->set_language (dcp::LanguageTag("en-US"));
for (int i = 1; i < 512; ++i) {
- auto font = make_shared<dcpomatic::Font>(String::compose("font_%1", i));
+ auto font = make_shared<dcpomatic::Font>(dcp::compose("font_%1", i));
font->set_file ("test/data/LiberationSans-Regular.ttf");
content->text.front()->add_font(font);
}
auto film = new_test_film2 (name);
- auto ccap = fopen_boost (String::compose("build/test/%1.srt", name), "w");
+ auto ccap = fopen_boost (dcp::compose("build/test/%1.srt", name), "w");
BOOST_REQUIRE (ccap);
for (int i = 0; i < 2048; ++i) {
fprintf(ccap, "%d\n", i + 1);
#include "lib/image_filename_sorter.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
{
vector<boost::filesystem::path> paths;
for (int i = 0; i < 100000; ++i) {
- paths.push_back(String::compose("some.filename.with.%1.number.tiff", i));
+ paths.push_back(dcp::compose("some.filename.with.%1.number.tiff", i));
}
random_shuffle (paths.begin(), paths.end());
sort (paths.begin(), paths.end(), ImageFilenameSorter());
for (int i = 0; i < 100000; ++i) {
- BOOST_CHECK_EQUAL(paths[i].string(), String::compose("some.filename.with.%1.number.tiff", i));
+ BOOST_CHECK_EQUAL(paths[i].string(), dcp::compose("some.filename.with.%1.number.tiff", i));
}
}
*/
-#include "lib/compose.hpp"
#include "lib/image.h"
#include "lib/image_content.h"
#include "lib/image_decoder.h"
#include "lib/ffmpeg_image_proxy.h"
#include "test.h"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
#include <iostream>
true,
false
);
- path file = String::compose("crop_scale_window_test7-%1.png", left_crop);
+ path file = dcp::compose("crop_scale_window_test7-%1.png", left_crop);
write_image(cropped, path("build") / "test" / file);
check_image(path("test") / "data" / file, path("build") / "test" / file, 10);
}
auto until_time = until.time_of_day (true, false);
boost::algorithm::replace_all (until_time, ":", "-");
- auto const ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ auto const ref = dcp::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
BOOST_CHECK_MESSAGE (boost::filesystem::exists("build/test/single_kdm_naming_test/" + ref), "File " << ref << " not found");
}
path const base = "build/test/directory_kdm_naming_test";
- path dir_a = String::compose("Cinema_A_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
+ path dir_a = dcp::compose("Cinema_A_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a), "Directory " << dir_a << " not found");
- path dir_b = String::compose("Cinema_B_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
+ path dir_b = dcp::compose("Cinema_B_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time);
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b), "Directory " << dir_b << " not found");
#ifdef DCPOMATIC_WINDOWS
- path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ path ref = dcp::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ path ref = dcp::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- ref = String::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ ref = dcp::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ ref = dcp::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found");
#ifdef DCPOMATIC_WINDOWS
- ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time);
#else
- ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
+ ref = dcp::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id);
#endif
BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found");
}
film->set_interop (false);
make_and_verify_dcp (film);
- dcp::DCP dcp (String::compose("build/test/%1/%2", name, film->dcp_name()));
+ dcp::DCP dcp (dcp::compose("build/test/%1/%2", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
auto cpl = dcp.cpls().front();
dcp::VerificationNote::Code::INCORRECT_LFOC
});
- dcp::DCP dcp (String::compose("build/test/%1/%2", name, film->dcp_name()));
+ dcp::DCP dcp (dcp::compose("build/test/%1/%2", name, film->dcp_name()));
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
auto cpl = dcp.cpls().front();
#include "lib/dcp_content.h"
#include "lib/text_content.h"
#include "lib/butler.h"
-#include "lib/compose.hpp"
#include "lib/cross.h"
#include "test.h"
+#include <dcp/compose.h>
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
butler->seek (t, true);
auto video = butler->get_video(true, 0);
BOOST_CHECK_EQUAL(video.second.get(), t.get());
- write_image(video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), String::compose("build/test/player_seek_test_%1.png", i));
+ write_image(video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), dcp::compose("build/test/player_seek_test_%1.png", i));
/* This 14.08 is empirically chosen (hopefully) to accept changes in rendering between the reference and a test machine
(17.10 and 16.04 seem to anti-alias a little differently) but to reject gross errors e.g. missing fonts or missing
text altogether.
*/
- check_image(TestPaths::private_data() / String::compose("player_seek_test_%1.png", i), String::compose("build/test/player_seek_test_%1.png", i), 14.08);
+ check_image(TestPaths::private_data() / dcp::compose("player_seek_test_%1.png", i), dcp::compose("build/test/player_seek_test_%1.png", i), 14.08);
}
}
auto video = butler->get_video(true, 0);
BOOST_CHECK_EQUAL(video.second.get(), t.get());
write_image(
- video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), String::compose("build/test/player_seek_test2_%1.png", i)
+ video.first->image(bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true), dcp::compose("build/test/player_seek_test2_%1.png", i)
);
- check_image(TestPaths::private_data() / String::compose("player_seek_test2_%1.png", i), String::compose("build/test/player_seek_test2_%1.png", i), 14.08);
+ check_image(TestPaths::private_data() / dcp::compose("player_seek_test2_%1.png", i), dcp::compose("build/test/player_seek_test2_%1.png", i), 14.08);
}
}
dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION
});
- check_dcp (String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+ check_dcp (dcp::compose("test/data/%1", name), dcp::compose("build/test/%1/%2", name, film->dcp_name()));
}
dcp::VerificationNote::Code::MISSING_CPL_METADATA
});
- check_dcp (String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+ check_dcp (dcp::compose("test/data/%1", name), dcp::compose("build/test/%1/%2", name, film->dcp_name()));
}
*/
-#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/cross.h"
#include "lib/dcp_content_type.h"
#include "lib/signal_manager.h"
#include "lib/util.h"
#include "test.h"
+#include <dcp/compose.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/mono_picture_asset.h>
void
check_ffmpeg (boost::filesystem::path ref, boost::filesystem::path check, int audio_tolerance)
{
- int const r = system (String::compose("ffcmp -t %1 %2 %3", audio_tolerance, ref.string(), check.string()).c_str());
+ int const r = system (dcp::compose("ffcmp -t %1 %2 %3", audio_tolerance, ref.string(), check.string()).c_str());
BOOST_REQUIRE_EQUAL (WEXITSTATUS(r), 0);
}
}
}
BOOST_REQUIRE (failed);
- BOOST_CHECK_EQUAL (failed->error_summary(), String::compose("The content file %1 is set as 3D but does not appear to contain 3D images. Please set it to 2D. You can still make a 3D DCP from this content by ticking the 3D option in the DCP video tab.", content_path.string()));
+ BOOST_CHECK_EQUAL (failed->error_summary(), dcp::compose("The content file %1 is set as 3D but does not appear to contain 3D images. Please set it to 2D. You can still make a 3D DCP from this content by ticking the 3D option in the DCP video tab.", content_path.string()));
while (signal_manager->ui_idle ()) {}