c++ tidying.
[dcpomatic.git] / src / lib / dcp_content_type.cc
index 9ff903231340529db8704ac1e6188e5b097b8b69..c31c507b0786c92bd3223061872f3d735bc1a124 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "dcp_content_type.h"
 #include "dcpomatic_assert.h"
-#include <boost/foreach.hpp>
 
 #include "i18n.h"
 
@@ -60,7 +59,7 @@ DCPContentType::setup_dcp_content_types ()
 DCPContentType const *
 DCPContentType::from_isdcf_name (string n)
 {
-       BOOST_FOREACH (DCPContentType const * i, _dcp_content_types) {
+       for (auto i: _dcp_content_types) {
                if (i->isdcf_name() == n) {
                        return i;
                }
@@ -69,6 +68,20 @@ DCPContentType::from_isdcf_name (string n)
        return 0;
 }
 
+DCPContentType const *
+DCPContentType::from_libdcp_kind (dcp::ContentKind kind)
+{
+       for (auto i: _dcp_content_types) {
+               if (i->libdcp_kind() == kind) {
+                       return i;
+               }
+       }
+
+       DCPOMATIC_ASSERT (false);
+       return 0;
+}
+
+
 DCPContentType const *
 DCPContentType::from_index (int n)
 {