Move luminance to Interop/SMPTE metadata and remove the ISDCF metadata dialogue.
[dcpomatic.git] / src / lib / ext.cc
index 751bab5aa71d637edabfedb776490a06f818de7f..b88a88726b99c6f79fc5b91398b2a54487ec8281 100644 (file)
@@ -57,7 +57,6 @@ extern "C" {
 #include <lwext4/ext4_mkfs.h>
 }
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <string>
 
 
@@ -246,7 +245,7 @@ void
 verify (vector<CopiedFile> const& copied_files, uint64_t total, Nanomsg* nanomsg)
 {
        uint64_t total_remaining = total;
-       BOOST_FOREACH (CopiedFile const& i, copied_files) {
+       for (auto const& i: copied_files) {
                string const read_digest = read (i.from, i.to, total_remaining, total, nanomsg);
                LOG_DISK ("Read %1 %2 was %3 on write, now %4", i.from.string(), i.to.generic_string(), i.write_digest, read_digest);
                if (read_digest != i.write_digest) {
@@ -256,6 +255,16 @@ verify (vector<CopiedFile> const& copied_files, uint64_t total, Nanomsg* nanomsg
 }
 
 
+static
+void
+format_progress (void* context, float progress)
+{
+       if (context) {
+               reinterpret_cast<Nanomsg*>(context)->send(String::compose(DISK_WRITER_FORMAT_PROGRESS "\n%1\n", progress), SHORT_TIMEOUT);
+       }
+}
+
+
 void
 #ifdef DCPOMATIC_WINDOWS
 dcpomatic::write (boost::filesystem::path dcp_path, string device, string, Nanomsg* nanomsg)
@@ -330,11 +339,7 @@ try
        }
        LOG_DISK_NC ("Opened partition");
 
-       if (nanomsg) {
-               nanomsg->send(DISK_WRITER_FORMATTING "\n", SHORT_TIMEOUT);
-       }
-
-       r = ext4_mkfs(&fs, bd, &info, F_SET_EXT2);
+       r = ext4_mkfs(&fs, bd, &info, F_SET_EXT2, format_progress, nanomsg);
        if (r != EOK) {
                throw CopyError ("Failed to make filesystem", r);
        }