std::shared_ptr
[dcpomatic.git] / src / lib / types.cc
index df57f2d47143a470b1ed88ae11a6e0ac699abf4b..6729628cd7800298fbbe4c3ecf87cf8be1fe83f5 100644 (file)
@@ -39,7 +39,7 @@ using std::max;
 using std::min;
 using std::string;
 using std::list;
-using boost::shared_ptr;
+using std::shared_ptr;
 using dcp::raw_convert;
 
 bool operator== (Crop const & a, Crop const & b)
@@ -222,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;
+}
+