* @param period Period of interest.
* @param always_burn_subtitles Always burn subtitles even if their content is not set to burn.
*/
-list<PlayerSubtitles>
+list<PlayerText>
ActiveSubtitles::get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const
{
- list<PlayerSubtitles> ps;
+ list<PlayerText> ps;
for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) {
* @param from From time for these subtitles.
*/
void
-ActiveSubtitles::add_from (weak_ptr<Piece> piece, PlayerSubtitles ps, DCPTime from)
+ActiveSubtitles::add_from (weak_ptr<Piece> piece, PlayerText ps, DCPTime from)
{
if (_data.find(piece) == _data.end()) {
_data[piece] = list<Period>();
* @param to To time for the last subtitle submitted to add_from for this piece.
* @return Return the corresponding subtitles and their from time.
*/
-pair<PlayerSubtitles, DCPTime>
+pair<PlayerText, DCPTime>
ActiveSubtitles::add_to (weak_ptr<Piece> piece, DCPTime to)
{
DCPOMATIC_ASSERT (_data.find(piece) != _data.end());
_data[piece].back().to = to;
- BOOST_FOREACH (SubtitleString& i, _data[piece].back().subs.text) {
+ BOOST_FOREACH (PlainText& i, _data[piece].back().subs.text) {
i.set_out (dcp::Time(to.seconds(), 1000));
}
/*
- Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2017-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
#include "dcpomatic_time.h"
-#include "player_subtitles.h"
+#include "player_text.h"
#include <boost/noncopyable.hpp>
#include <list>
#include <map>
class ActiveSubtitles : public boost::noncopyable
{
public:
- std::list<PlayerSubtitles> get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const;
+ std::list<PlayerText> get_burnt (DCPTimePeriod period, bool always_burn_subtitles) const;
void clear_before (DCPTime time);
void clear ();
- void add_from (boost::weak_ptr<Piece> piece, PlayerSubtitles ps, DCPTime from);
- std::pair<PlayerSubtitles, DCPTime> add_to (boost::weak_ptr<Piece> piece, DCPTime to);
+ void add_from (boost::weak_ptr<Piece> piece, PlayerText ps, DCPTime from);
+ std::pair<PlayerText, DCPTime> add_to (boost::weak_ptr<Piece> piece, DCPTime to);
bool have (boost::weak_ptr<Piece> piece) const;
private:
public:
Period () {}
- Period (PlayerSubtitles s, DCPTime f)
+ Period (PlayerText s, DCPTime f)
: subs (s)
, from (f)
{}
- PlayerSubtitles subs;
+ PlayerText subs;
DCPTime from;
boost::optional<DCPTime> to;
};
}
void
-DCPEncoder::subtitle (PlayerSubtitles data, DCPTimePeriod period)
+DCPEncoder::subtitle (PlayerText data, DCPTimePeriod period)
{
if (_non_burnt_subtitles) {
_writer->write (data, period);
/*
- Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
#include "types.h"
-#include "player_subtitles.h"
+#include "player_text.h"
#include "encoder.h"
#include <boost/weak_ptr.hpp>
void video (boost::shared_ptr<PlayerVideo>, DCPTime);
void audio (boost::shared_ptr<AudioBuffers>, DCPTime);
- void subtitle (PlayerSubtitles, DCPTimePeriod);
+ void subtitle (PlayerText, DCPTimePeriod);
boost::shared_ptr<Writer> _writer;
boost::shared_ptr<J2KEncoder> _j2k_encoder;
#define DCPOMATIC_ENCODER_H
#include "types.h"
-#include "player_subtitles.h"
+#include "player_text.h"
#include <boost/weak_ptr.hpp>
#include <boost/signals2.hpp>
}
void
-FFmpegEncoder::subtitle (PlayerSubtitles, DCPTimePeriod)
+FFmpegEncoder::subtitle (PlayerText, DCPTimePeriod)
{
}
private:
void video (boost::shared_ptr<PlayerVideo>, DCPTime);
void audio (boost::shared_ptr<AudioBuffers>);
- void subtitle (PlayerSubtitles, DCPTimePeriod);
+ void subtitle (PlayerText, DCPTimePeriod);
void setup_video ();
void setup_audio ();
--- /dev/null
+/*
+ Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DCPOMATIC_PLAIN_TEXT_H
+#define DCPOMATIC_PLAIN_TEXT_H
+
+#include <dcp/subtitle_string.h>
+
+/** A wrapper for SubtitleString which allows us to include settings that are not
+ * applicable to true DCP subtitles. For example, we can set outline width for burn-in
+ * but this cannot be specified in DCP XML.
+ */
+class PlainText : public dcp::SubtitleString
+{
+public:
+ explicit PlainText (dcp::SubtitleString dcp_)
+ : dcp::SubtitleString (dcp_)
+ , outline_width (2)
+ {}
+
+ PlainText (dcp::SubtitleString dcp_, int outline_width_)
+ : dcp::SubtitleString (dcp_)
+ , outline_width (outline_width_)
+ {}
+
+ int outline_width;
+};
+
+#endif
int const vfr = _film->video_frame_rate();
- BOOST_FOREACH (PlayerSubtitles i, _active_subtitles.get_burnt (DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_subtitles)) {
+ BOOST_FOREACH (PlayerText i, _active_subtitles.get_burnt (DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_subtitles)) {
/* Image subtitles */
list<PositionImage> c = transform_bitmap_texts (i.image);
subtitle.sub.rectangle.width *= piece->content->subtitle->x_scale ();
subtitle.sub.rectangle.height *= piece->content->subtitle->y_scale ();
- PlayerSubtitles ps;
+ PlayerText ps;
ps.image.push_back (subtitle.sub);
DCPTime from (content_time_to_dcp (piece, subtitle.from()));
return;
}
- PlayerSubtitles ps;
+ PlayerText ps;
DCPTime const from (content_time_to_dcp (piece, subtitle.from()));
if (from > piece->content->end()) {
return;
}
- pair<PlayerSubtitles, DCPTime> from = _active_subtitles.add_to (wp, dcp_to);
+ pair<PlayerText, DCPTime> from = _active_subtitles.add_to (wp, dcp_to);
if (piece->content->subtitle->use() && !_always_burn_subtitles && !piece->content->subtitle->burn()) {
Subtitle (from.first, DCPTimePeriod (from.second, dcp_to));
#ifndef DCPOMATIC_PLAYER_H
#define DCPOMATIC_PLAYER_H
-#include "player_subtitles.h"
+#include "player_text.h"
#include "active_subtitles.h"
#include "content_text.h"
#include "film.h"
/** Emitted when a subtitle is ready. This signal may be emitted considerably
* after the corresponding Video.
*/
- boost::signals2::signal<void (PlayerSubtitles, DCPTimePeriod)> Subtitle;
+ boost::signals2::signal<void (PlayerText, DCPTimePeriod)> Subtitle;
private:
friend class PlayerWrapper;
+++ /dev/null
-/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
-
- 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 <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "player_subtitles.h"
-#include "font.h"
-#include <boost/foreach.hpp>
-
-using std::list;
-using boost::shared_ptr;
-
-void
-PlayerSubtitles::add_fonts (list<shared_ptr<Font> > fonts_)
-{
- BOOST_FOREACH (shared_ptr<Font> i, fonts_) {
- bool got = false;
- BOOST_FOREACH (shared_ptr<Font> j, fonts) {
- if (*i == *j) {
- got = true;
- }
- }
- if (!got) {
- fonts.push_back (i);
- }
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
-
- 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 <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_PLAYER_SUBTITLES_H
-#define DCPOMATIC_PLAYER_SUBTITLES_H
-
-#include "bitmap_text.h"
-#include "dcpomatic_time.h"
-#include "subtitle_string.h"
-
-class Font;
-
-/** A set of subtitles which span the same time period */
-class PlayerSubtitles
-{
-public:
- void add_fonts (std::list<boost::shared_ptr<Font> > fonts_);
- std::list<boost::shared_ptr<Font> > fonts;
-
- /** BitmapTexts, with their rectangles transformed as specified by their content */
- std::list<BitmapText> image;
- std::list<SubtitleString> text;
-};
-
-#endif
--- /dev/null
+/*
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "player_text.h"
+#include "font.h"
+#include <boost/foreach.hpp>
+
+using std::list;
+using boost::shared_ptr;
+
+void
+PlayerSubtitles::add_fonts (list<shared_ptr<Font> > fonts_)
+{
+ BOOST_FOREACH (shared_ptr<Font> i, fonts_) {
+ bool got = false;
+ BOOST_FOREACH (shared_ptr<Font> j, fonts) {
+ if (*i == *j) {
+ got = true;
+ }
+ }
+ if (!got) {
+ fonts.push_back (i);
+ }
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DCPOMATIC_PLAYER_TEXT_H
+#define DCPOMATIC_PLAYER_TEXT_H
+
+#include "bitmap_text.h"
+#include "dcpomatic_time.h"
+#include "plain_text.h"
+
+class Font;
+
+/** A set of text (subtitle/CCAP) which span the same time period */
+class PlayerText
+{
+public:
+ void add_fonts (std::list<boost::shared_ptr<Font> > fonts_);
+ std::list<boost::shared_ptr<Font> > fonts;
+
+ /** BitmapTexts, with their rectangles transformed as specified by their content */
+ std::list<BitmapText> image;
+ std::list<PlainText> text;
+};
+
+#endif
/*
- Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "position_image.h"
#include "dcpomatic_time.h"
-#include "subtitle_string.h"
+#include "plain_text.h"
#include <dcp/util.h>
class Font;
+++ /dev/null
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- 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 <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_SUBTITLE_STRING_H
-#define DCPOMATIC_SUBTITLE_STRING_H
-
-#include <dcp/subtitle_string.h>
-
-/** A wrapper for SubtitleString which allows us to include settings that are not
- * applicable to true DCP subtitles. For example, we can set outline width for burn-in
- * but this cannot be specified in DCP XML.
- */
-class SubtitleString : public dcp::SubtitleString
-{
-public:
- explicit SubtitleString (dcp::SubtitleString dcp_)
- : dcp::SubtitleString (dcp_)
- , outline_width (2)
- {}
-
- SubtitleString (dcp::SubtitleString dcp_, int outline_width_)
- : dcp::SubtitleString (dcp_)
- , outline_width (outline_width_)
- {}
-
- int outline_width;
-};
-
-#endif
}
void
-Writer::write (PlayerSubtitles subs, DCPTimePeriod period)
+Writer::write (PlayerText subs, DCPTimePeriod period)
{
while (_subtitle_reel->period().to <= period.from) {
++_subtitle_reel;
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
#include "types.h"
-#include "player_subtitles.h"
+#include "player_text.h"
#include "exception_store.h"
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
bool can_repeat (Frame) const;
void repeat (Frame, Eyes);
void write (boost::shared_ptr<const AudioBuffers>, DCPTime time);
- void write (PlayerSubtitles subs, DCPTimePeriod period);
+ void write (PlayerText subs, DCPTimePeriod period);
void write (std::list<boost::shared_ptr<Font> > fonts);
void write (ReferencedReelAsset asset);
void finish ();
mid_side_decoder.cc
overlaps.cc
player.cc
- player_subtitles.cc
+ player_text.cc
player_video.cc
playlist.cc
position_image.cc