Account for split branch in libdcp.
[dcpomatic.git] / src / lib / subtitle_encoder.cc
index 4ce894afb6364849f61cac057e9c3e03b75b0446..89e5215889df461173b78e64d1f42e4a8865be69 100644 (file)
 #include "job.h"
 #include "player.h"
 #include "subtitle_encoder.h"
-#include <dcp/interop_subtitle_asset.h>
+#include <dcp/filesystem.h>
+#include <dcp/interop_text_asset.h>
 #include <dcp/raw_convert.h>
-#include <dcp/smpte_subtitle_asset.h>
+#include <dcp/smpte_text_asset.h>
 #include <boost/filesystem.hpp>
 #include <boost/bind/bind.hpp>
 
@@ -68,7 +69,7 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j
        for (int i = 0; i < files; ++i) {
 
                boost::filesystem::path filename = output;
-               if (boost::filesystem::is_directory(filename)) {
+               if (dcp::filesystem::is_directory(filename)) {
                        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.
@@ -78,7 +79,7 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j
                        }
                }
 
-               _assets.push_back (make_pair(shared_ptr<dcp::SubtitleAsset>(), boost::filesystem::change_extension(filename, extension)));
+               _assets.push_back(make_pair(shared_ptr<dcp::TextAsset>(), dcp::filesystem::change_extension(filename, extension)));
        }
 
        for (auto i: film->reels()) {
@@ -107,12 +108,12 @@ SubtitleEncoder::go ()
                if (!i.first) {
                        /* No subtitles arrived for this asset; make an empty one so we write something to the output */
                        if (_film->interop()) {
-                               auto s = make_shared<dcp::InteropSubtitleAsset>();
+                               auto s = make_shared<dcp::InteropTextAsset>();
                                s->set_movie_title (_film->name());
                                s->set_reel_number (raw_convert<string>(reel + 1));
                                i.first = s;
                        } else {
-                               auto s = make_shared<dcp::SMPTESubtitleAsset>();
+                               auto s = make_shared<dcp::SMPTETextAsset>();
                                s->set_content_title_text (_film->name());
                                s->set_reel_number (reel + 1);
                                i.first = s;
@@ -139,10 +140,10 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
        }
 
        if (!_assets[_reel_index].first) {
-               shared_ptr<dcp::SubtitleAsset> asset;
+               shared_ptr<dcp::TextAsset> asset;
                auto lang = _film->subtitle_languages ();
                if (_film->interop ()) {
-                       auto s = make_shared<dcp::InteropSubtitleAsset>();
+                       auto s = make_shared<dcp::InteropTextAsset>();
                        s->set_movie_title (_film->name());
                        if (lang.first) {
                                s->set_language (lang.first->to_string());
@@ -150,7 +151,7 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
                        s->set_reel_number (raw_convert<string>(_reel_index + 1));
                        _assets[_reel_index].first = s;
                } else {
-                       auto s = make_shared<dcp::SMPTESubtitleAsset>();
+                       auto s = make_shared<dcp::SMPTETextAsset>();
                        s->set_content_title_text (_film->name());
                        if (lang.first) {
                                s->set_language (*lang.first);
@@ -175,7 +176,7 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
                if (_film->interop() && !_include_font) {
                        i.unset_font ();
                }
-               _assets[_reel_index].first->add (make_shared<dcp::SubtitleString>(i));
+               _assets[_reel_index].first->add(make_shared<dcp::TextString>(i));
        }
 
        if (_split_reels && (_reel_index < int(_reels.size()) - 1) && period.from > _reels[_reel_index].from) {