}
};
- auto progress = [](float) {};
+ auto progress = [quiet](float amount) {
+ if (quiet) {
+ return;
+ }
+ int const width = 60;
+ int const index = std::rint(amount * width);
+ cout << "[";
+ for (int i = 0; i < width; ++i) {
+ if (i < index) {
+ std::cout << "=";
+ } else if (i == index) {
+ std::cout << ">";
+ } else {
+ std::cout << " ";
+ }
+ }
+ cout << "] " << std::rint(amount * 100) << "%\r";
+ cout.flush();
+ };
vector<boost::filesystem::path> directories;
directories.push_back (argv[optind]);
auto notes = dcp::verify(directories, stage, progress);
dcp::filter_notes (notes, ignore_missing_assets);
+ if (!quiet) {
+ cout << "\n";
+ }
+
bool failed = false;
+ bool bv21_failed = false;
+ bool warned = false;
for (auto i: notes) {
if (ignore_bv21_smpte && i.code() == dcp::VerificationNote::Code::INVALID_STANDARD) {
continue;
break;
case dcp::VerificationNote::Type::BV21_ERROR:
cout << "Bv2.1 error: " << note_to_string(i) << "\n";
+ bv21_failed = true;
break;
case dcp::VerificationNote::Type::WARNING:
cout << "Warning: " << note_to_string(i) << "\n";
+ warned = true;
break;
}
}
if (!failed && !quiet) {
+ if (bv21_failed || warned) {
+ cout << "\n";
+ }
cout << "DCP verified OK.\n";
}