projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More libdcp API tweaks.
[dcpomatic.git]
/
src
/
lib
/
types.cc
diff --git
a/src/lib/types.cc
b/src/lib/types.cc
index 68d97b8ff614b84617fc1779e9747da5ebf54b47..228ebf28f6d47bc442e12d8b4f43540c66ae1189 100644
(file)
--- a/
src/lib/types.cc
+++ b/
src/lib/types.cc
@@
-25,7
+25,7
@@
#include <dcp/raw_convert.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
-#include <dcp/reel_
mxf
.h>
+#include <dcp/reel_
file_asset
.h>
#include <dcp/reel_asset.h>
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
#include <dcp/reel_asset.h>
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
@@
-39,6
+39,7
@@
using std::min;
using std::string;
using std::list;
using std::shared_ptr;
using std::string;
using std::list;
using std::shared_ptr;
+using std::vector;
using dcp::raw_convert;
bool operator== (Crop const & a, Crop const & b)
using dcp::raw_convert;
bool operator== (Crop const & a, Crop const & b)
@@
-58,9
+59,9
@@
string
resolution_to_string (Resolution r)
{
switch (r) {
resolution_to_string (Resolution r)
{
switch (r) {
- case R
ESOLUTION_2
K:
+ case R
esolution::TWO_
K:
return "2K";
return "2K";
- case R
ESOLUTION_4
K:
+ case R
esolution::FOUR_
K:
return "4K";
}
return "4K";
}
@@
-73,15
+74,15
@@
Resolution
string_to_resolution (string s)
{
if (s == "2K") {
string_to_resolution (string s)
{
if (s == "2K") {
- return R
ESOLUTION_2
K;
+ return R
esolution::TWO_
K;
}
if (s == "4K") {
}
if (s == "4K") {
- return R
ESOLUTION_4
K;
+ return R
esolution::FOUR_
K;
}
DCPOMATIC_ASSERT (false);
}
DCPOMATIC_ASSERT (false);
- return R
ESOLUTION_2
K;
+ return R
esolution::TWO_
K;
}
Crop::Crop (shared_ptr<cxml::Node> node)
}
Crop::Crop (shared_ptr<cxml::Node> node)
@@
-105,11
+106,11
@@
TextType
string_to_text_type (string s)
{
if (s == "unknown") {
string_to_text_type (string s)
{
if (s == "unknown") {
- return T
EXT_
UNKNOWN;
+ return T
extType::
UNKNOWN;
} else if (s == "open-subtitle") {
} else if (s == "open-subtitle") {
- return T
EXT_
OPEN_SUBTITLE;
+ return T
extType::
OPEN_SUBTITLE;
} else if (s == "closed-caption") {
} else if (s == "closed-caption") {
- return T
EXT_
CLOSED_CAPTION;
+ return T
extType::
CLOSED_CAPTION;
} else {
throw MetadataError (String::compose ("Unknown text type %1", s));
}
} else {
throw MetadataError (String::compose ("Unknown text type %1", s));
}
@@
-119,11
+120,11
@@
string
text_type_to_string (TextType t)
{
switch (t) {
text_type_to_string (TextType t)
{
switch (t) {
- case T
EXT_
UNKNOWN:
+ case T
extType::
UNKNOWN:
return "unknown";
return "unknown";
- case T
EXT_
OPEN_SUBTITLE:
+ case T
extType::
OPEN_SUBTITLE:
return "open-subtitle";
return "open-subtitle";
- case T
EXT_
CLOSED_CAPTION:
+ case T
extType::
CLOSED_CAPTION:
return "closed-caption";
default:
DCPOMATIC_ASSERT (false);
return "closed-caption";
default:
DCPOMATIC_ASSERT (false);
@@
-134,11
+135,11
@@
string
text_type_to_name (TextType t)
{
switch (t) {
text_type_to_name (TextType t)
{
switch (t) {
- case T
EXT_
UNKNOWN:
+ case T
extType::
UNKNOWN:
return _("Timed text");
return _("Timed text");
- case T
EXT_
OPEN_SUBTITLE:
+ case T
extType::
OPEN_SUBTITLE:
return _("Open subtitles");
return _("Open subtitles");
- case T
EXT_
CLOSED_CAPTION:
+ case T
extType::
CLOSED_CAPTION:
return _("Closed captions");
default:
DCPOMATIC_ASSERT (false);
return _("Closed captions");
default:
DCPOMATIC_ASSERT (false);
@@
-149,19
+150,19
@@
string
video_frame_type_to_string (VideoFrameType t)
{
switch (t) {
video_frame_type_to_string (VideoFrameType t)
{
switch (t) {
- case V
IDEO_FRAME_TYPE_2
D:
+ case V
ideoFrameType::TWO_
D:
return "2d";
return "2d";
- case V
IDEO_FRAME_TYPE_3
D:
+ case V
ideoFrameType::THREE_
D:
return "3d";
return "3d";
- case V
IDEO_FRAME_TYPE_3
D_LEFT_RIGHT:
+ case V
ideoFrameType::THREE_
D_LEFT_RIGHT:
return "3d-left-right";
return "3d-left-right";
- case V
IDEO_FRAME_TYPE_3
D_TOP_BOTTOM:
+ case V
ideoFrameType::THREE_
D_TOP_BOTTOM:
return "3d-top-bottom";
return "3d-top-bottom";
- case V
IDEO_FRAME_TYPE_3
D_ALTERNATE:
+ case V
ideoFrameType::THREE_
D_ALTERNATE:
return "3d-alternate";
return "3d-alternate";
- case V
IDEO_FRAME_TYPE_3
D_LEFT:
+ case V
ideoFrameType::THREE_
D_LEFT:
return "3d-left";
return "3d-left";
- case V
IDEO_FRAME_TYPE_3
D_RIGHT:
+ case V
ideoFrameType::THREE_
D_RIGHT:
return "3d-right";
default:
DCPOMATIC_ASSERT (false);
return "3d-right";
default:
DCPOMATIC_ASSERT (false);
@@
-174,19
+175,19
@@
VideoFrameType
string_to_video_frame_type (string s)
{
if (s == "2d") {
string_to_video_frame_type (string s)
{
if (s == "2d") {
- return V
IDEO_FRAME_TYPE_2
D;
+ return V
ideoFrameType::TWO_
D;
} else if (s == "3d") {
} else if (s == "3d") {
- return V
IDEO_FRAME_TYPE_3
D;
+ return V
ideoFrameType::THREE_
D;
} else if (s == "3d-left-right") {
} else if (s == "3d-left-right") {
- return V
IDEO_FRAME_TYPE_3
D_LEFT_RIGHT;
+ return V
ideoFrameType::THREE_
D_LEFT_RIGHT;
} else if (s == "3d-top-bottom") {
} else if (s == "3d-top-bottom") {
- return V
IDEO_FRAME_TYPE_3
D_TOP_BOTTOM;
+ return V
ideoFrameType::THREE_
D_TOP_BOTTOM;
} else if (s == "3d-alternate") {
} else if (s == "3d-alternate") {
- return V
IDEO_FRAME_TYPE_3
D_ALTERNATE;
+ return V
ideoFrameType::THREE_
D_ALTERNATE;
} else if (s == "3d-left") {
} else if (s == "3d-left") {
- return V
IDEO_FRAME_TYPE_3
D_LEFT;
+ return V
ideoFrameType::THREE_
D_LEFT;
} else if (s == "3d-right") {
} else if (s == "3d-right") {
- return V
IDEO_FRAME_TYPE_3
D_RIGHT;
+ return V
ideoFrameType::THREE_
D_RIGHT;
}
DCPOMATIC_ASSERT (false);
}
DCPOMATIC_ASSERT (false);
@@
-197,10
+198,10
@@
CPLSummary::CPLSummary (boost::filesystem::path p)
{
dcp::DCP dcp (p);
{
dcp::DCP dcp (p);
-
list
<dcp::VerificationNote> notes;
+
vector
<dcp::VerificationNote> notes;
dcp.read (¬es);
for (auto i: notes) {
dcp.read (¬es);
for (auto i: notes) {
- if (i.code() != dcp::VerificationNote::EXTERNAL_ASSET) {
+ if (i.code() != dcp::VerificationNote::
Code::
EXTERNAL_ASSET) {
/* It's not just a warning about this DCP being a VF */
throw dcp::ReadError(dcp::note_to_string(i));
}
/* It's not just a warning about this DCP being a VF */
throw dcp::ReadError(dcp::note_to_string(i));
}
@@
-212,14
+213,16
@@
CPLSummary::CPLSummary (boost::filesystem::path p)
encrypted = false;
for (auto j: dcp.cpls()) {
encrypted = false;
for (auto j: dcp.cpls()) {
- for (auto k: j->reel_
mxf
s()) {
- if (k->
key_i
d()) {
+ for (auto k: j->reel_
file_asset
s()) {
+ if (k->
encrypte
d()) {
encrypted = true;
}
}
}
encrypted = true;
}
}
}
- last_write_time = boost::filesystem::last_write_time (p);
+ boost::system::error_code ec;
+ auto last_write = boost::filesystem::last_write_time (p, ec);
+ last_write_time = ec ? 0 : last_write;
}
}
@@
-233,9
+236,9
@@
string
video_range_to_string (VideoRange r)
{
switch (r) {
video_range_to_string (VideoRange r)
{
switch (r) {
- case V
IDEO_RANGE_
FULL:
+ case V
ideoRange::
FULL:
return "full";
return "full";
- case V
IDEO_RANGE_
VIDEO:
+ case V
ideoRange::
VIDEO:
return "video";
default:
DCPOMATIC_ASSERT (false);
return "video";
default:
DCPOMATIC_ASSERT (false);
@@
-247,12
+250,12
@@
VideoRange
string_to_video_range (string s)
{
if (s == "full") {
string_to_video_range (string s)
{
if (s == "full") {
- return V
IDEO_RANGE_
FULL;
+ return V
ideoRange::
FULL;
} else if (s == "video") {
} else if (s == "video") {
- return V
IDEO_RANGE_
VIDEO;
+ return V
ideoRange::
VIDEO;
}
DCPOMATIC_ASSERT (false);
}
DCPOMATIC_ASSERT (false);
- return V
IDEO_RANGE_
FULL;
+ return V
ideoRange::
FULL;
}
}