Use dcp::compose rather than our own. compose
authorCarl Hetherington <cth@carlh.net>
Sat, 10 Jul 2021 00:02:19 +0000 (02:02 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 10 Jul 2021 00:02:19 +0000 (02:02 +0200)
118 files changed:
src/lib/analyse_audio_job.cc
src/lib/analytics.cc
src/lib/atmos_mxf_content.cc
src/lib/audio_content.cc
src/lib/audio_decoder.cc
src/lib/audio_filter_graph.cc
src/lib/butler.cc
src/lib/combine_dcp_job.cc
src/lib/compose.hpp [deleted file]
src/lib/config.cc
src/lib/content.cc
src/lib/content_factory.cc
src/lib/copy_to_drive_job.cc
src/lib/create_cli.cc
src/lib/cross_common.cc
src/lib/cross_linux.cc
src/lib/cross_osx.cc
src/lib/cross_windows.cc
src/lib/curl_uploader.cc
src/lib/dcp.cc
src/lib/dcp_content.cc
src/lib/dcp_encoder.cc
src/lib/dcp_subtitle.cc
src/lib/dcp_text_track.cc
src/lib/dcp_video.cc
src/lib/dcpomatic_log.h
src/lib/dcpomatic_socket.cc
src/lib/dkdm_wrapper.cc
src/lib/emailer.cc
src/lib/encode_server.cc
src/lib/environment_info.cc
src/lib/exceptions.cc
src/lib/exceptions.h
src/lib/ext.cc
src/lib/ffmpeg.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_encoder.cc
src/lib/ffmpeg_file_encoder.cc
src/lib/ffmpeg_image_proxy.cc
src/lib/file_group.cc
src/lib/film.cc
src/lib/filter_graph.cc
src/lib/frame_rate_change.cc
src/lib/hints.cc
src/lib/image.cc
src/lib/image_content.cc
src/lib/image_examiner.cc
src/lib/internet.cc
src/lib/j2k_encoder.cc
src/lib/job.cc
src/lib/nanomsg.cc
src/lib/player.cc
src/lib/playlist.cc
src/lib/reel_writer.cc
src/lib/resampler.cc
src/lib/scp_uploader.cc
src/lib/send_kdm_email_job.cc
src/lib/send_notification_email_job.cc
src/lib/send_problem_report_job.cc
src/lib/shuffler.cc
src/lib/subtitle_encoder.cc
src/lib/text_decoder.cc
src/lib/timer.cc
src/lib/transcode_job.cc
src/lib/types.cc
src/lib/upload_job.cc
src/lib/uploader.cc
src/lib/util.cc
src/lib/video_content.cc
src/lib/video_decoder.cc
src/lib/video_filter_graph.cc
src/lib/video_mxf_content.cc
src/lib/video_ring_buffers.cc
src/lib/writer.cc
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_combiner.cc
src/tools/dcpomatic_disk.cc
src/tools/dcpomatic_disk_writer.cc
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_player.cc
src/tools/dcpomatic_server.cc
src/wx/about_dialog.cc
src/wx/audio_plot.cc
src/wx/barco_alchemy_certificate_panel.cc
src/wx/christie_certificate_panel.cc
src/wx/closed_captions_dialog.cc
src/wx/content_panel.cc
src/wx/content_sub_panel.cc
src/wx/dolby_doremi_certificate_panel.cc
src/wx/download_certificate_panel.cc
src/wx/film_name_location_dialog.cc
src/wx/film_viewer.cc
src/wx/gdc_certificate_panel.cc
src/wx/job_manager_view.cc
src/wx/job_view.cc
src/wx/name_format_editor.cc
src/wx/name_format_editor.h
src/wx/player_information.cc
src/wx/playlist_controls.cc
src/wx/qube_certificate_panel.cc
src/wx/recipient_dialog.cc
src/wx/screen_dialog.cc
src/wx/timeline_dialog.cc
src/wx/wx_util.cc
test/cpl_hash_test.cc
test/digest_test.cc
test/ffmpeg_encoder_test.cc
test/hints_test.cc
test/image_filename_sorter_test.cc
test/image_test.cc
test/kdm_naming_test.cc
test/markers_test.cc
test/player_test.cc
test/subtitle_language_test.cc
test/test.cc
test/threed_test.cc

index ca0f49f570524499c3f85664b163fa3357bf3b30..e71230683d3f4ddb407f191a708fd8f81567d229 100644 (file)
 
 #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"
index ac0abc22273c182be40e3294934f2d4a701214d8..697e8f0e4de408ea78f224653a630b6a5cc841a6 100644 (file)
@@ -20,9 +20,9 @@
 
 
 #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
@@ -60,7 +60,7 @@ Analytics::successful_dcp_encode ()
                        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 "
index 82c20e88f7bd8e7c723e49216b1d4aeeabe3bc4d..d833bc416d907157fcc6b292ec9bbc7731ac1060 100644 (file)
 
 #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>
@@ -93,7 +93,7 @@ AtmosMXFContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 string
 AtmosMXFContent::summary () const
 {
-       return String::compose (_("%1 [Atmos]"), path_summary());
+       return dcp::compose (_("%1 [Atmos]"), path_summary());
 }
 
 
index 748cbb7d0d6403b487ec540abd2ab2e8768b3d66..d0c08e4800349408e63d21031675c79204c1cb9c 100644 (file)
 
 
 #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>
@@ -148,7 +148,7 @@ AudioContent::technical_summary () const
 {
        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;
@@ -263,14 +263,14 @@ AudioContent::processing_description (shared_ptr<const Film> film) const
        }
 
        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));
                }
        }
 
@@ -288,7 +288,7 @@ AudioContent::channel_names () const
        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;
        }
index 77c9b0695a3d7b6f4c7d3b57df84193e017863eb..7cc0621b33cb2f1372d058c9cd88f88bc83ad2c9 100644 (file)
@@ -25,7 +25,7 @@
 #include "dcpomatic_log.h"
 #include "log.h"
 #include "resampler.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <iostream>
 
 #include "i18n.h"
index fc43b5a344a972a9ef20d69e1257441024616412..e9943406913a2c8bd8ca40dfa2877d849645e31e 100644 (file)
@@ -20,7 +20,7 @@
 
 #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>
@@ -149,7 +149,7 @@ AudioFilterGraph::process (shared_ptr<const AudioBuffers> buffers)
        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) {
index 5a8e646aa4635556fca90f8791f23e46b6468a9e..3edad697866ca49c77c5d141b33bda11d2ccc839 100644 (file)
@@ -25,9 +25,9 @@
 #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;
@@ -138,10 +138,10 @@ Butler::should_run () const
                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()));
                }
        }
 
@@ -150,10 +150,10 @@ Butler::should_run () const
                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()));
                }
        }
 
@@ -470,7 +470,7 @@ Butler::Error::summary () const
                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";
        }
index 5c299492be9721d69705ebbc0c1952c6d7d59f31..0f548ec8b829344a2257553290962876cbe511e4 100644 (file)
@@ -20,9 +20,9 @@
 
 
 #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"
@@ -64,8 +64,8 @@ CombineDCPJob::run ()
                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()
diff --git a/src/lib/compose.hpp b/src/lib/compose.hpp
deleted file mode 100644 (file)
index 479493f..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-/* -*- 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
index a8653a10c891a2dd766fc89b140498443a63c03e..ce7651ea8c4cc9ad78c828c9fccca316a9de2509 100644 (file)
@@ -30,9 +30,9 @@
 #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>
@@ -217,13 +217,13 @@ Config::backup ()
        /* 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 (...) {}
 }
 
index 49ab944be54c79c3d478469ad09762a9555768fe..d2d8208dec654e61c5b914669fbf33b503dfc8d3 100644 (file)
@@ -34,7 +34,7 @@
 #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>
@@ -304,9 +304,9 @@ Content::clone () const
 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;
 }
index e912589fcb9e89e51603dde5ec666423cfbcf407..6531986fbf662e55255a9c81d809ce5915f09045 100644 (file)
@@ -38,7 +38,7 @@
 #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>
index 9ddedfe62dfc8c946f38a1fd7a65755bf8bccd7d..539afb61f9cbd2504bf92eda7b6b40af6dddb026 100644 (file)
@@ -20,9 +20,9 @@
 
 #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>
@@ -53,7 +53,7 @@ CopyToDriveJob::CopyToDriveJob (boost::filesystem::path dcp, Drive drive, Nanoms
 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
@@ -66,7 +66,7 @@ void
 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 ();
        }
index 2258f8a2ea0ab6c439214309813c8a2a33ca5218..e311f74cf0c14e300c9189e9178927c7b99cffff 100644 (file)
 */
 
 
-#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>
@@ -67,7 +67,7 @@ argument_option (int& n, int argc, char* argv[], string short_name, string long_
        }
 
        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;
        }
 
@@ -108,7 +108,7 @@ CreateCLI::CreateCLI (int argc, char* argv[])
                } 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;
                }
 
@@ -142,7 +142,7 @@ CreateCLI::CreateCLI (int argc, char* argv[])
 
                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;
@@ -178,20 +178,20 @@ CreateCLI::CreateCLI (int argc, char* argv[])
 
        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;
        }
 
@@ -200,7 +200,7 @@ CreateCLI::CreateCLI (int argc, char* argv[])
        }
 
        if (content.empty()) {
-               error = String::compose("%1: no content specified", argv[0]);
+               error = dcp::compose("%1: no content specified", argv[0]);
                return;
        }
 
@@ -209,7 +209,7 @@ CreateCLI::CreateCLI (int argc, char* argv[])
        }
 
        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;
        }
 }
index 2e48bf3e015131fab22094fea7a46b80f028325f..0a5451ff18a7cc259e866f61a9222b416a5a457f 100644 (file)
@@ -20,9 +20,9 @@
 
 
 #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>
@@ -91,7 +91,7 @@ Drive::description () const
                name = _("Unknown");
        }
 
-       return String::compose(_("%1 (%2 GB) [%3]"), name, gb, _device);
+       return dcp::compose(_("%1 (%2 GB) [%3]"), name, gb, _device);
 }
 
 
@@ -108,7 +108,7 @@ Drive::log_summary () const
                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]")
                        );
index 65151791cc820dc4f83ab1317e9418a59ac39aa0..f2faa6a2a8b2780994b7f98e2de87e6d3e05e8b0 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 
-#include "compose.hpp"
 #include "config.h"
 #include "cross.h"
 #include "dcpomatic_log.h"
@@ -27,6 +26,7 @@
 #include "exceptions.h"
 #include "log.h"
 #include "warnings.h"
+#include <dcp/compose.h>
 #include <dcp/raw_convert.h>
 #include <glib.h>
 DCPOMATIC_DISABLE_WARNINGS
index b9b7796a21a73c71e2fb59ac972134fd4ed3439f..d7ca778f4c46d03aa123053655b6f2b988b443f7 100644 (file)
 
 
 #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" {
index ac92aa7eb730b8364673b8b8725b862453b7975f..43dc87cc3c537af1804fff66f825003abb50f6c2 100644 (file)
 
 
 #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" {
@@ -599,7 +599,7 @@ Drive::get ()
                        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,
@@ -645,7 +645,7 @@ Drive::unmount ()
 {
        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);
index 60835bea716cc6eab0e696f738dc95550ad06863..0b08227f0d55a362c6d45632b8b4d5a251fc22cd 100644 (file)
@@ -23,7 +23,7 @@
 #include "exceptions.h"
 #include "config.h"
 #include "cross.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -82,19 +82,19 @@ CurlUploader::upload_file (boost::filesystem::path from, boost::filesystem::path
        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);
index abdfc7f9eaad8aa92b223a44bab1c87f1f663dc1..ee7b92ca521113718db21d431e7dd7d70a6532f9 100644 (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>
index c380e6f84e2ab84f42cb2ee4fc25b3d42f1dd25b..26ed4981964bf9dcbd8ec513c1a233c758d9abec 100644 (file)
 #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>
@@ -315,7 +315,7 @@ string
 DCPContent::summary () const
 {
        boost::mutex::scoped_lock lm (_mutex);
-       return String::compose (_("%1 [DCP]"), _name);
+       return dcp::compose (_("%1 [DCP]"), _name);
 }
 
 string
index f1c41253984f514563735b62580399711e4042f4..e0e2f39cf0d5de8c0674954fc3715eaed44d0726 100644 (file)
 #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>
 
index 0943a6b08721c49c0c0132acb90273cd14901d6c..21180dc2a76ba1ef883a99615b0013dd5fac076c 100644 (file)
@@ -21,7 +21,7 @@
 
 #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>
 
@@ -56,7 +56,7 @@ DCPSubtitle::load (boost::filesystem::path file) const
        }
 
        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;
index 0bd75127541ac7be96abf6854426aaf46df06446..749129c3595756fe6b6e52d6baaadfbf6fc7090b 100644 (file)
@@ -20,7 +20,7 @@
 
 
 #include "dcp_text_track.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <string>
 
 #include "i18n.h"
@@ -50,7 +50,7 @@ DCPTextTrack::DCPTextTrack (string name_, optional<dcp::LanguageTag> language_)
 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
index 4a505a7e18e65996b4666d59f541e67b0f993c06..895e39dd78ed9ce3cd59f87d3749db0afda980da 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 
-#include "compose.hpp"
 #include "config.h"
 #include "cross.h"
 #include "dcp_video.h"
@@ -44,6 +43,7 @@
 #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>
index 6a1c3a6ec54ccf170d24a56ebf2e7a0d7cca33d3..5eb8f283332fc8cba7d6b2b9acf2a87342f80701 100644 (file)
 
 
 #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);
 
index a92a294e6a05668dfa9ad10d8f982f85680a588d..a1670de55be0221efe646fb0148c773f49c0e38e 100644 (file)
@@ -19,9 +19,9 @@
 */
 
 #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>
@@ -66,7 +66,7 @@ Socket::connect (boost::asio::ip::tcp::endpoint endpoint)
        } 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 ()) {
@@ -91,7 +91,7 @@ Socket::write (uint8_t const * data, int size)
        } 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) {
@@ -123,7 +123,7 @@ Socket::read (uint8_t* data, int size)
        } 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) {
index 4698c159d26a97bd9dd85cac1edd153334eacc09..ceba6582c28c385168ad5008fd4ec31d1372cd1e 100644 (file)
 */
 
 
-#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
@@ -57,7 +57,7 @@ DKDMBase::read (cxml::ConstNodePtr node)
 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());
 }
 
 
index 6ef23c3e0c03a3e20cd241df9453dddfea8501aa..4933b9953600ee5335cab7af027f473f6b485e8a 100644 (file)
 */
 
 
-#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>
@@ -189,9 +189,9 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str
 
        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 ()) {
index 24ba5bc451449bc59ab63d2c71d8ed182eb56a13..739903c8b18096cba9bf45bc34d6a6dae178eb9d 100644 (file)
 #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
index 2a6d47a005f1d077a3bea152840a9d7a05934a56..d7ac75ccbd6cd88fbc9584a2ee22a730c709652b 100644 (file)
 */
 
 
-#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
@@ -85,12 +85,12 @@ environment_info ()
 {
        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
@@ -109,7 +109,7 @@ environment_info ()
        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
                        )
@@ -141,9 +141,9 @@ environment_info ()
 #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;
index 9350430f9b96fd912b9c4d2181a152e561dac65e..119963d90a57e896bc67b69d8def139ce90c4f8a 100644 (file)
@@ -20,7 +20,7 @@
 
 
 #include "exceptions.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 
 #include "i18n.h"
 
@@ -33,7 +33,7 @@ using boost::optional;
 /** @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(),
@@ -46,7 +46,7 @@ OpenFileError::OpenFileError (boost::filesystem::path f, int error, Mode mode)
 
 
 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)
 {
 
@@ -54,35 +54,35 @@ FileNotFoundError::FileNotFoundError (boost::filesystem::path 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)
 {
 
 }
@@ -96,14 +96,14 @@ InvalidSignerError::InvalidSignerError ()
 
 
 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))
 {
 
 }
@@ -117,7 +117,7 @@ KDMAsContentError::KDMAsContentError ()
 
 
 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)
 {
@@ -126,14 +126,14 @@ KDMError::KDMError (string s, string 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)
 {
@@ -149,7 +149,7 @@ CommunicationFailedError::CommunicationFailedError ()
 
 
 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)
 {
index 5cbf6994154dadaeda169130cd82ac2ddaf48637..d6a0055c3fe3b15c8e9be62b591f28daeab3f502 100644 (file)
@@ -28,7 +28,7 @@
 #define DCPOMATIC_EXCEPTIONS_H
 
 
-#include "compose.hpp"
+#include <dcp/compose.h>
 extern "C" {
 #include <libavutil/pixfmt.h>
 }
@@ -50,19 +50,19 @@ public:
        {}
 
        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()))
        {}
 };
 
@@ -87,11 +87,11 @@ public:
        {}
 
        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))
        {}
 };
 
@@ -106,7 +106,7 @@ public:
         *  @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)
        {}
 
index feba68c1f6eec9c15951b1fa70cf010b6843fafd..d8df7609e5a45f3f400ef766289070e75a59bb82 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 
-#include "compose.hpp"
 #include "cross.h"
 #include "dcpomatic_log.h"
 #include "digester.h"
@@ -27,6 +26,7 @@
 #include "exceptions.h"
 #include "ext.h"
 #include "nanomsg.h"
+#include <dcp/compose.h>
 
 #ifdef DCPOMATIC_LINUX
 #include <linux/fs.h>
@@ -97,13 +97,13 @@ write (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total
        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];
@@ -119,7 +119,7 @@ write (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total
                        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);
@@ -136,14 +136,14 @@ write (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total
                        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);
                }
        }
 
@@ -163,7 +163,7 @@ read (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_
        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());
 
@@ -178,14 +178,14 @@ read (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_
                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);
                }
        }
 
@@ -229,7 +229,7 @@ copy (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_
        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) {
@@ -263,7 +263,7 @@ void
 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);
        }
 }
 
@@ -402,17 +402,17 @@ try
 } 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);
        }
 }
 
index d476b4c298663c64b367224235b2cadac0ede431..9d07a81090de5d70f47f3eb59d983e8c564bd649 100644 (file)
@@ -29,8 +29,8 @@
 #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>
@@ -103,7 +103,7 @@ FFmpeg::ffmpeg_log_callback (void* ptr, int level, const char* fmt, va_list vl)
        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);
 }
 
 
@@ -236,7 +236,7 @@ FFmpeg::setup_decoders ()
                                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);
                }
        }
 }
index 516962936238824775970f5796dc97c10ca6f62e..8e8d43282df3392d0c4a41de8bdca2032de36ea5 100644 (file)
@@ -25,7 +25,6 @@
 #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"
@@ -35,6 +34,7 @@
 #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" {
@@ -115,7 +115,7 @@ FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string>
                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()));
                }
        }
 
@@ -338,11 +338,11 @@ string
 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 ();
@@ -378,7 +378,7 @@ FFmpegContent::technical_summary () const
                s += " - " + audio->technical_summary ();
        }
 
-       return s + String::compose (
+       return s + dcp::compose (
                "ffmpeg: audio %1 subtitle %2 filters %3", as, ss, filt
                );
 }
@@ -550,14 +550,14 @@ FFmpegContent::add_properties (shared_ptr<const Film> film, list<UserProperty>&
                                /// 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);
index 31fbde773b3ab86df610edb9eb801141a48e9a11..a1b44624e4ab30d12f1aba73d73ebfad8b36f646 100644 (file)
 #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>
@@ -340,7 +340,7 @@ FFmpegDecoder::deinterleave_audio (AVFrame* frame)
        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;
index 1ce375594b531229ead3ee6dbd0f68cdec1f0577..bd4f29c78386e3cd78f3cf9aeb33a683d0d4e21c 100644 (file)
@@ -27,7 +27,7 @@
 #include "image.h"
 #include "cross.h"
 #include "butler.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -136,7 +136,7 @@ FFmpegEncoder::go ()
                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 (
@@ -179,7 +179,7 @@ FFmpegEncoder::go ()
                        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) {
@@ -248,17 +248,17 @@ FFmpegEncoder::FileEncoderSet::FileEncoderSet (
                /// 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)
                        );
        }
 }
index 29ee7455b5d4ed680ff93c0791946cbb1fb9b917..080f3ade9f5cd8de5745ac963011ce56814f2b27 100644 (file)
@@ -28,7 +28,7 @@
 #include "log.h"
 #include "image.h"
 #include "cross.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -62,7 +62,7 @@ public:
        {
                _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);
@@ -263,7 +263,7 @@ FFmpegFileEncoder::FFmpegFileEncoder (
 
        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;
@@ -307,7 +307,7 @@ FFmpegFileEncoder::setup_video ()
 {
        _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);
index 54fb1c46837012485d3a93dbdd37ae3e71ceeecc..e26f4b040f26177412a829fbb009f057ebc2b0c9 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 
-#include "compose.hpp"
 #include "cross.h"
 #include "dcpomatic_socket.h"
 #include "exceptions.h"
@@ -27,6 +26,7 @@
 #include "image.h"
 #include "util.h"
 #include "warnings.h"
+#include <dcp/compose.h>
 #include <dcp/raw_convert.h>
 DCPOMATIC_DISABLE_WARNINGS
 extern "C" {
@@ -160,7 +160,7 @@ FFmpegImageProxy::image (optional<dcp::Size>) const
                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)));
                }
        }
 
index 7dae1da92c26690f40ccdff9c4dd7d026d3d24d1..c5f6aa0cbf5236c92d1ded39ab410342c0bbe7c5 100644 (file)
  */
 
 
-#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>
 
@@ -182,7 +182,7 @@ FileGroup::read (uint8_t* buffer, int amount) const
                }
 
                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) {
index 44c49220b94f6836935d132341dc7ff7d23aabe8..3fe92c7cdb95b447b889724b5c63117174fc53e9 100644 (file)
@@ -44,7 +44,6 @@
 #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"
@@ -58,6 +57,7 @@
 #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>
@@ -564,7 +564,7 @@ Film::read_metadata (optional<boost::filesystem::path> path)
                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);
@@ -887,7 +887,7 @@ Film::isdcf_name (bool if_created_now) const
                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) {
@@ -969,7 +969,7 @@ Film::isdcf_name (bool if_created_now) const
        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()) {
index fc6b9033ac97805e01b4ea45aaeca6dc6fb41208..1984604ce697249663a010c752936ece3f66f1e6 100644 (file)
@@ -28,7 +28,7 @@
 #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>
@@ -104,7 +104,7 @@ FilterGraph::setup (vector<Filter const *> filters)
 
        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));
        }
 }
 
index a1ff2ae650a93d7ec19782763f359b4b6a0c883a..0ee4a492e890f617ac0f46066eb492d2467d2b27 100644 (file)
@@ -23,7 +23,7 @@
 #include "types.h"
 #include "content.h"
 #include "film.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <cmath>
 
 #include "i18n.h"
@@ -94,7 +94,7 @@ FrameRateChange::description () const
                } 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) {
index 64122db8d5bab6be1ab41a6d14d5c68933a66d2a..7653638fd9e684d6f0ae18d6b600bc1b1e168c6f 100644 (file)
@@ -22,7 +22,6 @@
 #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"
@@ -37,6 +36,7 @@
 #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>
@@ -182,7 +182,7 @@ Hints::check_frame_rate ()
        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.");
@@ -198,7 +198,7 @@ Hints::check_frame_rate ()
        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;
        }
 }
@@ -287,7 +287,7 @@ Hints::check_vob ()
        }
 
        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));
        }
 }
 
@@ -336,7 +336,7 @@ Hints::check_loudness ()
                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
                                        )
@@ -540,7 +540,7 @@ Hints::closed_caption (PlayerText text, DCPTimePeriod period)
                        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,
@@ -551,7 +551,7 @@ Hints::closed_caption (PlayerText text, DCPTimePeriod period)
        }
 
        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;
        }
 
index 8e6c5717b9064025a1adb03a619731a13835b347..591727ba5d06bfa0a6adcf08ce09b7712146b646 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 
-#include "compose.hpp"
 #include "dcpomatic_socket.h"
 #include "exceptions.h"
 #include "image.h"
@@ -32,6 +31,7 @@
 #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
@@ -1384,7 +1384,7 @@ png_error_fn (png_structp png_ptr, char const * message)
 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
index 517d6792f89715d16f83edcaa60779f40a7e99ee..b0d25362425352a76624eb8fe492380d6286ae32 100644 (file)
 #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>
index 89d1517ce5abf380d9e30c3a09777bd17a5a0293..d94891c6e180f1dc6650629a1fc7898387f40386 100644 (file)
@@ -26,9 +26,9 @@
 #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>
@@ -62,7 +62,7 @@ ImageExaminer::ImageExaminer (shared_ptr<const Film> film, shared_ptr<const Imag
                        _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 {
index ca72399f3f547076bafcceb707dfa7f7e44d70e2..648e4b1a97409e0018e0d004d57b537de8fcef9d 100644 (file)
 
 
 #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>
@@ -118,7 +118,7 @@ get_from_url (string url, bool pasv, bool skip_pasv_ip, ScopedTemporary& temp)
        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>();
@@ -173,7 +173,7 @@ get_from_zip_url (string url, string file, bool pasv, bool skip_pasv_ip, functio
        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
index 5dee5ca35af998c07ed1ebcc76684b25c946563c..c3f308508e14d356dc2f9a54d315bab3029a937e 100644 (file)
@@ -37,7 +37,7 @@
 #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>
 
index 52558046ae8ec66ecd580194bf3f51558efd504e..9aeaf800a7a0229f24e5b133d995494bb25533c9 100644 (file)
@@ -29,7 +29,7 @@
 #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>
@@ -95,7 +95,7 @@ Job::start ()
 void
 Job::run_wrapper ()
 {
-       start_of_thread (String::compose("Job-%1", json_name()));
+       start_of_thread (dcp::compose("Job-%1", json_name()));
 
        try {
 
@@ -103,7 +103,7 @@ Job::run_wrapper ()
 
        } 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());
@@ -158,8 +158,8 @@ Job::run_wrapper ()
        } 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()
@@ -173,8 +173,8 @@ Job::run_wrapper ()
 
                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()
@@ -443,7 +443,7 @@ void
 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);
@@ -488,19 +488,19 @@ Job::status () const
                        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");
        }
index 61e6c08ce9e66fa738300b9a417267356f71a8b6..24b54f93f404de769a8927542af78586e644581b 100644 (file)
@@ -44,11 +44,11 @@ Nanomsg::Nanomsg (bool server)
        }
        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));
                }
        }
 }
@@ -73,7 +73,7 @@ Nanomsg::send (string s, int timeout)
                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)");
        }
index 5de089ba91aa9ad297bbe299a2b2ad9b076ec76e..3080fccd8f01f554c833075542b5ab537c8be548 100644 (file)
@@ -49,9 +49,9 @@
 #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>
@@ -723,7 +723,7 @@ Player::pass ()
                        /* 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;
@@ -1265,7 +1265,7 @@ Player::emit_audio (shared_ptr<AudioBuffers> data, DCPTime 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 */
index e8714e9d6d4ffedac4ab9dd6fc6ae83ee1efe66b..bf2f3d7347c403159b7a6fe39e64956ced59f98a 100644 (file)
@@ -32,7 +32,7 @@
 #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>
@@ -219,12 +219,12 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
                        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
                                        );
@@ -239,12 +239,12 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
                        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
                                        );
index 521ba55df891f226393fdb7a6d12e5b139ebe6de..24d25b4fa423b223058cd8c5e0cfd579c4cffa08 100644 (file)
 #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>
@@ -415,7 +415,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
                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
                                );
                }
 
@@ -432,7 +432,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
                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
                                );
                }
 
@@ -511,7 +511,7 @@ maybe_add_text (
                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);
@@ -557,7 +557,7 @@ ReelWriter::create_reel_picture (shared_ptr<dcp::Reel> reel, list<ReferencedReel
        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);
@@ -609,7 +609,7 @@ ReelWriter::create_reel_sound (shared_ptr<dcp::Reel> reel, list<ReferencedReelAs
                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)
                                );
                }
 
index 056b2e1ee5c6416e779c7062f48346a858d77923..30164ca21914b8cff27af280de8aa1f2ed66827c 100644 (file)
@@ -22,8 +22,8 @@
 #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>
@@ -51,7 +51,7 @@ Resampler::Resampler (int in, int out, int channels)
        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));
        }
 }
 
@@ -73,7 +73,7 @@ Resampler::set_fast ()
        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));
        }
 }
 
@@ -117,7 +117,7 @@ Resampler::run (shared_ptr<const AudioBuffers> in)
                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,
@@ -173,7 +173,7 @@ Resampler::flush ()
 
        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);
index 9c349f233084efadcd370e91001141346c71d07b..9373346ef42baff341f38d26c4443773877b527f 100644 (file)
@@ -24,8 +24,8 @@
 #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"
@@ -42,7 +42,7 @@ SCPUploader::SCPUploader (function<void (string)> set_status, function<void (flo
 {
        _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());
@@ -52,29 +52,29 @@ SCPUploader::SCPUploader (function<void (string)> set_status, function<void (flo
 
        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)));
        }
 }
 
@@ -93,7 +93,7 @@ SCPUploader::create_directory (boost::filesystem::path directory)
        /* 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)));
        }
 }
 
@@ -107,7 +107,7 @@ SCPUploader::upload_file (boost::filesystem::path from, boost::filesystem::path
 
        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;
@@ -124,7 +124,7 @@ SCPUploader::upload_file (boost::filesystem::path from, boost::filesystem::path
                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;
index 67ddd0eef540d055a2eeeb10285b662c393758be..1ed042130469927124e9d680d7d6ad8b91e5419e 100644 (file)
@@ -20,9 +20,9 @@
 
 
 #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"
@@ -89,7 +89,7 @@ SendKDMEmailJob::name () const
                return _("Email KDMs");
        }
 
-       return String::compose (_("Email KDMs for %2"), *f);
+       return dcp::compose (_("Email KDMs for %2"), *f);
 }
 
 
index c4d5a65183ca93484e9b225628e46a59d836f3a1..2e272a454b791ac98a5cd7df2843cc063dfaa6e0 100644 (file)
@@ -23,7 +23,7 @@
 #include "exceptions.h"
 #include "config.h"
 #include "emailer.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <list>
 
 #include "i18n.h"
index 6ab83ee6211d6bea24b93fb6e6367f367d93f979..fc5028ae4ec4d1fb4916ee7c8fc1bd17ad25cb74 100644 (file)
@@ -20,7 +20,6 @@
 
 
 #include "send_problem_report_job.h"
-#include "compose.hpp"
 #include "film.h"
 #include "cross.h"
 #include "film.h"
@@ -28,6 +27,7 @@
 #include "version.h"
 #include "emailer.h"
 #include "environment_info.h"
+#include <dcp/compose.h>
 #include <libxml++/libxml++.h>
 
 #include "i18n.h"
@@ -68,7 +68,7 @@ SendProblemReportJob::name () const
                return _("Email problem report");
        }
 
-       return String::compose (_("Email problem report for %1"), _film->name());
+       return dcp::compose (_("Email problem report for %1"), _film->name());
 }
 
 
index 5a4faf4d15fa4c0f74617bd2bd03ecd57f1ba114..16c9bb05be80082df82cfe066fd343c5528dae63 100644 (file)
@@ -84,8 +84,8 @@ Shuffler::video (weak_ptr<Piece> weak_piece, ContentVideo video)
                                );
 
                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);
                }
 
index ba47e1231067f917e2ada7e160c3c2e21302aa94..531c9cdcb76119c56588efa2a7b25e5cc003c7f8 100644 (file)
 */
 
 
-#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>
@@ -72,7 +72,7 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j
                        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;
                        }
index 0a7bdf95da75ffc32f428d095929d8b891bb4b0d..3b28b7e12993d408bcc60f21efb58617097fcb36 100644 (file)
@@ -23,7 +23,7 @@
 #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>
index caef89e0e98e5c413539c0851216acde96f6f797..6f40727472da74777c5f22da400060c1b24b83db 100644 (file)
@@ -24,9 +24,9 @@
  */
 
 
-#include "compose.hpp"
 #include "timer.h"
 #include "util.h"
+#include <dcp/compose.h>
 #include <sys/time.h>
 #include <iostream>
 
@@ -130,7 +130,7 @@ StateTimer::~StateTimer ()
                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) {
index 3502c3346c48072824f04f22936dba0fcc04ba83..463a3c7bd2f48543bb1a45fe7dd418c057c78c97 100644 (file)
@@ -25,7 +25,6 @@
 
 
 #include "analytics.h"
-#include "compose.hpp"
 #include "config.h"
 #include "dcp_encoder.h"
 #include "dcpomatic_log.h"
@@ -35,6 +34,7 @@
 #include "log.h"
 #include "transcode_job.h"
 #include "upload_job.h"
+#include <dcp/compose.h>
 #include <iomanip>
 #include <iostream>
 
@@ -68,7 +68,7 @@ TranscodeJob::~TranscodeJob ()
 string
 TranscodeJob::name () const
 {
-       return String::compose (_("Transcoding %1"), _film->name());
+       return dcp::compose (_("Transcoding %1"), _film->name());
 }
 
 
index 228ebf28f6d47bc442e12d8b4f43540c66ae1189..9e87481591273b2b0dd60de3691f48afe58d9fd1 100644 (file)
 */
 
 #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>
@@ -112,7 +112,7 @@ string_to_text_type (string s)
        } 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));
        }
 }
 
index 113e3a7e88bd8740456b6e8a30b7ace771f38621..e88b3aaf8aa9bdb8073bc1b86e133b6e975baa5f 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 
-#include "compose.hpp"
 #include "config.h"
 #include "curl_uploader.h"
 #include "dcpomatic_log.h"
@@ -32,6 +31,7 @@
 #include "log.h"
 #include "scp_uploader.h"
 #include "upload_job.h"
+#include <dcp/compose.h>
 #include <iostream>
 
 #include "i18n.h"
index c5448e469b8c3175ab750496ae4672964cceeb08..11fb55f35c616a721867a5128a726edb5ea1beeb 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "uploader.h"
 #include "dcpomatic_assert.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 
 #include "i18n.h"
 
@@ -76,7 +76,7 @@ Uploader::upload_directory (boost::filesystem::path base, boost::filesystem::pat
                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);
                }
        }
index a3c8c50820d3c5bca94f13e0fb52935eb933167d..8903eae1d91d59ab65bd415e3feda7a78dc77fba 100644 (file)
@@ -36,7 +36,6 @@
 #include "digester.h"
 #include "audio_processor.h"
 #include "crypto.h"
-#include "compose.hpp"
 #include "audio_buffers.h"
 #include "string_text.h"
 #include "font.h"
@@ -46,6 +45,7 @@
 #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>
@@ -385,7 +385,7 @@ DCPOMATIC_ENABLE_WARNINGS
 
 #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
@@ -452,11 +452,11 @@ dcpomatic_setup_gettext_i18n (string lang)
                /* 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 ()));
        }
 
@@ -881,7 +881,7 @@ checked_fwrite (void const * ptr, size_t size, FILE* stream, boost::filesystem::
        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);
@@ -896,7 +896,7 @@ checked_fread (void* ptr, size_t size, FILE* stream, boost::filesystem::path pat
        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);
index 5686a0a6ff7f2a14f31a1a109fb32345131264ed..054c91873df225f64921e524c3fac16e1641bc87 100644 (file)
@@ -21,7 +21,6 @@
 #include "video_content.h"
 #include "content.h"
 #include "video_examiner.h"
-#include "compose.hpp"
 #include "ratio.h"
 #include "config.h"
 #include "colour_conversion.h"
@@ -31,6 +30,7 @@
 #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>
@@ -354,7 +354,7 @@ VideoContent::identifier () const
 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,
@@ -362,7 +362,7 @@ VideoContent::technical_summary () const
                );
 
        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;
@@ -426,7 +426,7 @@ VideoContent::processing_description (shared_ptr<const Film> film)
        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
@@ -447,7 +447,7 @@ VideoContent::processing_description (shared_ptr<const Film> film)
 
        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
                        );
@@ -460,7 +460,7 @@ VideoContent::processing_description (shared_ptr<const Film> film)
        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
                        );
@@ -470,7 +470,7 @@ VideoContent::processing_description (shared_ptr<const Film> film)
        }
 
        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
@@ -497,7 +497,7 @@ void
 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
index ce42f428f6711c460bc37632cf26418796f990c6..a05c30f64039aa9b34448427e09311b62721826a 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 
-#include "compose.hpp"
 #include "film.h"
 #include "frame_interval_checker.h"
 #include "image.h"
@@ -27,6 +26,7 @@
 #include "log.h"
 #include "raw_image_proxy.h"
 #include "video_decoder.h"
+#include <dcp/compose.h>
 #include <iostream>
 
 #include "i18n.h"
@@ -82,7 +82,7 @@ VideoDecoder::emit (shared_ptr<const Film> film, shared_ptr<const ImageProxy> im
                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)
index a61da6773bbb8517330895aa2a8b01eae3e39c76..87915fff7d09ba7f09c6d465b63ae554c79429f7 100644 (file)
 */
 
 
-#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>
@@ -63,7 +63,7 @@ VideoFilterGraph::process (AVFrame* frame)
        } 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) {
index c7ee69d8932c647b62835ef5d12b5a82ab0ea391..20ff3d3fca8237f7d7af933aa85f5937eb24582c 100644 (file)
@@ -24,8 +24,8 @@
 #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>
@@ -102,7 +102,7 @@ VideoMXFContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 string
 VideoMXFContent::summary () const
 {
-       return String::compose (_("%1 [video]"), path_summary());
+       return dcp::compose (_("%1 [video]"), path_summary());
 }
 
 
index 63c52ee068879c0b262268ca94589b8c80928781..0ac09797743e8efca67fe609b0bf6510077eda22 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "video_ring_buffers.h"
 #include "player_video.h"
-#include "compose.hpp"
+#include <dcp/compose.h>
 #include <list>
 #include <iostream>
 
@@ -89,7 +89,7 @@ VideoRingBuffers::memory_used () const
        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()));
 }
 
 
index 6b80768752b0c3db80a2091aacad6b983c64135e..6bb3afd0e444676ef289df29a6b1114ca17ba716 100644 (file)
@@ -20,7 +20,6 @@
 
 
 #include "writer.h"
-#include "compose.hpp"
 #include "film.h"
 #include "ratio.h"
 #include "log.h"
@@ -37,6 +36,7 @@
 #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>
@@ -616,12 +616,12 @@ Writer::finish (boost::filesystem::path output_dcp)
 
        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);
@@ -746,13 +746,13 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp)
        }
 
        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");
@@ -766,11 +766,11 @@ Writer::write_cover_sheet (boost::filesystem::path output_dcp)
        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);
index 24c5bd5ecae4624758f36f40b1c66fa687c09ce0..99084c8d6ccdc5cba85c259390d38a3625fe7906 100644 (file)
@@ -74,7 +74,6 @@
 #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"
@@ -87,6 +86,7 @@
 #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
@@ -1030,14 +1030,14 @@ private:
 #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"));
                                }
@@ -1046,7 +1046,7 @@ private:
 #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"));
                }
@@ -1444,7 +1444,7 @@ private:
                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();
                        }
@@ -1638,7 +1638,7 @@ private:
                                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()));
                                }
                        }
 
index 06147060267d60e7ac17281ce4985a0c73b928e5..08cd7248b7ce52307f1e83c246422255b11a0a72 100644 (file)
@@ -26,7 +26,6 @@
 #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"
@@ -35,6 +34,7 @@
 #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>
@@ -454,7 +454,7 @@ class App : public wxApp
                                } 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())
                                                );
                                }
index 4a783d6346f65679d289a29035199b7401c24bc4..0f6004bd27924819e2ef9b0a13b8b178694fe232 100644 (file)
@@ -152,7 +152,7 @@ private:
                        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())
                                            )
@@ -162,7 +162,7 @@ private:
                } 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;
                }
index 7e43c068469ae74149671ca1124971e9d7f46727..563620693e90e054fe2d32bdd2f201028452ba40 100644 (file)
@@ -202,7 +202,7 @@ private:
 #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
 
index c638b72ebd8bf927f30185742d4587fd85f62710..ca6618125ccc675bfadc35bec153c98e4623282c 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 
-#include "lib/compose.hpp"
 #include "lib/cross.h"
 #include "lib/dcpomatic_log.h"
 #include "lib/digester.h"
@@ -30,6 +29,7 @@
 #include "lib/nanomsg.h"
 #include "lib/version.h"
 #include "lib/warnings.h"
+#include <dcp/compose.h>
 
 #ifdef DCPOMATIC_POSIX
 #include <sys/ioctl.h>
index 4d84f2f339e02af8dc9312e7bc4e60bc96616541..c83beec74dba3088d0e53604e001fbaa5c45de32 100644 (file)
@@ -36,7 +36,6 @@
 #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"
@@ -46,6 +45,7 @@
 #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>
index 112f2c0654b463ef711d414188a7cf9605f7fdac..16847911cff510ba27e67fb8d79072cd56a031be 100644 (file)
@@ -38,7 +38,6 @@
 #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"
@@ -56,6 +55,7 @@
 #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>
@@ -694,7 +694,7 @@ private:
                        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()));
                        }
                }
        }
@@ -955,7 +955,7 @@ private:
                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();
                        }
@@ -1164,7 +1164,7 @@ private:
                                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()));
                                }
                        }
 
index 401fb1077d047c83921f329d1570f8413f6fe3ae..825098e9be94cde369633060292887c6d96baf98 100644 (file)
@@ -241,7 +241,7 @@ public:
 #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;
index 73c569282621c11f8c1a167e999e703ac972bcda..3a2558f1493d646d95afa90eb5fa2ae5513fd343 100644 (file)
@@ -26,8 +26,8 @@
 #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>
@@ -57,9 +57,9 @@ AboutDialog::AboutDialog (wxWindow* parent)
 
        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));
index 90a4aa91df39b5a5cc468ba8a3850b0b5f4b2ba4..cfb08eb54a2de1d22fa098864e009c2dbc952320 100644 (file)
@@ -24,7 +24,7 @@
 #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>
@@ -190,7 +190,7 @@ AudioPlot::paint ()
                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)));
index a1d6167aacf6ab553b85eda94c4806cc81f0b03c..25ec3511c68371748421331d317d4d27262e5154 100644 (file)
@@ -22,8 +22,8 @@
 #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;
@@ -55,7 +55,7 @@ void
 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(),
index ab131e015cf0ba95135cef0693e38e2b2b743634..77a067fb555f4dcb8c3b8747f6c5d4c6bc6b4221 100644 (file)
@@ -22,8 +22,8 @@
 #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;
@@ -50,7 +50,7 @@ ChristieCertificatePanel::ChristieCertificatePanel (DownloadCertificateDialog* d
 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()
@@ -59,7 +59,7 @@ ChristieCertificatePanel::do_download ()
        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;
@@ -68,7 +68,7 @@ ChristieCertificatePanel::do_download ()
        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) {
index 7fcfc0808667a4d0d0271cda359044da98c5a088..73ad98a26e84f772df9b6079f4d48b0078d66bf9 100644 (file)
@@ -24,7 +24,7 @@
 #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;
@@ -249,7 +249,7 @@ ClosedCaptionsDialog::update_tracks (shared_ptr<const Film> film)
 
        _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) {
index bcc6999139f248255b1ad2f61ca3697ddc1e87ef..5c2b19f618c78f906b4dd42f169c038b7eb714be 100644 (file)
@@ -31,7 +31,6 @@
 #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"
@@ -45,6 +44,7 @@
 #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>
index 9c236abebfef4a1b552b5e8b5f084a283f569a1d..a43a5fc94789e378ca7efc07491c5365f6a68e16 100644 (file)
@@ -22,8 +22,8 @@
 #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;
index 817867cc108055bfb2d37d3747c6484047dbad24..6049a6818cb63ca9b801770589f05e757c28a360 100644 (file)
 #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>
@@ -53,30 +53,30 @@ DolbyDoremiCertificatePanel::DolbyDoremiCertificatePanel (DownloadCertificateDia
 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));
 }
 
 
@@ -92,11 +92,11 @@ try_cat862 (list<string>& urls, list<string>& files, string prefix, string seria
                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));
 }
 
 
@@ -112,11 +112,11 @@ try_dsp100 (list<string>& urls, list<string>& files, string prefix, string seria
                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));
 }
 
 
@@ -132,11 +132,11 @@ try_cat745 (list<string>& urls, list<string>& files, string prefix, string seria
                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));
 }
 
 
@@ -146,16 +146,16 @@ try_cp850 (list<string>& urls, list<string>& files, string prefix, string serial
        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));
 }
 
 
index c30b050081db913327807ff6ec36ae66fa075892..b4bdd1ce45fb1568d2524a7ff062a27d57617d69 100644 (file)
@@ -22,9 +22,9 @@
 #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>
@@ -63,7 +63,7 @@ DownloadCertificatePanel::load_certificate (boost::filesystem::path file)
        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 {};
 }
@@ -75,7 +75,7 @@ DownloadCertificatePanel::load_certificate_from_chain (boost::filesystem::path f
        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 {};
 }
index 516ed86ae9cbf0fbc3e6ba960b797b31a141994d..55e5a534d371d7c3c44f82732e814c7db14dc3d6 100644 (file)
@@ -26,7 +26,7 @@
 #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>
 
@@ -139,7 +139,7 @@ FilmNameLocationDialog::check_path ()
                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())
                                    )
@@ -149,7 +149,7 @@ FilmNameLocationDialog::check_path ()
        } 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;
        }
index 4ea2a8b006b4a1fee6cac30e4c04fda735d00d52..031c0015476f83f6241a90f036f4511fc8de4856 100644 (file)
 #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>
index f7f86895df931eaaf307d0277a2b1c2914d74465..555c1b232b001c1cfa3ae51ddea719a0df7c0f83 100644 (file)
@@ -22,8 +22,8 @@
 #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;
@@ -54,7 +54,7 @@ GDCCertificatePanel::do_download ()
                /* 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(),
index 19243393c308dc174e7ee7bda14c1699f183df8d..e49227ef16841c0664112467996f245b6f1cb549 100644 (file)
@@ -33,7 +33,7 @@
 #include "lib/job.h"
 #include "lib/util.h"
 #include "lib/exceptions.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
 #include <iostream>
 
 
index 231176e4fd96c773d1f96a779de648647f0ddf3a..cb1a9fcdd549a0966273f7d34694c4dea407a750 100644 (file)
 #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>
 
index b2c11b50c8ad385a12fd1b2efd364e3b2a1728f2..969cd60769908e68f9e4c252d5e7514c43430c66 100644 (file)
@@ -44,7 +44,7 @@ NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp:
        _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);
index 596b427409c2447ec621a80d66abe3b8906d62d3..972f3265586a57b92941552debabef1c9dd2aa1a 100644 (file)
@@ -23,8 +23,8 @@
 #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>
index f0eaa59bbea8e643ce7900f332fc3836e824061e..ae5ebe617f38d62e430bb5086a374cca293e168a 100644 (file)
 #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;
@@ -157,7 +157,7 @@ PlayerInformation::triggered_update ()
        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)
index d65cb0fccaf2999574405a86c73017823916cba3..b935b0ba2dfea54f79d4e1a5da00ee9455d65f7d 100644 (file)
@@ -30,7 +30,7 @@
 #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>
index e1c6bfb41ae2c4dca09c902efadc38d7544fc9aa..403fff6953b8f2143c9e5e4be7e8fabac33979c1 100644 (file)
@@ -23,8 +23,8 @@
 #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>
 
 
@@ -50,7 +50,7 @@ QubeCertificatePanel::QubeCertificatePanel (DownloadCertificateDialog* dialog, s
 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;
@@ -59,7 +59,7 @@ QubeCertificatePanel::do_download ()
        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;
                }
@@ -71,7 +71,7 @@ QubeCertificatePanel::do_download ()
                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(""));
index d59226a96e94abb2e101de54e047188e62c01a57..b6638edd8ed739f89d3151308b6875edf8a8025f 100644 (file)
@@ -25,8 +25,8 @@
 #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"
index 8da8f061e7c93d47871b49efc02a8a55fdca9401..e438ca87ed52a35700e7d994f6b5e63cbe5c5ace 100644 (file)
@@ -26,9 +26,9 @@
 #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
index 975f7cd9d6c375802c1b684296e2ff8138fcd21e..8f4ea0cead7cbe28a97d6e999bd2bb7f7f4bff31 100644 (file)
@@ -23,9 +23,9 @@
 #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>
index a0beb8f72d0f4e7ac92b7be74e2b06ae52b756af..b0ed81cc4ebb5bd759bbb2c23a1de60648267f86 100644 (file)
@@ -646,7 +646,7 @@ bitmap_path (string name)
        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());
 }
 
index f34c295831db4dc8ee0b676770ccea7ba1ec6c18..0e57d54e426702bfb4791f24d2c4ff75ec0d5db5 100644 (file)
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
        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);
@@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
        }
 
        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 }
                );
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
 
        /* 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);
index 59a8cb7a772f8b7d92dbf0c98aa964df2e812f1e..0a155d8ba2757b74395da72d7eb8d32b8f0b0b00 100644 (file)
@@ -28,9 +28,9 @@
 #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>
@@ -46,7 +46,7 @@ using std::make_shared;
 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;
index d0bce03567065c24860fb9ab63faeb78baa460ff..62c55e6829570f2d899c40ff4e6cc0238a0e8d87 100644 (file)
@@ -20,7 +20,6 @@
 
 
 #include "lib/audio_content.h"
-#include "lib/compose.hpp"
 #include "lib/content_factory.h"
 #include "lib/dcp_content.h"
 #include "lib/ffmpeg_content.h"
@@ -34,6 +33,7 @@
 #include "lib/transcode_job.h"
 #include "lib/video_content.h"
 #include "test.h"
+#include <dcp/compose.h>
 #include <boost/test/unit_test.hpp>
 
 
@@ -65,7 +65,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
                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);
@@ -74,7 +74,7 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
 
        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 ();
index 263f02435a70a4a419718aea3209b93ec84ef6c7..827427222d7bf5bef99d560b61523a37ebb450c6 100644 (file)
@@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_too_long)
        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)
              );
 }
 
@@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE (hint_many_closed_caption_lines)
        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)
              );
 }
 
@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
        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);
        }
@@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
 
        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);
index eb662a120e14da3c86f26b8330b0f3e57d44af92..b6d5a731a23265a302351b34aeec6f1c53ea8cc5 100644 (file)
@@ -26,7 +26,7 @@
 
 
 #include "lib/image_filename_sorter.h"
-#include "lib/compose.hpp"
+#include <dcp/compose.h>
 #include <boost/test/unit_test.hpp>
 
 
@@ -67,11 +67,11 @@ BOOST_AUTO_TEST_CASE (image_filename_sorter_test2)
 {
        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));
        }
 }
index 3993b3efbdeaf7f99e4cff9f4b1f04caf4d7c4dd..c461a93d3c204bffbd3029a91ea834318cd5ff52 100644 (file)
  */
 
 
-#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>
 
@@ -364,7 +364,7 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test7)
                        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);
        }
index f692c165d6edde466efde8dcf97a58ea036c7e82..a78d0a12db4142acaa45c7413bc9852705dcc12f 100644 (file)
@@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
        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");
 }
 
@@ -195,36 +195,36 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
 
        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");
 }
index 844f25660a34d82d4c7aea3330632f90fa197ec1..a2d5814232a0351fd3b0f65b3714f770617e4739 100644 (file)
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (automatic_ffoc_lfoc_markers_test1)
        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();
@@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE (automatic_ffoc_lfoc_markers_test2)
                        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();
index c325537fa80a18908049188f5ade4b83ba9e7c76..08fa5eb18e76ed7fe707192baaf0993a11b9830e 100644 (file)
@@ -38,9 +38,9 @@
 #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>
@@ -242,12 +242,12 @@ BOOST_AUTO_TEST_CASE (player_seek_test)
                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);
        }
 }
 
@@ -277,9 +277,9 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
                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);
        }
 }
 
index e198b78f93c9cd350cb8923dc4c8f9c8f1f8e888..2ee0da3366f082651f1e2e4ca58319f915fba11f 100644 (file)
@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE (subtitle_language_interop_test)
                        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()));
 }
 
 
@@ -79,6 +79,6 @@ BOOST_AUTO_TEST_CASE (subtitle_language_smpte_test)
                        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()));
 }
 
index 4dab0cff1b5895c0e197e19c0db140092662757e..7720fa3b7ca4e70f97eb9bd44916dd2baa3cda84 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 
-#include "lib/compose.hpp"
 #include "lib/config.h"
 #include "lib/cross.h"
 #include "lib/dcp_content_type.h"
@@ -42,6 +41,7 @@
 #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>
@@ -754,7 +754,7 @@ write_image (shared_ptr<const Image> image, boost::filesystem::path file)
 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);
 }
 
index f98464fb5810329d20a6a6903ed2b175bc4fb9b6..06d05c1d8bf1d3c138e97e4167bd93581170117d 100644 (file)
@@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE (threed_test7)
                }
        }
        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 ()) {}