if (!reel_markers.empty ()) {
auto ma = make_shared<dcp::ReelMarkersAsset>(dcp::Fraction(film()->video_frame_rate(), 1), reel->duration(), 0);
for (auto const& i: reel_markers) {
- int h, m, s, f;
DCPTime relative = i.second - _period.from;
- relative.split (film()->video_frame_rate(), h, m, s, f);
- ma->set (i.first, dcp::Time(h, m, s, f, film()->video_frame_rate()));
+ auto hmsf = relative.split (film()->video_frame_rate());
+ ma->set (i.first, dcp::Time(hmsf.h, hmsf.m, hmsf.s, hmsf.f, film()->video_frame_rate()));
}
reel->add (ma);
}
s->set_reel_number (raw_convert<string> (_reel_index + 1));
asset = s;
} else {
- shared_ptr<dcp::SMPTESubtitleAsset> s (new dcp::SMPTESubtitleAsset ());
+ auto s = make_shared<dcp::SMPTESubtitleAsset>();
s->set_content_title_text (film()->name());
s->set_metadata (mxf_metadata());
if (type == TextType::OPEN_SUBTITLE && !lang.empty()) {
if (film()->encrypted()) {
s->set_key (film()->key());
}
+ s->add (
+ std::make_shared<dcp::SubtitleString>(
+ optional<std::string>(),
+ false,
+ false,
+ false,
+ dcp::Colour(),
+ 42,
+ 1.0,
+ dcp::Time(0, 0, 0, 0, 24),
+ dcp::Time(0, 0, 1, 0, 24),
+ 0.5,
+ dcp::HAlign::CENTER,
+ 0.5,
+ dcp::VAlign::CENTER,
+ dcp::Direction::LTR,
+ "",
+ dcp::Effect::NONE,
+ dcp::Colour(),
+ dcp::Time(),
+ dcp::Time()
+ )
+ );
asset = s;
}
DCPOMATIC_ASSERT (false);
}
+ /* timecode rate for subtitles we emit; we might as well stick to ms accuracy here, I think */
+ auto const tcr = 1000;
+
for (auto i: subs.string) {
- /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */
- i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr));
- i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr));
- asset->add (shared_ptr<dcp::Subtitle>(new dcp::SubtitleString(i)));
+ i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), tcr));
+ i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr));
+ asset->add (make_shared<dcp::SubtitleString>(i));
}
for (auto i: subs.bitmap) {
asset->add (
make_shared<dcp::SubtitleImage>(
i.image->as_png(),
- dcp::Time(period.from.seconds() - _period.from.seconds(), film()->video_frame_rate()),
- dcp::Time(period.to.seconds() - _period.from.seconds(), film()->video_frame_rate()),
+ dcp::Time(period.from.seconds() - _period.from.seconds(), tcr),
+ dcp::Time(period.to.seconds() - _period.from.seconds(), tcr),
i.rectangle.x, dcp::HAlign::LEFT, i.rectangle.y, dcp::VAlign::TOP,
dcp::Time(), dcp::Time()
)