summaryrefslogtreecommitdiff
path: root/src/lib/writer.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-19 21:33:52 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-19 23:45:23 +0100
commit11fe3ab56ad59b8b5525fa795d44d2323ef6d5b8 (patch)
tree3bd7b96fee95bf6b34acdfbfdb47c92bfb5c818b /src/lib/writer.cc
parent0ab83642f0c96ae2681beae04873b3226338a570 (diff)
Get types into ReelWriter.
Diffstat (limited to 'src/lib/writer.cc')
-rw-r--r--src/lib/writer.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index a5e8cd9d2..7b2944d32 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -91,11 +91,13 @@ Writer::Writer (shared_ptr<const Film> film, weak_ptr<Job> j)
_reels.push_back (ReelWriter (film, p, job, reel_index++, reels.size(), _film->content_summary(p)));
}
- /* We can keep track of the current audio and subtitle reels easily because audio
- and subs arrive to the Writer in sequence. This is not so for video.
+ /* We can keep track of the current audio, subtitle and closed caption reels easily because audio
+ and captions arrive to the Writer in sequence. This is not so for video.
*/
_audio_reel = _reels.begin ();
- _subtitle_reel = _reels.begin ();
+ for (int i = 0; i < TEXT_COUNT; ++i) {
+ _text_reel[i] = _reels.begin ();
+ }
/* Check that the signer is OK if we need one */
string reason;
@@ -663,16 +665,16 @@ Writer::can_fake_write (Frame frame) const
}
void
-Writer::write (PlayerText subs, DCPTimePeriod period)
+Writer::write (PlayerText text, TextType type, DCPTimePeriod period)
{
- while (_subtitle_reel->period().to <= period.from) {
- ++_subtitle_reel;
- DCPOMATIC_ASSERT (_subtitle_reel != _reels.end());
+ while (_text_reel[type]->period().to <= period.from) {
+ ++_text_reel[type];
+ DCPOMATIC_ASSERT (_text_reel[type] != _reels.end());
}
- DCPOMATIC_ASSERT (_subtitle_reel != _reels.end());
+ DCPOMATIC_ASSERT (_text_reel[type] != _reels.end());
- _subtitle_reel->write (subs, period);
+ _text_reel[type]->write (text, type, period);
}
void