- maybe_add_captions<dcp::ReelSubtitleAsset> (_caption_asset[TEXT_OPEN_SUBTITLE], reel_picture_asset->duration(), reel, refs, fonts, _film, _period);
- maybe_add_captions<dcp::ReelClosedCaptionAsset> (_caption_asset[TEXT_CLOSED_CAPTION], reel_picture_asset->duration(), reel, refs, fonts, _film, _period);
+ maybe_add_text<dcp::ReelSubtitleAsset> (_subtitle_asset, reel_picture_asset->actual_duration(), reel, refs, fonts, _film, _period);
+ for (map<DCPTextTrack, shared_ptr<dcp::SubtitleAsset> >::const_iterator i = _closed_caption_assets.begin(); i != _closed_caption_assets.end(); ++i) {
+ shared_ptr<dcp::ReelClosedCaptionAsset> a = maybe_add_text<dcp::ReelClosedCaptionAsset> (
+ i->second, reel_picture_asset->actual_duration(), reel, refs, fonts, _film, _period
+ );
+ if (a) {
+ a->set_annotation_text (i->first.name);
+ a->set_language (i->first.language);
+ }
+ }
+
+ Film::Markers markers = _film->markers ();
+ _film->add_ffoc_lfoc (markers);
+ Film::Markers reel_markers;
+ for (Film::Markers::const_iterator i = markers.begin(); i != markers.end(); ++i) {
+ if (_period.contains(i->second)) {
+ reel_markers[i->first] = i->second;
+ }
+ }
+
+ if (!reel_markers.empty ()) {
+ shared_ptr<dcp::ReelMarkersAsset> ma (new dcp::ReelMarkersAsset(dcp::Fraction(_film->video_frame_rate(), 1), 0));
+ for (map<dcp::Marker, DCPTime>::const_iterator i = reel_markers.begin(); i != reel_markers.end(); ++i) {
+ 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()));
+ }
+ reel->add (ma);
+ }
+
+ if (_atmos_asset) {
+ reel->add (shared_ptr<dcp::ReelAtmosAsset>(new dcp::ReelAtmosAsset(_atmos_asset, 0)));
+ }