Add DCPContent::from_libdcp_kind.
[dcpomatic.git] / src / lib / dcp_content_type.cc
index 9ff903231340529db8704ac1e6188e5b097b8b69..4fedd366c896c15adae703f09ce38a0f53729a67 100644 (file)
@@ -69,6 +69,20 @@ DCPContentType::from_isdcf_name (string n)
        return 0;
 }
 
+DCPContentType const *
+DCPContentType::from_libdcp_kind (dcp::ContentKind kind)
+{
+       BOOST_FOREACH (DCPContentType const * i, _dcp_content_types) {
+               if (i->libdcp_kind() == kind) {
+                       return i;
+               }
+       }
+
+       DCPOMATIC_ASSERT (false);
+       return 0;
+}
+
+
 DCPContentType const *
 DCPContentType::from_index (int n)
 {