- if (_subtitle_asset) {
- boost::filesystem::path liberation;
- try {
- liberation = shared_path () / "LiberationSans-Regular.ttf";
- } catch (boost::filesystem::filesystem_error& e) {
- /* Hack: try the debian/ubuntu location if getting the shared path failed */
- liberation = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf";
- }
-
- /* Add all the fonts to the subtitle content */
- BOOST_FOREACH (shared_ptr<Font> i, _fonts) {
- _subtitle_asset->add_font (i->id(), i->file().get_value_or (liberation));
- }
-
- if (dynamic_pointer_cast<dcp::InteropSubtitleAsset> (_subtitle_asset)) {
- boost::filesystem::path directory = _film->dir (_film->dcp_name ()) / _subtitle_asset->id ();
- boost::filesystem::create_directories (directory);
- _subtitle_asset->write (directory / ("sub_" + _subtitle_asset->id() + ".xml"));
- } else {
- /* All our assets should be the same length; use the picture asset length here
- as a reference to set the subtitle one.
- */
- dynamic_pointer_cast<dcp::SMPTESubtitleAsset>(_subtitle_asset)->set_intrinsic_duration (
- reel_picture_asset->intrinsic_duration ()
- );
-
- _subtitle_asset->write (
- _film->dir (_film->dcp_name ()) / ("sub_" + _subtitle_asset->id() + ".mxf")
- );
- }
-
- reel->add (shared_ptr<dcp::ReelSubtitleAsset> (
- new dcp::ReelSubtitleAsset (
- _subtitle_asset,
- dcp::Fraction (_film->video_frame_rate(), 1),
- reel_picture_asset->intrinsic_duration (),
- 0
- )
- ));
- } else {
- /* We don't have a subtitle asset of our own; maybe we need to reference one */
- /* XXX: this is all a hack */
- BOOST_FOREACH (shared_ptr<dcp::ReelAsset> i, _reel_assets) {
- if (dynamic_pointer_cast<dcp::ReelSubtitleAsset> (i)) {
- reel->add (i);
- }
- }
+ BOOST_FOREACH (ReelWriter& i, _reels) {
+ boost::function<void (float)> set_progress = boost::bind (&Writer::set_digest_progress, this, job.get(), _1);
+ service.post (boost::bind (&ReelWriter::calculate_digests, &i, set_progress));