X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fwriter.cc;h=17184918fd733da9edfed66a846a37dc5ebb9ba5;hb=46b4349fb5a19523e5105812bf79fd0e7df9c51f;hp=f7d3bcd25a31205d9e0bd1726a17307c5d0a4abf;hpb=7d1fb4361e6eec27c9eefb886761293e904f0dff;p=dcpomatic.git diff --git a/src/lib/writer.cc b/src/lib/writer.cc index f7d3bcd25..17184918f 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -517,8 +517,10 @@ Writer::terminate_thread (bool can_throw) } } + +/** @param output_dcp Path to DCP folder to write */ void -Writer::finish () +Writer::finish (boost::filesystem::path output_dcp) { if (!_thread.joinable()) { return; @@ -531,12 +533,12 @@ Writer::finish () LOG_GENERAL_NC ("Finishing ReelWriters"); BOOST_FOREACH (ReelWriter& i, _reels) { - i.finish (); + i.finish (output_dcp); } LOG_GENERAL_NC ("Writing XML"); - dcp::DCP dcp (film()->dir(film()->dcp_name())); + dcp::DCP dcp (output_dcp); shared_ptr cpl ( new dcp::CPL ( @@ -584,7 +586,7 @@ Writer::finish () /* Add reels */ BOOST_FOREACH (ReelWriter& i, _reels) { - cpl->add (i.create_reel (_reel_assets, _fonts)); + cpl->add (i.create_reel(_reel_assets, _fonts, output_dcp)); } /* Add metadata */ @@ -662,11 +664,11 @@ Writer::finish () N_("Wrote %1 FULL, %2 FAKE, %3 REPEAT, %4 pushed to disk"), _full_written, _fake_written, _repeat_written, _pushed_to_disk ); - write_cover_sheet (); + write_cover_sheet (output_dcp); } void -Writer::write_cover_sheet () +Writer::write_cover_sheet (boost::filesystem::path output_dcp) { boost::filesystem::path const cover = film()->file("COVER_SHEET.txt"); FILE* f = fopen_boost (cover, "w"); @@ -689,7 +691,7 @@ Writer::write_cover_sheet () boost::uintmax_t size = 0; for ( - boost::filesystem::recursive_directory_iterator i = boost::filesystem::recursive_directory_iterator(film()->dir(film()->dcp_name())); + boost::filesystem::recursive_directory_iterator i = boost::filesystem::recursive_directory_iterator(output_dcp); i != boost::filesystem::recursive_directory_iterator(); ++i) { if (boost::filesystem::is_regular_file (i->path ())) {