projects
/
libsub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1e98875
)
Adapt for changes to libdcp API.
author
Carl Hetherington
<cth@carlh.net>
Mon, 9 Jul 2018 09:05:33 +0000
(10:05 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Mon, 9 Jul 2018 09:05:33 +0000
(10:05 +0100)
src/dcp_reader.cc
patch
|
blob
|
history
diff --git
a/src/dcp_reader.cc
b/src/dcp_reader.cc
index 6103470a8de4bb33bfd8c35447ab0ff2068a2c47..a3ee8e54753e568d87a2c47343de1680abd7e1a7 100644
(file)
--- a/
src/dcp_reader.cc
+++ b/
src/dcp_reader.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2014-201
7
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-201
8
Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-32,6
+32,7
@@
using std::string;
using std::exception;
using boost::shared_ptr;
using boost::optional;
using std::exception;
using boost::shared_ptr;
using boost::optional;
+using boost::dynamic_pointer_cast;
using namespace sub;
static Time
using namespace sub;
static Time
@@
-71,13
+72,20
@@
DCPReader::DCPReader (boost::filesystem::path file)
}
}
- BOOST_FOREACH (dcp::SubtitleString const & i, sc->subtitles ()) {
+ BOOST_FOREACH (shared_ptr<dcp::Subtitle> i, sc->subtitles ()) {
+
+ /* We don't deal with image subs */
+ shared_ptr<dcp::SubtitleString> is = dynamic_pointer_cast<dcp::SubtitleString>(i);
+ if (!is) {
+ continue;
+ }
+
RawSubtitle rs;
RawSubtitle rs;
- rs.text = i
.
text ();
- rs.font = i
.
font ();
- rs.font_size = FontSize::from_proportional (i
.
size() / (72.0 * 11.0));
+ rs.text = i
s->
text ();
+ rs.font = i
s->
font ();
+ rs.font_size = FontSize::from_proportional (i
s->
size() / (72.0 * 11.0));
- switch (i
.
effect ()) {
+ switch (i
s->
effect ()) {
case dcp::BORDER:
rs.effect = BORDER;
break;
case dcp::BORDER:
rs.effect = BORDER;
break;
@@
-88,14
+96,14
@@
DCPReader::DCPReader (boost::filesystem::path file)
break;
}
break;
}
- rs.effect_colour = dcp_to_sub_colour (i
.
effect_colour());
+ rs.effect_colour = dcp_to_sub_colour (i
s->
effect_colour());
- rs.colour = dcp_to_sub_colour (i
.
colour());
- rs.bold = i
.
bold ();
- rs.italic = i
.
italic ();
- rs.underline = i
.
underline ();
+ rs.colour = dcp_to_sub_colour (i
s->
colour());
+ rs.bold = i
s->
bold ();
+ rs.italic = i
s->
italic ();
+ rs.underline = i
s->
underline ();
- switch (i
.
h_align()) {
+ switch (i
s->
h_align()) {
case dcp::HALIGN_LEFT:
rs.horizontal_position.reference = LEFT_OF_SCREEN;
break;
case dcp::HALIGN_LEFT:
rs.horizontal_position.reference = LEFT_OF_SCREEN;
break;
@@
-107,8
+115,8
@@
DCPReader::DCPReader (boost::filesystem::path file)
break;
}
break;
}
- rs.vertical_position.proportional = i
.
v_position();
- switch (i
.
v_align()) {
+ rs.vertical_position.proportional = i
s->
v_position();
+ switch (i
s->
v_align()) {
case dcp::VALIGN_TOP:
rs.vertical_position.reference = TOP_OF_SCREEN;
break;
case dcp::VALIGN_TOP:
rs.vertical_position.reference = TOP_OF_SCREEN;
break;
@@
-120,11
+128,11
@@
DCPReader::DCPReader (boost::filesystem::path file)
break;
}
break;
}
- rs.from = dcp_to_sub_time (i
.
in ());
- rs.to = dcp_to_sub_time (i
.
out ());
+ rs.from = dcp_to_sub_time (i
s->
in ());
+ rs.to = dcp_to_sub_time (i
s->
out ());
- rs.fade_up = dcp_to_sub_time (i
.
fade_up_time ());
- rs.fade_down = dcp_to_sub_time (i
.
fade_down_time ());
+ rs.fade_up = dcp_to_sub_time (i
s->
fade_up_time ());
+ rs.fade_down = dcp_to_sub_time (i
s->
fade_down_time ());
_subs.push_back (rs);
}
_subs.push_back (rs);
}