+TextType
+string_to_text_type (string s)
+{
+ if (s == "subtitle") {
+ return TEXT_SUBTITLE;
+ } else if (s == "ccap") {
+ return TEXT_CLOSED_CAPTION;
+ } else {
+ throw MetadataError (String::compose ("Unknown text type %1", s));
+ }
+}
+
+string
+text_type_to_string (TextType t)
+{
+ switch (t) {
+ case TEXT_SUBTITLE:
+ return "subtitle";
+ case TEXT_CLOSED_CAPTION:
+ return "ccap";
+ default:
+ DCPOMATIC_ASSERT (false);
+ }
+}
+