Fix lack of video rotation in some cases (#2971).
[dcpomatic.git] / src / lib / types.cc
index fd4b8906ce19e5c67e2c8e349028369a277e3f27..58382fdc71312bc580c3dc611ffabf481dbeba6b 100644 (file)
@@ -23,6 +23,7 @@
 #include "dcpomatic_assert.h"
 #include <dcp/cpl.h>
 #include <dcp/dcp.h>
+#include <dcp/filesystem.h>
 #include <dcp/raw_convert.h>
 #include <dcp/reel_asset.h>
 #include <dcp/reel_file_asset.h>
@@ -43,52 +44,8 @@ using std::vector;
 using dcp::raw_convert;
 
 
-TextType
-string_to_text_type (string s)
-{
-       if (s == "unknown") {
-               return TextType::UNKNOWN;
-       } else if (s == "open-subtitle") {
-               return TextType::OPEN_SUBTITLE;
-       } else if (s == "closed-caption") {
-               return TextType::CLOSED_CAPTION;
-       } else {
-               throw MetadataError (String::compose ("Unknown text type %1", s));
-       }
-}
-
-string
-text_type_to_string (TextType t)
-{
-       switch (t) {
-       case TextType::UNKNOWN:
-               return "unknown";
-       case TextType::OPEN_SUBTITLE:
-               return "open-subtitle";
-       case TextType::CLOSED_CAPTION:
-               return "closed-caption";
-       default:
-               DCPOMATIC_ASSERT (false);
-       }
-}
-
-string
-text_type_to_name (TextType t)
-{
-       switch (t) {
-       case TextType::UNKNOWN:
-               return _("Timed text");
-       case TextType::OPEN_SUBTITLE:
-               return _("Open subtitles");
-       case TextType::CLOSED_CAPTION:
-               return _("Closed captions");
-       default:
-               DCPOMATIC_ASSERT (false);
-       }
-}
-
 CPLSummary::CPLSummary (boost::filesystem::path p)
-       : dcp_directory (p.leaf().string())
+       : dcp_directory(p.filename().string())
 {
        dcp::DCP dcp (p);
 
@@ -115,7 +72,7 @@ CPLSummary::CPLSummary (boost::filesystem::path p)
        }
 
        boost::system::error_code ec;
-       auto last_write = boost::filesystem::last_write_time (p, ec);
+       auto last_write = dcp::filesystem::last_write_time(p, ec);
        last_write_time = ec ? 0 : last_write;
 }