X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftypes.cc;h=5687a5d48b070c261a7559f03a945d8442fc6d6a;hb=e64a1a9aae0200d14feed49a4c6cf537bf5708a4;hp=9806c99712eb8d1a6c87e43cab4f39aeb530921f;hpb=cc8ea498a3ff9421765a99c347e03533cb0595d4;p=dcpomatic.git diff --git a/src/lib/types.cc b/src/lib/types.cc index 9806c9971..5687a5d48 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -21,12 +21,15 @@ #include "types.h" #include "compose.hpp" #include "dcpomatic_assert.h" +#include "warnings.h" #include #include #include #include #include +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include #include @@ -194,10 +197,14 @@ CPLSummary::CPLSummary (boost::filesystem::path p) : dcp_directory (p.leaf().string()) { dcp::DCP dcp (p); + list notes; dcp.read (¬es); - if (!notes.empty()) { - throw dcp::DCPReadError(dcp::note_to_string(notes.front())); + BOOST_FOREACH (dcp::VerificationNote i, notes) { + if (i.code() != dcp::VerificationNote::EXTERNAL_ASSET) { + /* It's not just a warning about this DCP being a VF */ + throw dcp::ReadError(dcp::note_to_string(i)); + } } cpl_id = dcp.cpls().front()->id(); @@ -215,3 +222,38 @@ CPLSummary::CPLSummary (boost::filesystem::path p) last_write_time = boost::filesystem::last_write_time (p); } + + +bool operator== (NamedChannel const& a, NamedChannel const& b) +{ + return a.name == b.name && a.index == b.index; +} + + +string +video_range_to_string (VideoRange r) +{ + switch (r) { + case VIDEO_RANGE_FULL: + return "full"; + case VIDEO_RANGE_VIDEO: + return "video"; + default: + DCPOMATIC_ASSERT (false); + } +} + + +VideoRange +string_to_video_range (string s) +{ + if (s == "full") { + return VIDEO_RANGE_FULL; + } else if (s == "video") { + return VIDEO_RANGE_VIDEO; + } + + DCPOMATIC_ASSERT (false); + return VIDEO_RANGE_FULL; +} +