/*
- Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
class SubtitleDecoder : public DecoderPart
{
public:
- /** Second parameter to the _during functions is true if we
- * want only subtitles that start during the period,
- * otherwise we want subtitles that overlap the period.
- */
SubtitleDecoder (
Decoder* parent,
boost::shared_ptr<const SubtitleContent>,
- boost::shared_ptr<Log> log
+ boost::shared_ptr<Log> log,
+ ContentTime first
);
- void set_position (ContentTime position) {
- _position = position;
- }
-
- boost::optional<ContentTime> position () const {
+ ContentTime position () const {
return _position;
}
- void emit_image (ContentTimePeriod period, boost::shared_ptr<Image>, dcpomatic::Rect<double>);
- void emit_text (ContentTimePeriod period, std::list<dcp::SubtitleString>);
+ void emit_image_start (ContentTime from, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect);
+ void emit_text_start (ContentTime from, std::list<dcp::SubtitleString> s);
+ void emit_text_start (ContentTime from, sub::Subtitle const & subtitle);
+ void emit_text (ContentTimePeriod period, std::list<dcp::SubtitleString> s);
void emit_text (ContentTimePeriod period, sub::Subtitle const & subtitle);
+ void emit_stop (ContentTime to);
+
+ void seek ();
boost::shared_ptr<const SubtitleContent> content () const {
return _content;
}
- boost::signals2::signal<void (ContentImageSubtitle)> ImageData;
- boost::signals2::signal<void (ContentTextSubtitle)> TextData;
+ boost::signals2::signal<void (ContentImageSubtitle)> ImageStart;
+ boost::signals2::signal<void (ContentTextSubtitle)> TextStart;
+ boost::signals2::signal<void (ContentTime)> Stop;
private:
boost::shared_ptr<const SubtitleContent> _content;
- boost::optional<ContentTime> _position;
+ ContentTime _position;
};
#endif