Emit no audio from DCPs if none is mapped
[dcpomatic.git] / src / wx / verify_dcp_dialog.cc
index 9b6a8c9498845a99ea7e2cb1276beac7e7eaf0bc..c7a32e5dd14f65df759fee5ab14f2ad6549e8404 100644 (file)
 #include "verify_dcp_dialog.h"
 #include "wx_util.h"
 #include "lib/verify_dcp_job.h"
-#include "lib/warnings.h"
-#include <dcp/verify.h>
 #include <dcp/raw_convert.h>
-#include <boost/algorithm/string.hpp>
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/verify.h>
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
 #include <wx/notebook.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
+#include <boost/algorithm/string.hpp>
 
 
 using std::list;
@@ -88,6 +88,20 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
        };
 
        auto add = [&counts, &add_bullet](dcp::VerificationNote note, wxString message) {
+               if (note.reference_hash()) {
+                       message.Replace("%reference_hash", std_to_wx(note.reference_hash().get()));
+               }
+               if (note.calculated_hash()) {
+                       message.Replace("%calculated_hash", std_to_wx(note.calculated_hash().get()));
+               }
+               if (note.frame()) {
+                       message.Replace("%frame", std_to_wx(dcp::raw_convert<string>(note.frame().get())));
+                       message.Replace(
+                               "%timecode",
+                               std_to_wx(
+                                       dcp::Time(note.frame().get(), note.frame_rate().get(), note.frame_rate().get()).as_string(dcp::Standard::SMPTE)
+                                       ));
+               }
                if (note.note()) {
                        message.Replace("%n", std_to_wx(note.note().get()));
                }
@@ -97,6 +111,18 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
                if (note.line()) {
                        message.Replace("%l", std_to_wx(dcp::raw_convert<string>(note.line().get())));
                }
+               if (note.component()) {
+                       message.Replace("%component", std_to_wx(dcp::raw_convert<string>(note.component().get())));
+               }
+               if (note.size()) {
+                       message.Replace("%size", std_to_wx(dcp::raw_convert<string>(note.size().get())));
+               }
+               if (note.id()) {
+                       message.Replace("%id", std_to_wx(note.id().get()));
+               }
+               if (note.other_id()) {
+                       message.Replace("%other_id", std_to_wx(note.other_id().get()));
+               }
                add_bullet (note.type(), message);
                counts[note.type()]++;
        };
@@ -104,27 +130,28 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
        if (job->finished_in_error() && job->error_summary() != "") {
                /* We have an error that did not come from dcp::verify */
                add_bullet (dcp::VerificationNote::Type::ERROR, std_to_wx(job->error_summary()));
+               ++counts[dcp::VerificationNote::Type::ERROR];
        }
 
        for (auto i: job->notes()) {
                switch (i.code()) {
                case dcp::VerificationNote::Code::FAILED_READ:
-                       add (i, std_to_wx(*i.note()));
+                       add (i, _("Could not read DCP (%n)"));
                        break;
                case dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES:
-                       add(i, _("The hash of the CPL %n in the PKL does not agree with the CPL file.  This probably means that the CPL file is corrupt."));
+                       add(i, _("The hash (%reference_hash) of the CPL %n in the PKL does not agree with the CPL file (%calculated_hash).  This probably means that the CPL file is corrupt."));
                        break;
                case dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE:
                        add(i, _("The picture in a reel has a frame rate of %n, which is not valid."));
                        break;
                case dcp::VerificationNote::Code::INCORRECT_PICTURE_HASH:
-                       add(i, _("The hash of the picture asset %f does not agree with the PKL file.  This probably means that the asset file is corrupt."));
+                       add(i, _("The hash (%calculated_hash) of the picture asset %f does not agree with the PKL file (%reference_hash).  This probably means that the asset file is corrupt."));
                        break;
                case dcp::VerificationNote::Code::MISMATCHED_PICTURE_HASHES:
                        add(i, _("The PKL and CPL hashes disagree for picture asset %f."));
                        break;
                case dcp::VerificationNote::Code::INCORRECT_SOUND_HASH:
-                       add(i, _("The hash of the sound asset %f does not agree with the PKL file.  This probably means that the asset file is corrupt."));
+                       add(i, _("The hash (%calculated_hash) of the sound asset %f does not agree with the PKL file (%reference_hash).  This probably means that the asset file is corrupt."));
                        break;
                case dcp::VerificationNote::Code::MISMATCHED_SOUND_HASHES:
                        add(i, _("The PKL and CPL hashes disagree for sound asset %f."));
@@ -149,7 +176,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
                        add(i, _("No ASSETMAP or ASSETMAP.xml file was found."));
                        break;
                case dcp::VerificationNote::Code::INVALID_INTRINSIC_DURATION:
-                       add(i, _("The asset %n has an instrinsic duration of less than 1 second, which is invalid."));
+                       add(i, _("The asset %n has an intrinsic duration of less than 1 second, which is invalid."));
                        break;
                case dcp::VerificationNote::Code::INVALID_DURATION:
                        add(i, _("The asset %n has a duration of less than 1 second, which is invalid."));
@@ -158,7 +185,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
                        add(i, _("At least one frame of the video asset %f is over the limit of 250Mbit/s."));
                        break;
                case dcp::VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES:
-                       add(i, _("At least one frame of the video asset %f is close to the limit of 250MBit/s."));
+                       add(i, _("Frame %frame (timecode %timecode) in asset %f has an instantaneous bit rate that is close to the limit of 250Mbit/s."));
                        break;
                case dcp::VerificationNote::Code::EXTERNAL_ASSET:
                        add(i, _("This DCP refers to at the asset %n in another DCP (and perhaps others), so it is a \"version file\" (VF)"));
@@ -338,7 +365,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
                        add(i, _("A 2K JPEG2000 frame contains %n tile parts instead of 3."));
                        break;
                case dcp::VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_4K:
-                       add(i, _("A 2K JPEG2000 frame contains %n tile parts instead of 6."));
+                       add(i, _("A 4K JPEG2000 frame contains %n tile parts instead of 6."));
                        break;
                case dcp::VerificationNote::Code::MISSING_JPEG200_TLM_MARKER:
                        add(i, _("A JPEG2000 frame has no TLM marker."));
@@ -360,7 +387,73 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job
                        break;
                }
                case dcp::VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED:
-                       add(i, _("Part of the DCP could not be checked because no KDM was available"));
+                       add(i, _("Part of the DCP could not be checked because no KDM was available."));
+                       break;
+               case dcp::VerificationNote::Code::EMPTY_TEXT:
+                       add(i, _("At least one <Text> node in a subtitle or closed caption is empty."));
+                       break;
+               case dcp::VerificationNote::Code::MISMATCHED_CLOSED_CAPTION_VALIGN:
+                       add(i, _("Some closed <Text> or <Image> nodes have different vertical alignments within a <Subtitle>."));
+                       break;
+               case dcp::VerificationNote::Code::INCORRECT_CLOSED_CAPTION_ORDERING:
+                       add(i, _("Some closed captions are not listed in the order of their vertical position."));
+                       break;
+               case dcp::VerificationNote::Code::UNEXPECTED_ENTRY_POINT:
+                       add(i, _("There is a <EntryPoint> tag inside a <MainMarkers>."));
+                       break;
+               case dcp::VerificationNote::Code::UNEXPECTED_DURATION:
+                       add(i, _("There is a <Duration> tag inside a <MainMarkers>."));
+                       break;
+               case dcp::VerificationNote::Code::INVALID_CONTENT_KIND:
+                       add(i, _("An invalid <ContentKind> %n has been used."));
+                       break;
+               case dcp::VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA:
+                       add(i, _("The <MainPictureActiveArea> is either not a multiple of 2, or is bigger than an asset."));
+                       break;
+               case dcp::VerificationNote::Code::DUPLICATE_ASSET_ID_IN_PKL:
+                       add(i, _("The PKL %n has more than one asset with the same ID."));
+                       break;
+               case dcp::VerificationNote::Code::DUPLICATE_ASSET_ID_IN_ASSETMAP:
+                       add(i, _("The ASSETMAP %n has more than one asset with the same ID."));
+                       break;
+               case dcp::VerificationNote::Code::MISSING_SUBTITLE:
+                       add(i, _("The subtitle asset %n contains no subtitles."));
+                       break;
+               case dcp::VerificationNote::Code::INVALID_SUBTITLE_ISSUE_DATE:
+                       add(i, _("<IssueDate> has an invalid value %n"));
+                       break;
+               case dcp::VerificationNote::Code::MISMATCHED_SOUND_CHANNEL_COUNTS:
+                       add(i, _("Sound assets do not all have the same channel count."));
+                       break;
+               case dcp::VerificationNote::Code::INVALID_MAIN_SOUND_CONFIGURATION:
+                       add(i, _("<MainSoundConfiguration> describes incorrect number of channels (%n)"));
+                       break;
+               case dcp::VerificationNote::Code::MISSING_FONT:
+                       add(i, _("The font file for font ID \"%n\" was not found, or was not referred to in the ASSETMAP."));
+                       break;
+               case dcp::VerificationNote::Code::INVALID_JPEG2000_TILE_PART_SIZE:
+                       add(i, _("Frame %frame has an image component that is too large (component %component is %size bytes in size)."));
+                       break;
+               case dcp::VerificationNote::Code::INCORRECT_SUBTITLE_NAMESPACE_COUNT:
+                       add(i, _("The XML in the subtitle asset %n has more than one namespace declaration."));
+                       break;
+               case dcp::VerificationNote::Code::MISSING_LOAD_FONT_FOR_FONT:
+                       add(i, _("A subtitle or closed caption refers to a font with ID %id that does not have a corresponding <LoadFont> node."));
+                       break;
+               case dcp::VerificationNote::Code::MISSING_LOAD_FONT:
+                       add(i, _("The SMPTE subtitle asset %id has <Text> nodes but no <LoadFont> node"));
+                       break;
+               case dcp::VerificationNote::Code::MISMATCHED_ASSET_MAP_ID:
+                       add(i, _("The asset with ID %id in the asset map actually has an id of %other_id"));
+                       break;
+               case dcp::VerificationNote::Code::EMPTY_CONTENT_VERSION_LABEL_TEXT:
+                       add(i, _("The <LabelText> in a <ContentVersion> in CPL %id is empty"));
+                       break;
+               case dcp::VerificationNote::Code::INVALID_CPL_NAMESPACE:
+                       add(i, _("The CPL %f has an invalid namespace %n"));
+                       break;
+               case dcp::VerificationNote::Code::MISSING_CPL_CONTENT_VERSION:
+                       add(i, _("The CPL %n has no <ContentVersion> tag"));
                        break;
                }
        }