/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
+#include "i18n.h"
+
using std::max;
using std::min;
using std::string;
TextType
string_to_text_type (string s)
{
- if (s == "subtitle") {
- return TEXT_SUBTITLE;
- } else if (s == "ccap") {
+ if (s == "unknown") {
+ return TEXT_UNKNOWN;
+ } else if (s == "open-subtitle") {
+ return TEXT_OPEN_SUBTITLE;
+ } else if (s == "closed-caption") {
return TEXT_CLOSED_CAPTION;
} else {
throw MetadataError (String::compose ("Unknown text type %1", s));
text_type_to_string (TextType t)
{
switch (t) {
- case TEXT_SUBTITLE:
- return "subtitle";
+ case TEXT_UNKNOWN:
+ return "unknown";
+ case TEXT_OPEN_SUBTITLE:
+ return "open-subtitle";
+ case TEXT_CLOSED_CAPTION:
+ return "closed-caption";
+ default:
+ DCPOMATIC_ASSERT (false);
+ }
+}
+
+string
+text_type_to_name (TextType t)
+{
+ switch (t) {
+ case TEXT_UNKNOWN:
+ return _("Timed text");
+ case TEXT_OPEN_SUBTITLE:
+ return _("Open subtitles");
case TEXT_CLOSED_CAPTION:
- return "ccap";
+ return _("Closed captions");
default:
DCPOMATIC_ASSERT (false);
}