summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-04-01 23:52:54 +0200
committerCarl Hetherington <cth@carlh.net>2025-12-15 17:13:38 +0100
commit27ab2190c2efdcad90d76827018f1bd53b2202c2 (patch)
treed5920e53d34e42bf9b8f89d4ba4d0c743df42174
parentcf36ca45e030520194431a501bf531c1d299a94c (diff)
Remove note() from dcp::VerificationNote.
-rw-r--r--src/cpl.cc3
-rw-r--r--src/verify.cc15
-rw-r--r--src/verify.h16
-rw-r--r--test/verify_test.cc3
4 files changed, 4 insertions, 33 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 16ff84af..112b5197 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -155,9 +155,8 @@ CPL::CPL(boost::filesystem::path file, vector<dcp::VerificationNote>* notes)
dcp::VerificationNote(
dcp::VerificationNote::Type::ERROR,
dcp::VerificationNote::Code::MISSING_CPL_CONTENT_VERSION,
- _id,
file
- )
+ ).set_cpl_id(_id)
);
}
}
diff --git a/src/verify.cc b/src/verify.cc
index 3dede014..9f822a25 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -614,12 +614,7 @@ verify_main_picture_asset(Context& context, shared_ptr<const ReelPictureAsset> r
/* Only 2D allowed for 4K */
if (dynamic_pointer_cast<const StereoJ2KPictureAsset>(asset)) {
- context.bv21_error(
- VerificationNote::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D,
- String::compose("%1/%2", asset->edit_rate().numerator, asset->edit_rate().denominator),
- file
- );
-
+ context.add_note(VN(VN::Type::BV21_ERROR, VN::Code::INVALID_PICTURE_ASSET_RESOLUTION_FOR_3D, file).set_frame_rate(asset->edit_rate()));
}
}
}
@@ -2262,7 +2257,6 @@ dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
{
return a.type() == b.type() &&
a.code() == b.code() &&
- a.note() == b.note() &&
a.file() == b.file() &&
a.line() == b.line() &&
a.frame() == b.frame() &&
@@ -2317,10 +2311,6 @@ dcp::operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
return a.code() < b.code();
}
- if (a.note() != b.note()) {
- return a.note().get_value_or("") < b.note().get_value_or("");
- }
-
if (a.file() != b.file()) {
return a.file().get_value_or("") < b.file().get_value_or("");
}
@@ -2369,9 +2359,6 @@ std::ostream&
dcp::operator<< (std::ostream& s, dcp::VerificationNote const& note)
{
s << note_to_string (note);
- if (note.note()) {
- s << " [" << note.note().get() << "]";
- }
if (note.file()) {
s << " [" << note.file().get() << "]";
}
diff --git a/src/verify.h b/src/verify.h
index a51d490c..39e70ca0 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -569,19 +569,10 @@ public:
_data[Data::FILE] = file;
}
- VerificationNote (Type type, Code code, std::string note, boost::filesystem::path file)
+ VerificationNote(Type type, Code code, boost::filesystem::path file, uint64_t line)
: _type (type)
, _code (code)
{
- _data[Data::NOTE] = note;
- _data[Data::FILE] = file;
- }
-
- VerificationNote (Type type, Code code, std::string note, boost::filesystem::path file, uint64_t line)
- : _type (type)
- , _code (code)
- {
- _data[Data::NOTE] = note;
_data[Data::FILE] = file;
_data[Data::LINE] = line;
}
@@ -596,7 +587,6 @@ public:
private:
enum class Data {
- NOTE, ///< further information about the error
FILE, ///< path of file containing the error
LINE, ///< error line number within the FILE
FRAME,
@@ -645,10 +635,6 @@ private:
}
public:
- boost::optional<std::string> note () const {
- return data<std::string>(Data::NOTE);
- }
-
boost::optional<boost::filesystem::path> file () const {
return data<boost::filesystem::path>(Data::FILE);
}
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 19b8f4e5..723c0c35 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -242,10 +242,9 @@ string
to_string(dcp::VerificationNote const& note)
{
string s = note_to_string(note) + dcp::String::compose(
- "\n [%1 %2 %3 %4 %5 %6 ",
+ "\n [%1 %2 %3 %4 %5 ",
static_cast<int>(note.type()),
static_cast<int>(note.code()),
- note.note().get_value_or("<none>"),
note.file().get_value_or("<none>"),
note.line().get_value_or(0),
note.frame().get_value_or(0)