From 2cdf3d9f461b12d0925cc54368105bbd177bbbb3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 31 Aug 2019 02:03:01 +0100 Subject: Primitive subtitle export feature. --- src/lib/subtitle_encoder.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/lib/subtitle_encoder.h (limited to 'src/lib/subtitle_encoder.h') diff --git a/src/lib/subtitle_encoder.h b/src/lib/subtitle_encoder.h new file mode 100644 index 000000000..50485750d --- /dev/null +++ b/src/lib/subtitle_encoder.h @@ -0,0 +1,60 @@ +/* + Copyright (C) 2019 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#include "types.h" +#include "player_text.h" +#include "dcp_text_track.h" +#include "encoder.h" +#include "dcpomatic_time.h" +#include + +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 film, boost::shared_ptr job, boost::filesystem::path output, bool split_reels); + + void go (); + + /** @return the number of frames that are done */ + Frame frames_done () const; + + bool finishing () const { + return false; + } + +private: + void text (PlayerText subs, TextType type, boost::optional track, dcpomatic::DCPTimePeriod period); + + std::vector, boost::filesystem::path> > _assets; + std::vector _reels; + bool _split_reels; + int _reel_index; + boost::optional _last; + dcpomatic::DCPTime _length; +}; -- cgit v1.2.3