X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Ftypes.cc;h=7f0bf43057d75f9c770e7369b6ffde721c8b522a;hp=97373b24ee52a481f803f35e44e28863b3f46258;hb=df17bbd25da69fc38eb2dcd8b4a2531cf0bab0bc;hpb=27b83475435dda4e84a90cf59a52f150905c4ab1 diff --git a/src/lib/types.cc b/src/lib/types.cc index 97373b24e..7f0bf4305 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -25,6 +25,8 @@ #include #include +#include "i18n.h" + using std::max; using std::min; using std::string; @@ -91,7 +93,7 @@ Crop::as_xml (xmlpp::Node* node) const node->add_child("BottomCrop")->add_child_text (raw_convert (bottom)); } -CaptionType +TextType string_to_caption_type (string s) { if (s == "open") { @@ -104,7 +106,7 @@ string_to_caption_type (string s) } string -caption_type_to_string (CaptionType t) +caption_type_to_string (TextType t) { switch (t) { case CAPTION_OPEN: @@ -116,6 +118,19 @@ caption_type_to_string (CaptionType t) } } +string +caption_type_to_name (TextType t) +{ + switch (t) { + case CAPTION_OPEN: + return _("Subtitles"); + case CAPTION_CLOSED: + return _("Closed captions"); + default: + DCPOMATIC_ASSERT (false); + } +} + string video_frame_type_to_string (VideoFrameType t) {