/*
- Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
-#include "types.h"
-#include "player_text.h"
+
#include "dcp_text_track.h"
-#include "encoder.h"
#include "dcpomatic_time.h"
-#include <boost/weak_ptr.hpp>
+#include "encoder.h"
+#include "player_text.h"
+
namespace dcp {
class SubtitleAsset;
}
+
class Film;
+
/** @class SubtitleEncoder.
* @brief An `encoder' which extracts a film's subtitles to DCP XML format.
*/
class SubtitleEncoder : public Encoder
{
public:
- SubtitleEncoder (boost::shared_ptr<const Film> film, boost::shared_ptr<Job> job, boost::filesystem::path output, bool split_reels);
+ SubtitleEncoder (std::shared_ptr<const Film> film, std::shared_ptr<Job> job, boost::filesystem::path output, std::string initial_name, bool split_reels, bool include_font);
- void go ();
+ void go () override;
/** @return the number of frames that are done */
- Frame frames_done () const;
+ Frame frames_done () const override;
- bool finishing () const {
+ bool finishing () const override {
return false;
}
private:
void text (PlayerText subs, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period);
- std::vector<std::pair<boost::shared_ptr<dcp::SubtitleAsset>, boost::filesystem::path> > _assets;
+ std::vector<std::pair<std::shared_ptr<dcp::SubtitleAsset>, boost::filesystem::path>> _assets;
std::vector<dcpomatic::DCPTimePeriod> _reels;
bool _split_reels;
+ bool _include_font;
int _reel_index;
boost::optional<dcpomatic::DCPTime> _last;
dcpomatic::DCPTime _length;
+ dcp::ArrayData _default_font;
};