Rationalise #undef-ing of ERROR.
[libdcp.git] / src / verify.h
index 48c06577b419b79498db03b37d1f30f5f10a5cb7..2d3cc9df66c1562b174e381ec9864f0b28aefd64 100644 (file)
@@ -50,7 +50,7 @@
 #include <vector>
 
 
-/* Something in windows.h defines this */
+/* windows.h defines this but we want to use it */
 #undef ERROR
 
 
@@ -447,7 +447,21 @@ public:
                /** A subtitle XML root node has more than one namespace (xmlns) declaration.
                 *  note contains the asset ID
                 */
-               INCORRECT_SUBTITLE_NAMESPACE_COUNT
+               INCORRECT_SUBTITLE_NAMESPACE_COUNT,
+               /** A subtitle or closed caption file has a <Font> tag which refers to a font that is not
+                *  first introduced with a <LoadFont>.
+                *  id contains the ID of the <Font> tag.
+                */
+               MISSING_LOAD_FONT_FOR_FONT,
+               /** A SMPTE subtitle asset has at least one <Text> element but no <LoadFont>
+                *  id contains the ID of the subtitle asset.
+                */
+               MISSING_LOAD_FONT,
+               /** An ID in an asset map does not match the ID obtained from reading the actual file.
+                *  id contains the ID from the asset map.
+                *  other_id contains the ID from the file.
+                */
+               MISMATCHED_ASSET_MAP_ID,
        };
 
        VerificationNote (Type type, Code code)
@@ -502,6 +516,8 @@ private:
                FRAME,
                COMPONENT,
                SIZE,
+               ID,
+               OTHER_ID,
        };
 
        template <class T>
@@ -554,6 +570,24 @@ public:
                return data<int>(Data::SIZE);
        }
 
+       VerificationNote& set_id(std::string id) {
+               _data[Data::ID] = id;
+               return *this;
+       }
+
+       boost::optional<std::string> id() const {
+               return data<std::string>(Data::ID);
+       }
+
+       VerificationNote& set_other_id(std::string other_id) {
+               _data[Data::OTHER_ID] = other_id;
+               return *this;
+       }
+
+       boost::optional<std::string> other_id() const {
+               return data<std::string>(Data::OTHER_ID);
+       }
+
 private:
        Type _type;
        Code _code;