summaryrefslogtreecommitdiff
path: root/src/lib/types.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/types.cc')
-rw-r--r--src/lib/types.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/types.cc b/src/lib/types.cc
index e7acf6992..5687a5d48 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -229,3 +229,31 @@ 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;
+}
+