projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
138882d
)
Account for split branch in libdcp.
split
author
Carl Hetherington
<cth@carlh.net>
Tue, 5 Dec 2023 00:59:44 +0000
(
01:59
+0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 5 Dec 2023 00:59:44 +0000
(
01:59
+0100)
37 files changed:
src/lib/analyse_subtitles_job.cc
patch
|
blob
|
history
src/lib/content_factory.cc
patch
|
blob
|
history
src/lib/content_text.h
patch
|
blob
|
history
src/lib/dcp_decoder.cc
patch
|
blob
|
history
src/lib/dcp_decoder.h
patch
|
blob
|
history
src/lib/dcp_examiner.cc
patch
|
blob
|
history
src/lib/dcp_subtitle.cc
patch
|
blob
|
history
src/lib/dcp_subtitle.h
patch
|
blob
|
history
src/lib/dcp_subtitle_content.cc
patch
|
blob
|
history
src/lib/dcp_subtitle_decoder.cc
patch
|
blob
|
history
src/lib/dcp_subtitle_decoder.h
patch
|
blob
|
history
src/lib/ffmpeg_decoder.cc
patch
|
blob
|
history
src/lib/font_id_allocator.cc
patch
|
blob
|
history
src/lib/font_id_allocator.h
patch
|
blob
|
history
src/lib/hints.cc
patch
|
blob
|
history
src/lib/map_cli.cc
patch
|
blob
|
history
src/lib/reel_writer.cc
patch
|
blob
|
history
src/lib/reel_writer.h
patch
|
blob
|
history
src/lib/render_text.cc
patch
|
blob
|
history
src/lib/render_text.h
patch
|
blob
|
history
src/lib/string_text.h
patch
|
blob
|
history
src/lib/string_text_file_decoder.cc
patch
|
blob
|
history
src/lib/subtitle_encoder.cc
patch
|
blob
|
history
src/lib/subtitle_encoder.h
patch
|
blob
|
history
src/lib/text_decoder.cc
patch
|
blob
|
history
src/lib/text_decoder.h
patch
|
blob
|
history
src/lib/util.cc
patch
|
blob
|
history
src/lib/util.h
patch
|
blob
|
history
test/dcp_subtitle_test.cc
patch
|
blob
|
history
test/render_subtitles_test.cc
patch
|
blob
|
history
test/srt_subtitle_test.cc
patch
|
blob
|
history
test/ssa_subtitle_test.cc
patch
|
blob
|
history
test/subtitle_font_id_test.cc
patch
|
blob
|
history
test/subtitle_position_test.cc
patch
|
blob
|
history
test/subtitle_reel_number_test.cc
patch
|
blob
|
history
test/subtitle_reel_test.cc
patch
|
blob
|
history
test/subtitle_timing_test.cc
patch
|
blob
|
history
diff --git
a/src/lib/analyse_subtitles_job.cc
b/src/lib/analyse_subtitles_job.cc
index b41990db5f738dcfc5aad537a96b359861a4948d..ffc6b3fe2e1c8595c470a3ab5d3e262d46e41c36 100644
(file)
--- a/
src/lib/analyse_subtitles_job.cc
+++ b/
src/lib/analyse_subtitles_job.cc
@@
-115,20
+115,20
@@
AnalyseSubtitlesJob::analyse(PlayerText const& text, TextType type)
/* We can provide dummy values for time and frame rate here as they are only used to calculate fades */
dcp::Size const frame = _film->frame_size();
/* We can provide dummy values for time and frame rate here as they are only used to calculate fades */
dcp::Size const frame = _film->frame_size();
- std::vector<dcp::
Subtitle
Standard> override_standard;
+ std::vector<dcp::
Text
Standard> override_standard;
if (_film->interop()) {
/* Since the film is Interop there is only one way the vpositions in the subs can be interpreted
* (we assume).
*/
if (_film->interop()) {
/* Since the film is Interop there is only one way the vpositions in the subs can be interpreted
* (we assume).
*/
- override_standard.push_back(dcp::
Subtitle
Standard::INTEROP);
+ override_standard.push_back(dcp::
Text
Standard::INTEROP);
} else {
/* We're using the great new SMPTE standard, which means there are two different ways that vposition
* could be interpreted; we will write SMPTE-2014 standard assets, but if the projection system uses
* SMPTE 20{07,10} instead they won't be placed how we intended. To show the user this, make the
* bounding rectangle enclose both possibilities.
*/
} else {
/* We're using the great new SMPTE standard, which means there are two different ways that vposition
* could be interpreted; we will write SMPTE-2014 standard assets, but if the projection system uses
* SMPTE 20{07,10} instead they won't be placed how we intended. To show the user this, make the
* bounding rectangle enclose both possibilities.
*/
- override_standard.push_back(dcp::
Subtitle
Standard::SMPTE_2007);
- override_standard.push_back(dcp::
Subtitle
Standard::SMPTE_2014);
+ override_standard.push_back(dcp::
Text
Standard::SMPTE_2007);
+ override_standard.push_back(dcp::
Text
Standard::SMPTE_2014);
}
for (auto standard: override_standard) {
}
for (auto standard: override_standard) {
diff --git
a/src/lib/content_factory.cc
b/src/lib/content_factory.cc
index dfa1ba55e4d4795ebdc66e23408390ec7c1b7814..bac41f940a38dd27de7e53d33aec862b87cd144f 100644
(file)
--- a/
src/lib/content_factory.cc
+++ b/
src/lib/content_factory.cc
@@
-41,7
+41,7
@@
#include "compose.hpp"
#include <libcxml/cxml.h>
#include <dcp/filesystem.h>
#include "compose.hpp"
#include <libcxml/cxml.h>
#include <dcp/filesystem.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <boost/algorithm/string.hpp>
#include "i18n.h"
#include <boost/algorithm/string.hpp>
#include "i18n.h"
@@
-178,7
+178,7
@@
content_factory (boost::filesystem::path path)
throw KDMAsContentError ();
}
single = make_shared<DCPSubtitleContent>(path);
throw KDMAsContentError ();
}
single = make_shared<DCPSubtitleContent>(path);
- } else if (ext == ".mxf" && dcp::SMPTE
Subtitle
Asset::valid_mxf(path)) {
+ } else if (ext == ".mxf" && dcp::SMPTE
Text
Asset::valid_mxf(path)) {
single = make_shared<DCPSubtitleContent>(path);
} else if (ext == ".mxf" && VideoMXFContent::valid_mxf(path)) {
single = make_shared<VideoMXFContent>(path);
single = make_shared<DCPSubtitleContent>(path);
} else if (ext == ".mxf" && VideoMXFContent::valid_mxf(path)) {
single = make_shared<VideoMXFContent>(path);
diff --git
a/src/lib/content_text.h
b/src/lib/content_text.h
index 51d4e8009942899c7008dcb838d27733de37af03..4b59ac65f4ccfa1d5f33277956e6fee9f8538177 100644
(file)
--- a/
src/lib/content_text.h
+++ b/
src/lib/content_text.h
@@
-27,7
+27,7
@@
#include "dcpomatic_time.h"
#include "rect.h"
#include "string_text.h"
#include "dcpomatic_time.h"
#include "rect.h"
#include "string_text.h"
-#include <dcp/
subtitle
_string.h>
+#include <dcp/
text
_string.h>
#include <vector>
#include <vector>
diff --git
a/src/lib/dcp_decoder.cc
b/src/lib/dcp_decoder.cc
index 3a187186390dcaa76330494f1e94410d51b87476..9e8959d7116b30101075b051195ade16f90a528f 100644
(file)
--- a/
src/lib/dcp_decoder.cc
+++ b/
src/lib/dcp_decoder.cc
@@
-281,7
+281,7
@@
DCPDecoder::pass_texts (ContentTime next, dcp::Size size)
void
DCPDecoder::pass_texts (
void
DCPDecoder::pass_texts (
- ContentTime next, shared_ptr<dcp::
Subtitle
Asset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size
+ ContentTime next, shared_ptr<dcp::
Text
Asset> asset, bool reference, int64_t entry_point, shared_ptr<TextDecoder> decoder, dcp::Size size
)
{
auto const vfr = _dcp_content->active_video_frame_rate (film());
)
{
auto const vfr = _dcp_content->active_video_frame_rate (film());
@@
-289,16
+289,16
@@
DCPDecoder::pass_texts (
auto const frame = next.frames_round (vfr);
if (_decode_referenced || !reference) {
auto const frame = next.frames_round (vfr);
if (_decode_referenced || !reference) {
- auto subs = asset->
subtitles_during
(
+ auto subs = asset->
texts_during
(
dcp::Time (entry_point + frame, vfr, vfr),
dcp::Time (entry_point + frame + 1, vfr, vfr),
true
);
dcp::Time (entry_point + frame, vfr, vfr),
dcp::Time (entry_point + frame + 1, vfr, vfr),
true
);
- vector<dcp::
Subtitle
String> strings;
+ vector<dcp::
Text
String> strings;
for (auto i: subs) {
for (auto i: subs) {
- auto is = dynamic_pointer_cast<const dcp::
Subtitle
String>(i);
+ auto is = dynamic_pointer_cast<const dcp::
Text
String>(i);
if (is) {
if (!strings.empty() && (strings.back().in() != is->in() || strings.back().out() != is->out())) {
auto b = strings.back();
if (is) {
if (!strings.empty() && (strings.back().in() != is->in() || strings.back().out() != is->out())) {
auto b = strings.back();
@@
-308,12
+308,12
@@
DCPDecoder::pass_texts (
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
),
strings,
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
),
strings,
- asset->
subtitle
_standard()
+ asset->
text
_standard()
);
strings.clear ();
}
);
strings.clear ();
}
- dcp::
Subtitle
String is_copy = *is;
+ dcp::
Text
String is_copy = *is;
is_copy.set_font(_font_id_allocator.font_id(_reel - _reels.begin(), asset->id(), is_copy.font().get_value_or("")));
strings.push_back(is_copy);
}
is_copy.set_font(_font_id_allocator.font_id(_reel - _reels.begin(), asset->id(), is_copy.font().get_value_or("")));
strings.push_back(is_copy);
}
@@
-344,7
+344,7
@@
DCPDecoder::pass_texts (
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
),
strings,
ContentTime::from_frames(_offset - entry_point, vfr) + ContentTime::from_seconds(b.out().as_seconds())
),
strings,
- asset->
subtitle
_standard()
+ asset->
text
_standard()
);
strings.clear ();
}
);
strings.clear ();
}
diff --git
a/src/lib/dcp_decoder.h
b/src/lib/dcp_decoder.h
index 2c0cd8f413ad7612ceeeae3e122694a9bf6d2bf2..b68eae80e7eca37f2dfa559ec9c0647ffbb918e2 100644
(file)
--- a/
src/lib/dcp_decoder.h
+++ b/
src/lib/dcp_decoder.h
@@
-30,7
+30,7
@@
#include <dcp/mono_picture_asset_reader.h>
#include <dcp/stereo_picture_asset_reader.h>
#include <dcp/sound_asset_reader.h>
#include <dcp/mono_picture_asset_reader.h>
#include <dcp/stereo_picture_asset_reader.h>
#include <dcp/sound_asset_reader.h>
-#include <dcp/
subtitle
_asset.h>
+#include <dcp/
text
_asset.h>
namespace dcp {
namespace dcp {
@@
-77,7
+77,7
@@
private:
void pass_texts (dcpomatic::ContentTime next, dcp::Size size);
void pass_texts (
dcpomatic::ContentTime next,
void pass_texts (dcpomatic::ContentTime next, dcp::Size size);
void pass_texts (
dcpomatic::ContentTime next,
- std::shared_ptr<dcp::
Subtitle
Asset> asset,
+ std::shared_ptr<dcp::
Text
Asset> asset,
bool reference,
int64_t entry_point,
std::shared_ptr<TextDecoder> decoder,
bool reference,
int64_t entry_point,
std::shared_ptr<TextDecoder> decoder,
diff --git
a/src/lib/dcp_examiner.cc
b/src/lib/dcp_examiner.cc
index ca77f2db3bdaedfc560206e8937a9df9889ef4a0..f7ef559efb18befef8a520f4e8ff006ebfb097b7 100644
(file)
--- a/
src/lib/dcp_examiner.cc
+++ b/
src/lib/dcp_examiner.cc
@@
-48,7
+48,7
@@
#include <dcp/stereo_picture_asset.h>
#include <dcp/stereo_picture_asset_reader.h>
#include <dcp/stereo_picture_frame.h>
#include <dcp/stereo_picture_asset.h>
#include <dcp/stereo_picture_asset_reader.h>
#include <dcp/stereo_picture_frame.h>
-#include <dcp/
subtitle
_asset.h>
+#include <dcp/
text
_asset.h>
#include <iostream>
#include "i18n.h"
#include <iostream>
#include "i18n.h"
@@
-326,7
+326,7
@@
DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
LOG_GENERAL_NC ("Subtitle has no key");
break;
}
LOG_GENERAL_NC ("Subtitle has no key");
break;
}
- sub->
subtitles
();
+ sub->
texts
();
}
if (i->atmos()) {
}
if (i->atmos()) {
diff --git
a/src/lib/dcp_subtitle.cc
b/src/lib/dcp_subtitle.cc
index c2c3f7f70a6c4215955c82c963090d8ab1a5b8b2..c2d390b55b9cd30ef3b929398f220e75f2c53937 100644
(file)
--- a/
src/lib/dcp_subtitle.cc
+++ b/
src/lib/dcp_subtitle.cc
@@
-22,8
+22,8
@@
#include "dcp_subtitle.h"
#include "exceptions.h"
#include "compose.hpp"
#include "dcp_subtitle.h"
#include "exceptions.h"
#include "compose.hpp"
-#include <dcp/interop_
subtitle
_asset.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <memory>
#include "i18n.h"
#include <memory>
#include "i18n.h"
@@
-35,22
+35,22
@@
using std::string;
using std::make_shared;
using std::make_shared;
-shared_ptr<dcp::
Subtitle
Asset>
+shared_ptr<dcp::
Text
Asset>
DCPSubtitle::load (boost::filesystem::path file) const
{
DCPSubtitle::load (boost::filesystem::path file) const
{
- shared_ptr<dcp::
Subtitle
Asset> sc;
+ shared_ptr<dcp::
Text
Asset> sc;
string interop_error;
string smpte_error;
try {
string interop_error;
string smpte_error;
try {
- sc = make_shared<dcp::Interop
Subtitle
Asset>(file);
+ sc = make_shared<dcp::Interop
Text
Asset>(file);
} catch (exception& e) {
interop_error = e.what ();
}
if (!sc) {
try {
} catch (exception& e) {
interop_error = e.what ();
}
if (!sc) {
try {
- sc = make_shared<dcp::SMPTE
Subtitle
Asset>(file);
+ sc = make_shared<dcp::SMPTE
Text
Asset>(file);
} catch (exception& e) {
smpte_error = e.what();
}
} catch (exception& e) {
smpte_error = e.what();
}
diff --git
a/src/lib/dcp_subtitle.h
b/src/lib/dcp_subtitle.h
index 285dd55bc4a1e931a3d3ab550bef2565c4dcdc55..0f79281030ea2b32da87c9b68af80877685d666b 100644
(file)
--- a/
src/lib/dcp_subtitle.h
+++ b/
src/lib/dcp_subtitle.h
@@
-28,14
+28,14
@@
namespace dcp {
namespace dcp {
- class
Subtitle
Asset;
+ class
Text
Asset;
}
class DCPSubtitle
{
protected:
}
class DCPSubtitle
{
protected:
- std::shared_ptr<dcp::
SubtitleAsset> load
(boost::filesystem::path) const;
+ std::shared_ptr<dcp::
TextAsset> load
(boost::filesystem::path) const;
};
};
diff --git
a/src/lib/dcp_subtitle_content.cc
b/src/lib/dcp_subtitle_content.cc
index b3e24d5e2dceef959cfb74d67fecbb64f62b9928..5458f13913a7652cc1ee18ab8c366a510e6b891b 100644
(file)
--- a/
src/lib/dcp_subtitle_content.cc
+++ b/
src/lib/dcp_subtitle_content.cc
@@
-23,8
+23,8
@@
#include "film.h"
#include "text_content.h"
#include <dcp/raw_convert.h>
#include "film.h"
#include "text_content.h"
#include <dcp/raw_convert.h>
-#include <dcp/interop_
subtitle
_asset.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <dcp/interop_load_font_node.h>
#include <libxml++/libxml++.h>
#include <dcp/interop_load_font_node.h>
#include <libxml++/libxml++.h>
@@
-59,8
+59,8
@@
DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
auto subtitle_asset = load(path(0));
auto subtitle_asset = load(path(0));
- auto iop = dynamic_pointer_cast<dcp::Interop
Subtitle
Asset>(subtitle_asset);
- auto smpte = dynamic_pointer_cast<dcp::SMPTE
Subtitle
Asset>(subtitle_asset);
+ auto iop = dynamic_pointer_cast<dcp::Interop
Text
Asset>(subtitle_asset);
+ auto smpte = dynamic_pointer_cast<dcp::SMPTE
Text
Asset>(subtitle_asset);
if (smpte) {
set_video_frame_rate(film, smpte->edit_rate().numerator);
}
if (smpte) {
set_video_frame_rate(film, smpte->edit_rate().numerator);
}
@@
-70,7
+70,7
@@
DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
/* Default to turning these subtitles on */
only_text()->set_use (true);
/* Default to turning these subtitles on */
only_text()->set_use (true);
- _length = ContentTime::from_seconds(subtitle_asset->latest_
subtitle
_out().as_seconds());
+ _length = ContentTime::from_seconds(subtitle_asset->latest_
text
_out().as_seconds());
subtitle_asset->fix_empty_font_ids();
subtitle_asset->fix_empty_font_ids();
diff --git
a/src/lib/dcp_subtitle_decoder.cc
b/src/lib/dcp_subtitle_decoder.cc
index b3e6d75531bcbf4fd86ffd0d812aae9558048f19..04dfddd1293b24a7aa14192db508c34dfc21f567 100644
(file)
--- a/
src/lib/dcp_subtitle_decoder.cc
+++ b/
src/lib/dcp_subtitle_decoder.cc
@@
-25,7
+25,7
@@
#include "font.h"
#include "text_content.h"
#include "util.h"
#include "font.h"
#include "text_content.h"
#include "util.h"
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/load_font_node.h>
#include <dcp/load_font_node.h>
@@
-45,10
+45,10
@@
DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<
/* Load the XML or MXF file */
auto const asset = load (content->path(0));
asset->fix_empty_font_ids ();
/* Load the XML or MXF file */
auto const asset = load (content->path(0));
asset->fix_empty_font_ids ();
- _subtitles = asset->
subtitles
();
+ _subtitles = asset->
texts
();
_next = _subtitles.begin ();
_next = _subtitles.begin ();
- _subtitle_standard = asset->
subtitle
_standard();
+ _subtitle_standard = asset->
text
_standard();
text.push_back (make_shared<TextDecoder>(this, content->only_text()));
update_position();
text.push_back (make_shared<TextDecoder>(this, content->only_text()));
update_position();
@@
-84,12
+84,12
@@
DCPSubtitleDecoder::pass ()
time of emitting the first.
*/
time of emitting the first.
*/
- vector<dcp::
Subtitle
String> s;
+ vector<dcp::
Text
String> s;
vector<dcp::SubtitleImage> i;
auto const p = content_time_period (*_next);
while (_next != _subtitles.end () && content_time_period (*_next) == p) {
vector<dcp::SubtitleImage> i;
auto const p = content_time_period (*_next);
while (_next != _subtitles.end () && content_time_period (*_next) == p) {
- auto ns = dynamic_pointer_cast<const dcp::
Subtitle
String>(*_next);
+ auto ns = dynamic_pointer_cast<const dcp::
Text
String>(*_next);
if (ns) {
s.push_back (*ns);
++_next;
if (ns) {
s.push_back (*ns);
++_next;
@@
-115,7
+115,7
@@
DCPSubtitleDecoder::pass ()
ContentTimePeriod
ContentTimePeriod
-DCPSubtitleDecoder::content_time_period
(shared_ptr<const dcp::Subtitle
> s) const
+DCPSubtitleDecoder::content_time_period
(shared_ptr<const dcp::Text
> s) const
{
return {
ContentTime::from_seconds(s->in().as_seconds()),
{
return {
ContentTime::from_seconds(s->in().as_seconds()),
diff --git
a/src/lib/dcp_subtitle_decoder.h
b/src/lib/dcp_subtitle_decoder.h
index 45a4999ddcf769781bd87c8a577264b6511a6e06..cb5952d5d35e4be9dfcc67e58c089b9e3ac376de 100644
(file)
--- a/
src/lib/dcp_subtitle_decoder.h
+++ b/
src/lib/dcp_subtitle_decoder.h
@@
-37,11
+37,11
@@
public:
boost::optional<dcpomatic::ContentTime> first () const;
private:
boost::optional<dcpomatic::ContentTime> first () const;
private:
- dcpomatic::ContentTimePeriod content_time_period
(std::shared_ptr<const dcp::Subtitle
> s) const;
+ dcpomatic::ContentTimePeriod content_time_period
(std::shared_ptr<const dcp::Text
> s) const;
void update_position();
void update_position();
- std::vector<std::shared_ptr<const dcp::
Subtitle
>> _subtitles;
- std::vector<std::shared_ptr<const dcp::
Subtitle
>>::const_iterator _next;
+ std::vector<std::shared_ptr<const dcp::
Text
>> _subtitles;
+ std::vector<std::shared_ptr<const dcp::
Text
>>::const_iterator _next;
- dcp::
Subtitle
Standard _subtitle_standard;
+ dcp::
Text
Standard _subtitle_standard;
};
};
diff --git
a/src/lib/ffmpeg_decoder.cc
b/src/lib/ffmpeg_decoder.cc
index 6e9d671a2fa87792e2ea5b58d6b2d9b2e136822c..1da2998ef5fd5cfa533ee58609d9704f1de596d1 100644
(file)
--- a/
src/lib/ffmpeg_decoder.cc
+++ b/
src/lib/ffmpeg_decoder.cc
@@
-45,7
+45,7
@@
#include "util.h"
#include "video_decoder.h"
#include "video_filter_graph.h"
#include "util.h"
#include "video_decoder.h"
#include "video_filter_graph.h"
-#include <dcp/
subtitle
_string.h>
+#include <dcp/
text
_string.h>
#include <sub/ssa_reader.h>
#include <sub/subtitle.h>
#include <sub/collect.h>
#include <sub/ssa_reader.h>
#include <sub/subtitle.h>
#include <sub/collect.h>
diff --git
a/src/lib/font_id_allocator.cc
b/src/lib/font_id_allocator.cc
index 70eda2b0613caa2402a24502d9e89d7a769073ed..529361e41e9be40e65412e8710f65aeeb969ad02 100644
(file)
--- a/
src/lib/font_id_allocator.cc
+++ b/
src/lib/font_id_allocator.cc
@@
-26,7
+26,7
@@
#include <dcp/reel.h>
#include <dcp/reel_closed_caption_asset.h>
#include <dcp/reel_subtitle_asset.h>
#include <dcp/reel.h>
#include <dcp/reel_closed_caption_asset.h>
#include <dcp/reel_subtitle_asset.h>
-#include <dcp/
subtitle
_asset.h>
+#include <dcp/
text
_asset.h>
#include <set>
#include <string>
#include <vector>
#include <set>
#include <string>
#include <vector>
@@
-57,7
+57,7
@@
FontIDAllocator::add_fonts_from_reels(vector<shared_ptr<dcp::Reel>> const& reels
void
void
-FontIDAllocator::add_fonts_from_asset(int reel_index, shared_ptr<const dcp::
Subtitle
Asset> asset)
+FontIDAllocator::add_fonts_from_asset(int reel_index, shared_ptr<const dcp::
Text
Asset> asset)
{
for (auto const& font: asset->font_data()) {
_map[Font(reel_index, asset->id(), font.first)] = 0;
{
for (auto const& font: asset->font_data()) {
_map[Font(reel_index, asset->id(), font.first)] = 0;
diff --git
a/src/lib/font_id_allocator.h
b/src/lib/font_id_allocator.h
index bd99cad6313fa336ddddef6df85d08d0a161d2ec..edec394ae8ac072fd364f7c2e4372adf06b3d335 100644
(file)
--- a/
src/lib/font_id_allocator.h
+++ b/
src/lib/font_id_allocator.h
@@
-31,7
+31,7
@@
namespace dcp {
class Reel;
namespace dcp {
class Reel;
- class
Subtitle
Asset;
+ class
Text
Asset;
}
}
@@
-68,7
+68,7
@@
public:
std::string font_id(int reel_index, std::string asset_id, std::string font_id) const;
private:
std::string font_id(int reel_index, std::string asset_id, std::string font_id) const;
private:
- void add_fonts_from_asset(int reel_index, std::shared_ptr<const dcp::
Subtitle
Asset> asset);
+ void add_fonts_from_asset(int reel_index, std::shared_ptr<const dcp::
Text
Asset> asset);
struct Font
{
struct Font
{
diff --git
a/src/lib/hints.cc
b/src/lib/hints.cc
index b4d94dbcc3d03ab4ab06de1045c94cdd2b7f153f..0d4546c136a4e6227779cf22ad2e66d0a75d13fd 100644
(file)
--- a/
src/lib/hints.cc
+++ b/
src/lib/hints.cc
@@
-351,7
+351,7
@@
Hints::check_loudness ()
static
bool
static
bool
-subtitle_mxf_too_big
(shared_ptr<dcp::Subtitle
Asset> asset)
+subtitle_mxf_too_big
(shared_ptr<dcp::Text
Asset> asset)
{
return asset && asset->file() && dcp::filesystem::file_size(*asset->file()) >= (MAX_TEXT_MXF_SIZE - SIZE_SLACK);
}
{
return asset && asset->file() && dcp::filesystem::file_size(*asset->file()) >= (MAX_TEXT_MXF_SIZE - SIZE_SLACK);
}
diff --git
a/src/lib/map_cli.cc
b/src/lib/map_cli.cc
index e38af69cf08e9773dba3d7b00b18683c06ad434b..7a88278818dd4f4b2176b5c566fd5201e9d38673 100644
(file)
--- a/
src/lib/map_cli.cc
+++ b/
src/lib/map_cli.cc
@@
-24,7
+24,7
@@
#include "util.h"
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include "util.h"
#include <dcp/cpl.h>
#include <dcp/dcp.h>
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/filesystem.h>
#include <dcp/font_asset.h>
#include <dcp/mono_picture_asset.h>
#include <dcp/filesystem.h>
#include <dcp/font_asset.h>
#include <dcp/mono_picture_asset.h>
@@
-35,7
+35,7
@@
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_subtitle_asset.h>
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_subtitle_asset.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <dcp/sound_asset.h>
#include <dcp/stereo_picture_asset.h>
#include <boost/optional.hpp>
#include <dcp/sound_asset.h>
#include <dcp/stereo_picture_asset.h>
#include <boost/optional.hpp>
@@
-277,15
+277,15
@@
map_cli(int argc, char* argv[], std::function<void (string)> out)
}
};
}
};
- auto maybe_copy_font_and_images = [&maybe_copy, output_dir, copy](shared_ptr<const dcp::
Subtitle
Asset> asset, bool rename, bool hard_link, bool soft_link) {
- auto interop = dynamic_pointer_cast<const dcp::Interop
Subtitle
Asset>(asset);
+ auto maybe_copy_font_and_images = [&maybe_copy, output_dir, copy](shared_ptr<const dcp::
Text
Asset> asset, bool rename, bool hard_link, bool soft_link) {
+ auto interop = dynamic_pointer_cast<const dcp::Interop
Text
Asset>(asset);
boost::optional<boost::filesystem::path> extra;
if (interop) {
extra = interop->id();
for (auto font_asset: interop->font_assets()) {
maybe_copy(font_asset->id(), rename, hard_link, soft_link, extra);
}
boost::optional<boost::filesystem::path> extra;
if (interop) {
extra = interop->id();
for (auto font_asset: interop->font_assets()) {
maybe_copy(font_asset->id(), rename, hard_link, soft_link, extra);
}
- for (auto subtitle: interop->
subtitle
s()) {
+ for (auto subtitle: interop->
text
s()) {
if (auto image = dynamic_pointer_cast<const dcp::SubtitleImage>(subtitle)) {
auto const output_path = *output_dir / asset->id() / image->file()->filename();
copy(*image->file(), output_path, hard_link, soft_link);
if (auto image = dynamic_pointer_cast<const dcp::SubtitleImage>(subtitle)) {
auto const output_path = *output_dir / asset->id() / image->file()->filename();
copy(*image->file(), output_path, hard_link, soft_link);
diff --git
a/src/lib/reel_writer.cc
b/src/lib/reel_writer.cc
index 1b33cae852eedcbb1ed5330d9e20bf52bc77bd03..8d30c16681eb5260cebb4ab254b412a0bcd11ea9 100644
(file)
--- a/
src/lib/reel_writer.cc
+++ b/
src/lib/reel_writer.cc
@@
-39,7
+39,7
@@
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/filesystem.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/filesystem.h>
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/mono_picture_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/reel.h>
#include <dcp/mono_picture_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/reel.h>
@@
-52,7
+52,7
@@
#include <dcp/reel_smpte_subtitle_asset.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_stereo_picture_asset.h>
#include <dcp/reel_smpte_subtitle_asset.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel_stereo_picture_asset.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <dcp/sound_asset.h>
#include <dcp/sound_asset_writer.h>
#include <dcp/stereo_picture_asset.h>
#include <dcp/sound_asset.h>
#include <dcp/sound_asset_writer.h>
#include <dcp/stereo_picture_asset.h>
@@
-465,7
+465,7
@@
ReelWriter::finish (boost::filesystem::path output_dcp)
template <class Interop, class SMPTE, class Result>
shared_ptr<Result>
maybe_add_text (
template <class Interop, class SMPTE, class Result>
shared_ptr<Result>
maybe_add_text (
- shared_ptr<dcp::
Subtitle
Asset> asset,
+ shared_ptr<dcp::
Text
Asset> asset,
int64_t picture_duration,
shared_ptr<dcp::Reel> reel,
int reel_index,
int64_t picture_duration,
shared_ptr<dcp::Reel> reel,
int reel_index,
@@
-483,7
+483,7
@@
maybe_add_text (
shared_ptr<Result> reel_asset;
if (asset) {
shared_ptr<Result> reel_asset;
if (asset) {
- if (auto interop = dynamic_pointer_cast<dcp::Interop
Subtitle
Asset>(asset)) {
+ if (auto interop = dynamic_pointer_cast<dcp::Interop
Text
Asset>(asset)) {
auto directory = output_dcp / interop->id ();
dcp::filesystem::create_directories(directory);
interop->write (directory / subtitle_asset_filename(asset, reel_index, reel_count, content_summary, ".xml"));
auto directory = output_dcp / interop->id ();
dcp::filesystem::create_directories(directory);
interop->write (directory / subtitle_asset_filename(asset, reel_index, reel_count, content_summary, ".xml"));
@@
-493,7
+493,7
@@
maybe_add_text (
picture_duration,
0
);
picture_duration,
0
);
- } else if (auto smpte = dynamic_pointer_cast<dcp::SMPTE
Subtitle
Asset>(asset)) {
+ } else if (auto smpte = dynamic_pointer_cast<dcp::SMPTE
Text
Asset>(asset)) {
/* All our assets should be the same length; use the picture asset length here
as a reference to set the subtitle one. We'll use the duration rather than
the intrinsic duration; we don't care if the picture asset has been trimmed, we're
/* All our assets should be the same length; use the picture asset length here
as a reference to set the subtitle one. We'll use the duration rather than
the intrinsic duration; we don't care if the picture asset has been trimmed, we're
@@
-832,15
+832,15
@@
ReelWriter::write (shared_ptr<const AudioBuffers> audio)
}
}
-shared_ptr<dcp::
Subtitle
Asset>
+shared_ptr<dcp::
Text
Asset>
ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool with_dummy) const
{
ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool with_dummy) const
{
- shared_ptr<dcp::
Subtitle
Asset> asset;
+ shared_ptr<dcp::
Text
Asset> asset;
optional<string> font;
auto lang = film()->subtitle_languages();
if (film()->interop()) {
optional<string> font;
auto lang = film()->subtitle_languages();
if (film()->interop()) {
- auto s = make_shared<dcp::Interop
Subtitle
Asset>();
+ auto s = make_shared<dcp::Interop
Text
Asset>();
s->set_movie_title (film()->name());
if (type == TextType::OPEN_SUBTITLE) {
s->set_language (lang.first ? lang.first->to_string() : "Unknown");
s->set_movie_title (film()->name());
if (type == TextType::OPEN_SUBTITLE) {
s->set_language (lang.first ? lang.first->to_string() : "Unknown");
@@
-850,7
+850,7
@@
ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool
s->set_reel_number (raw_convert<string> (_reel_index + 1));
asset = s;
} else {
s->set_reel_number (raw_convert<string> (_reel_index + 1));
asset = s;
} else {
- auto s = make_shared<dcp::SMPTE
Subtitle
Asset>();
+ auto s = make_shared<dcp::SMPTE
Text
Asset>();
s->set_content_title_text (film()->name());
s->set_metadata (mxf_metadata());
if (type == TextType::OPEN_SUBTITLE && lang.first) {
s->set_content_title_text (film()->name());
s->set_metadata (mxf_metadata());
if (type == TextType::OPEN_SUBTITLE && lang.first) {
@@
-870,7
+870,7
@@
ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool
if (with_dummy) {
asset->add(
if (with_dummy) {
asset->add(
- std::make_shared<dcp::
Subtitle
String>(
+ std::make_shared<dcp::
Text
String>(
font,
false,
false,
font,
false,
false,
@@
-908,7
+908,7
@@
ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool
float
float
-ReelWriter::convert_vertical_position(StringText const& subtitle, dcp::
Subtitle
Standard to) const
+ReelWriter::convert_vertical_position(StringText const& subtitle, dcp::
Text
Standard to) const
{
if (dcp::uses_baseline(subtitle.valign_standard) == dcp::uses_baseline(to)) {
/* The from and to standards use the same alignment reference */
{
if (dcp::uses_baseline(subtitle.valign_standard) == dcp::uses_baseline(to)) {
/* The from and to standards use the same alignment reference */
@@
-938,7
+938,7
@@
ReelWriter::convert_vertical_position(StringText const& subtitle, dcp::SubtitleS
void
ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track, DCPTimePeriod period, FontIdMap const& fonts, shared_ptr<dcpomatic::Font> chosen_interop_font)
{
void
ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track, DCPTimePeriod period, FontIdMap const& fonts, shared_ptr<dcpomatic::Font> chosen_interop_font)
{
- shared_ptr<dcp::
Subtitle
Asset> asset;
+ shared_ptr<dcp::
Text
Asset> asset;
switch (type) {
case TextType::OPEN_SUBTITLE:
switch (type) {
case TextType::OPEN_SUBTITLE:
@@
-974,8
+974,8
@@
ReelWriter::write(PlayerText subs, TextType type, optional<DCPTextTrack> track,
for (auto i: subs.string) {
i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), tcr));
i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr));
for (auto i: subs.string) {
i.set_in (dcp::Time(period.from.seconds() - _period.from.seconds(), tcr));
i.set_out (dcp::Time(period.to.seconds() - _period.from.seconds(), tcr));
- i.set_v_position(convert_vertical_position(i, film()->interop() ? dcp::
SubtitleStandard::INTEROP : dcp::Subtitle
Standard::SMPTE_2014));
- auto sub = make_shared<dcp::
Subtitle
String>(i);
+ i.set_v_position(convert_vertical_position(i, film()->interop() ? dcp::
TextStandard::INTEROP : dcp::Text
Standard::SMPTE_2014));
+ auto sub = make_shared<dcp::
Text
String>(i);
/* i.font is a shared_ptr<Font> which uniquely identifies the font we want,
* though if we are Interop we can only have one font, so we'll use the chosen
* one instead.
/* i.font is a shared_ptr<Font> which uniquely identifies the font we want,
* though if we are Interop we can only have one font, so we'll use the chosen
* one instead.
diff --git
a/src/lib/reel_writer.h
b/src/lib/reel_writer.h
index c9052c832fd8570223bc8e4b6b6166bb14a2b25a..783981b5d682db7332cd3c90867ecb8f7bec82d6 100644
(file)
--- a/
src/lib/reel_writer.h
+++ b/
src/lib/reel_writer.h
@@
-52,7
+52,7
@@
namespace dcp {
class SoundAssetWriter;
class StereoPictureAsset;
class StereoPictureAssetWriter;
class SoundAssetWriter;
class StereoPictureAsset;
class StereoPictureAssetWriter;
- class
Subtitle
Asset;
+ class
Text
Asset;
}
}
@@
-104,7
+104,7
@@
private:
long frame_info_position (Frame frame, Eyes eyes) const;
Frame check_existing_picture_asset (boost::filesystem::path asset);
bool existing_picture_frame_ok (dcp::File& asset_file, std::shared_ptr<InfoFileHandle> info_file, Frame frame) const;
long frame_info_position (Frame frame, Eyes eyes) const;
Frame check_existing_picture_asset (boost::filesystem::path asset);
bool existing_picture_frame_ok (dcp::File& asset_file, std::shared_ptr<InfoFileHandle> info_file, Frame frame) const;
- std::shared_ptr<dcp::
SubtitleAsset> empty_text_asset
(TextType type, boost::optional<DCPTextTrack> track, bool with_dummy) const;
+ std::shared_ptr<dcp::
TextAsset> empty_text_asset
(TextType type, boost::optional<DCPTextTrack> track, bool with_dummy) const;
std::shared_ptr<dcp::ReelPictureAsset> create_reel_picture (std::shared_ptr<dcp::Reel> reel, std::list<ReferencedReelAsset> const & refs) const;
void create_reel_sound (std::shared_ptr<dcp::Reel> reel, std::list<ReferencedReelAsset> const & refs) const;
std::shared_ptr<dcp::ReelPictureAsset> create_reel_picture (std::shared_ptr<dcp::Reel> reel, std::list<ReferencedReelAsset> const & refs) const;
void create_reel_sound (std::shared_ptr<dcp::Reel> reel, std::list<ReferencedReelAsset> const & refs) const;
@@
-117,7
+117,7
@@
private:
std::set<DCPTextTrack> ensure_closed_captions
) const;
void create_reel_markers (std::shared_ptr<dcp::Reel> reel) const;
std::set<DCPTextTrack> ensure_closed_captions
) const;
void create_reel_markers (std::shared_ptr<dcp::Reel> reel) const;
- float convert_vertical_position(StringText const& subtitle, dcp::
Subtitle
Standard to) const;
+ float convert_vertical_position(StringText const& subtitle, dcp::
Text
Standard to) const;
dcpomatic::DCPTimePeriod _period;
/** the first picture frame index that does not already exist in our MXF */
dcpomatic::DCPTimePeriod _period;
/** the first picture frame index that does not already exist in our MXF */
@@
-139,8
+139,8
@@
private:
std::shared_ptr<dcp::PictureAssetWriter> _picture_asset_writer;
std::shared_ptr<dcp::SoundAsset> _sound_asset;
std::shared_ptr<dcp::SoundAssetWriter> _sound_asset_writer;
std::shared_ptr<dcp::PictureAssetWriter> _picture_asset_writer;
std::shared_ptr<dcp::SoundAsset> _sound_asset;
std::shared_ptr<dcp::SoundAssetWriter> _sound_asset_writer;
- std::shared_ptr<dcp::
Subtitle
Asset> _subtitle_asset;
- std::map<DCPTextTrack, std::shared_ptr<dcp::
Subtitle
Asset>> _closed_caption_assets;
+ std::shared_ptr<dcp::
Text
Asset> _subtitle_asset;
+ std::map<DCPTextTrack, std::shared_ptr<dcp::
Text
Asset>> _closed_caption_assets;
std::shared_ptr<dcp::AtmosAsset> _atmos_asset;
std::shared_ptr<dcp::AtmosAssetWriter> _atmos_asset_writer;
std::shared_ptr<dcp::AtmosAsset> _atmos_asset;
std::shared_ptr<dcp::AtmosAssetWriter> _atmos_asset_writer;
diff --git
a/src/lib/render_text.cc
b/src/lib/render_text.cc
index 870f3045d31340fb692c98cb65d8c858d6c4b38f..6aed151817b04c9aadbafe7726e77e8e50a4c076 100644
(file)
--- a/
src/lib/render_text.cc
+++ b/
src/lib/render_text.cc
@@
-242,12
+242,12
@@
x_position(dcp::HAlign align, float position, int target_width, int layout_width
* @return y position of the top of the subtitle bounding box (in pixels) from the top of the screen.
*/
static int
* @return y position of the top of the subtitle bounding box (in pixels) from the top of the screen.
*/
static int
-y_position(dcp::
Subtitle
Standard standard, dcp::VAlign align, float position, int target_height, int baseline_to_bottom, int layout_height)
+y_position(dcp::
Text
Standard standard, dcp::VAlign align, float position, int target_height, int baseline_to_bottom, int layout_height)
{
int y = 0;
switch (standard) {
{
int y = 0;
switch (standard) {
- case dcp::
Subtitle
Standard::INTEROP:
- case dcp::
Subtitle
Standard::SMPTE_2014:
+ case dcp::
Text
Standard::INTEROP:
+ case dcp::
Text
Standard::SMPTE_2014:
switch (align) {
case dcp::VAlign::TOP:
/* position is distance from top of frame to subtitle baseline */
switch (align) {
case dcp::VAlign::TOP:
/* position is distance from top of frame to subtitle baseline */
@@
-263,8
+263,8
@@
y_position(dcp::SubtitleStandard standard, dcp::VAlign align, float position, in
break;
}
break;
break;
}
break;
- case dcp::
Subtitle
Standard::SMPTE_2007:
- case dcp::
Subtitle
Standard::SMPTE_2010:
+ case dcp::
Text
Standard::SMPTE_2007:
+ case dcp::
Text
Standard::SMPTE_2010:
switch (align) {
case dcp::VAlign::TOP:
/* v_position is distance from top of frame to top of subtitle */
switch (align) {
case dcp::VAlign::TOP:
/* v_position is distance from top of frame to top of subtitle */
@@
-452,7
+452,7
@@
render_text(vector<StringText> subtitles, dcp::Size target, DCPTime time, int fr
vector<dcpomatic::Rect<int>>
vector<dcpomatic::Rect<int>>
-bounding_box(vector<StringText> subtitles, dcp::Size target, optional<dcp::
Subtitle
Standard> override_standard)
+bounding_box(vector<StringText> subtitles, dcp::Size target, optional<dcp::
Text
Standard> override_standard)
{
vector<StringText> pending;
vector<dcpomatic::Rect<int>> rects;
{
vector<StringText> pending;
vector<dcpomatic::Rect<int>> rects;
diff --git
a/src/lib/render_text.h
b/src/lib/render_text.h
index ff34dc10d8c1cc4b6c687dd086c9e0443535bd32..18264e0d02bd25836389cff46ac03be79c895268 100644
(file)
--- a/
src/lib/render_text.h
+++ b/
src/lib/render_text.h
@@
-34,7
+34,7
@@
namespace dcpomatic {
std::string marked_up(std::vector<StringText> subtitles, int target_height, float fade_factor, std::string font_name);
std::vector<PositionImage> render_text(std::vector<StringText>, dcp::Size, dcpomatic::DCPTime, int);
std::string marked_up(std::vector<StringText> subtitles, int target_height, float fade_factor, std::string font_name);
std::vector<PositionImage> render_text(std::vector<StringText>, dcp::Size, dcpomatic::DCPTime, int);
-std::vector<dcpomatic::Rect<int>> bounding_box(std::vector<StringText> subtitles, dcp::Size target, boost::optional<dcp::
Subtitle
Standard> override_standard = boost::none);
+std::vector<dcpomatic::Rect<int>> bounding_box(std::vector<StringText> subtitles, dcp::Size target, boost::optional<dcp::
Text
Standard> override_standard = boost::none);
class FontMetrics
class FontMetrics
diff --git
a/src/lib/string_text.h
b/src/lib/string_text.h
index 787231b8cf2d57b2ed3a8dda65b1ea7e42fb312c..827b426cc11f4467088bedcf9280cff563ed02c1 100644
(file)
--- a/
src/lib/string_text.h
+++ b/
src/lib/string_text.h
@@
-24,8
+24,8
@@
#include "font.h"
#include "font.h"
-#include <dcp/
subtitle
_standard.h>
-#include <dcp/
subtitle
_string.h>
+#include <dcp/
text
_standard.h>
+#include <dcp/
text
_string.h>
/** A wrapper for SubtitleString which allows us to:
/** A wrapper for SubtitleString which allows us to:
@@
-36,13
+36,13
@@
* - include details of how v_align should be interpreted
*
* - specify the font by referring to a Font object from the content we came from, rather than
* - include details of how v_align should be interpreted
*
* - specify the font by referring to a Font object from the content we came from, rather than
- * having to use a DCP ID like in dcp::
Subtitle
String.
+ * having to use a DCP ID like in dcp::
Text
String.
*/
*/
-class StringText : public dcp::
Subtitle
String
+class StringText : public dcp::
Text
String
{
public:
{
public:
- StringText(dcp::
SubtitleString dcp_, int outline_width_, std::shared_ptr<dcpomatic::Font> font_, dcp::Subtitle
Standard valign_standard_)
- : dcp::
SubtitleString
(dcp_)
+ StringText(dcp::
TextString dcp_, int outline_width_, std::shared_ptr<dcpomatic::Font> font_, dcp::Text
Standard valign_standard_)
+ : dcp::
TextString
(dcp_)
, outline_width (outline_width_)
, font (font_)
, valign_standard (valign_standard_)
, outline_width (outline_width_)
, font (font_)
, valign_standard (valign_standard_)
@@
-67,7
+67,7
@@
public:
* center - centre of screen to baseline of subtitle
* bottom - bottom of screen to baseline of subtitle
*/
* center - centre of screen to baseline of subtitle
* bottom - bottom of screen to baseline of subtitle
*/
- dcp::
Subtitle
Standard valign_standard;
+ dcp::
Text
Standard valign_standard;
};
};
diff --git
a/src/lib/string_text_file_decoder.cc
b/src/lib/string_text_file_decoder.cc
index 2ec0ec1cb74f10cc3f32769c378670f97204efd3..5b6e343b8a31c1d657186ade66f13b69471c8201 100644
(file)
--- a/
src/lib/string_text_file_decoder.cc
+++ b/
src/lib/string_text_file_decoder.cc
@@
-23,7
+23,7
@@
#include "string_text_file_content.h"
#include "text_content.h"
#include "text_decoder.h"
#include "string_text_file_content.h"
#include "text_content.h"
#include "text_decoder.h"
-#include <dcp/
subtitle
_string.h>
+#include <dcp/
text
_string.h>
#include <iostream>
#include <iostream>
diff --git
a/src/lib/subtitle_encoder.cc
b/src/lib/subtitle_encoder.cc
index 8b1d9a15ba7b5f9ca1d1d60d5da531f1f5580c8d..89e5215889df461173b78e64d1f42e4a8865be69 100644
(file)
--- a/
src/lib/subtitle_encoder.cc
+++ b/
src/lib/subtitle_encoder.cc
@@
-25,9
+25,9
@@
#include "player.h"
#include "subtitle_encoder.h"
#include <dcp/filesystem.h>
#include "player.h"
#include "subtitle_encoder.h"
#include <dcp/filesystem.h>
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/raw_convert.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <boost/filesystem.hpp>
#include <boost/bind/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/bind/bind.hpp>
@@
-79,7
+79,7
@@
SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j
}
}
}
}
- _assets.push_back(make_pair(shared_ptr<dcp::
Subtitle
Asset>(), dcp::filesystem::change_extension(filename, extension)));
+ _assets.push_back(make_pair(shared_ptr<dcp::
Text
Asset>(), dcp::filesystem::change_extension(filename, extension)));
}
for (auto i: film->reels()) {
}
for (auto i: film->reels()) {
@@
-108,12
+108,12
@@
SubtitleEncoder::go ()
if (!i.first) {
/* No subtitles arrived for this asset; make an empty one so we write something to the output */
if (_film->interop()) {
if (!i.first) {
/* No subtitles arrived for this asset; make an empty one so we write something to the output */
if (_film->interop()) {
- auto s = make_shared<dcp::Interop
Subtitle
Asset>();
+ auto s = make_shared<dcp::Interop
Text
Asset>();
s->set_movie_title (_film->name());
s->set_reel_number (raw_convert<string>(reel + 1));
i.first = s;
} else {
s->set_movie_title (_film->name());
s->set_reel_number (raw_convert<string>(reel + 1));
i.first = s;
} else {
- auto s = make_shared<dcp::SMPTE
Subtitle
Asset>();
+ auto s = make_shared<dcp::SMPTE
Text
Asset>();
s->set_content_title_text (_film->name());
s->set_reel_number (reel + 1);
i.first = s;
s->set_content_title_text (_film->name());
s->set_reel_number (reel + 1);
i.first = s;
@@
-140,10
+140,10
@@
SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
}
if (!_assets[_reel_index].first) {
}
if (!_assets[_reel_index].first) {
- shared_ptr<dcp::
Subtitle
Asset> asset;
+ shared_ptr<dcp::
Text
Asset> asset;
auto lang = _film->subtitle_languages ();
if (_film->interop ()) {
auto lang = _film->subtitle_languages ();
if (_film->interop ()) {
- auto s = make_shared<dcp::Interop
Subtitle
Asset>();
+ auto s = make_shared<dcp::Interop
Text
Asset>();
s->set_movie_title (_film->name());
if (lang.first) {
s->set_language (lang.first->to_string());
s->set_movie_title (_film->name());
if (lang.first) {
s->set_language (lang.first->to_string());
@@
-151,7
+151,7
@@
SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
s->set_reel_number (raw_convert<string>(_reel_index + 1));
_assets[_reel_index].first = s;
} else {
s->set_reel_number (raw_convert<string>(_reel_index + 1));
_assets[_reel_index].first = s;
} else {
- auto s = make_shared<dcp::SMPTE
Subtitle
Asset>();
+ auto s = make_shared<dcp::SMPTE
Text
Asset>();
s->set_content_title_text (_film->name());
if (lang.first) {
s->set_language (*lang.first);
s->set_content_title_text (_film->name());
if (lang.first) {
s->set_language (*lang.first);
@@
-176,7
+176,7
@@
SubtitleEncoder::text (PlayerText subs, TextType type, optional<DCPTextTrack> tr
if (_film->interop() && !_include_font) {
i.unset_font ();
}
if (_film->interop() && !_include_font) {
i.unset_font ();
}
- _assets[_reel_index].first->add
(make_shared<dcp::Subtitle
String>(i));
+ _assets[_reel_index].first->add
(make_shared<dcp::Text
String>(i));
}
if (_split_reels && (_reel_index < int(_reels.size()) - 1) && period.from > _reels[_reel_index].from) {
}
if (_split_reels && (_reel_index < int(_reels.size()) - 1) && period.from > _reels[_reel_index].from) {
diff --git
a/src/lib/subtitle_encoder.h
b/src/lib/subtitle_encoder.h
index 0815b1fffbca7e8e02487a8fdfd5664205a81214..3fc7445b942c614c4a727ffc5fad642464fae20a 100644
(file)
--- a/
src/lib/subtitle_encoder.h
+++ b/
src/lib/subtitle_encoder.h
@@
-26,7
+26,7
@@
namespace dcp {
namespace dcp {
- class
Subtitle
Asset;
+ class
Text
Asset;
}
}
@@
-53,7
+53,7
@@
public:
private:
void text (PlayerText subs, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period);
private:
void text (PlayerText subs, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period);
- std::vector<std::pair<std::shared_ptr<dcp::
Subtitle
Asset>, boost::filesystem::path>> _assets;
+ std::vector<std::pair<std::shared_ptr<dcp::
Text
Asset>, boost::filesystem::path>> _assets;
std::vector<dcpomatic::DCPTimePeriod> _reels;
bool _split_reels;
bool _include_font;
std::vector<dcpomatic::DCPTimePeriod> _reels;
bool _split_reels;
bool _include_font;
diff --git
a/src/lib/text_decoder.cc
b/src/lib/text_decoder.cc
index 75fa33605b0f2f3188f1fc47141a0d609cebd632..847f297bacf36645a94aa4e0f68b1d823573e253 100644
(file)
--- a/
src/lib/text_decoder.cc
+++ b/
src/lib/text_decoder.cc
@@
-127,7
+127,7
@@
TextDecoder::remove_invalid_characters_for_xml(string text)
void
void
-TextDecoder::emit_plain_start(ContentTime from, vector<dcp::
SubtitleString> subtitles, dcp::Subtitle
Standard valign_standard)
+TextDecoder::emit_plain_start(ContentTime from, vector<dcp::
TextString> subtitles, dcp::Text
Standard valign_standard)
{
vector<StringText> string_texts;
{
vector<StringText> string_texts;
@@
-273,7
+273,7
@@
TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & sub_subti
return dcp::Colour(lrintf(c.r * 255), lrintf(c.g * 255), lrintf(c.b * 255));
};
return dcp::Colour(lrintf(c.r * 255), lrintf(c.g * 255), lrintf(c.b * 255));
};
- auto dcp_subtitle = dcp::
Subtitle
String(
+ auto dcp_subtitle = dcp::
Text
String(
optional<string>(),
block.italic,
block.bold,
optional<string>(),
block.italic,
block.bold,
@@
-312,7
+312,7
@@
TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & sub_subti
dcp_subtitle,
content()->outline_width(),
font,
dcp_subtitle,
content()->outline_width(),
font,
- dcp::
Subtitle
Standard::SMPTE_2014
+ dcp::
Text
Standard::SMPTE_2014
);
set_forced_appearance(content(), string_text);
string_texts.push_back(string_text);
);
set_forced_appearance(content(), string_text);
string_texts.push_back(string_text);
@@
-332,7
+332,7
@@
TextDecoder::emit_stop (ContentTime to)
void
void
-TextDecoder::emit_plain(ContentTimePeriod period, vector<dcp::
SubtitleString> subtitles, dcp::Subtitle
Standard valign_standard)
+TextDecoder::emit_plain(ContentTimePeriod period, vector<dcp::
TextString> subtitles, dcp::Text
Standard valign_standard)
{
emit_plain_start (period.from, subtitles, valign_standard);
emit_stop (period.to);
{
emit_plain_start (period.from, subtitles, valign_standard);
emit_stop (period.to);
diff --git
a/src/lib/text_decoder.h
b/src/lib/text_decoder.h
index 1a7632fd82b8448366dddc0676531c8b04fd9a27..91f452b604f93c9822a072bc2d641086cd73d7bc 100644
(file)
--- a/
src/lib/text_decoder.h
+++ b/
src/lib/text_decoder.h
@@
-29,8
+29,8
@@
#include "rect.h"
#include "content_text.h"
#include "types.h"
#include "rect.h"
#include "content_text.h"
#include "types.h"
-#include <dcp/
subtitle
_standard.h>
-#include <dcp/
subtitle
_string.h>
+#include <dcp/
text
_standard.h>
+#include <dcp/
text
_string.h>
#include <boost/signals2.hpp>
#include <boost/signals2.hpp>
@@
-52,9
+52,9
@@
public:
void emit_bitmap_start (ContentBitmapText const& bitmap);
void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect);
void emit_bitmap_start (ContentBitmapText const& bitmap);
void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect);
- void emit_plain_start(dcpomatic::ContentTime from, std::vector<dcp::
SubtitleString> s, dcp::Subtitle
Standard valign_standard);
+ void emit_plain_start(dcpomatic::ContentTime from, std::vector<dcp::
TextString> s, dcp::Text
Standard valign_standard);
void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle);
void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle);
- void emit_plain(dcpomatic::ContentTimePeriod period, std::vector<dcp::
SubtitleString> s, dcp::Subtitle
Standard valign_standard);
+ void emit_plain(dcpomatic::ContentTimePeriod period, std::vector<dcp::
TextString> s, dcp::Text
Standard valign_standard);
void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle);
void emit_stop (dcpomatic::ContentTime to);
void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle);
void emit_stop (dcpomatic::ContentTime to);
diff --git
a/src/lib/util.cc
b/src/lib/util.cc
index d23989afaadff0556842b8ba5fe6f01e86b96efd..9884df730588e9ae8981198fa8bde3c63deb4fe9 100644
(file)
--- a/
src/lib/util.cc
+++ b/
src/lib/util.cc
@@
-59,7
+59,7
@@
#include <dcp/picture_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/sound_asset.h>
#include <dcp/picture_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/sound_asset.h>
-#include <dcp/
subtitle
_asset.h>
+#include <dcp/
text
_asset.h>
#include <dcp/util.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
#include <dcp/util.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
@@
-468,7
+468,7
@@
LIBDCP_ENABLE_WARNINGS
#if defined(DCPOMATIC_WINDOWS) || defined(DCPOMATIC_OSX)
/* Render something to fontconfig to create its cache */
vector<StringText> subs;
#if defined(DCPOMATIC_WINDOWS) || defined(DCPOMATIC_OSX)
/* Render something to fontconfig to create its cache */
vector<StringText> subs;
- dcp::
Subtitle
String ss(
+ dcp::
Text
String ss(
optional<string>(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HAlign::CENTER, 0, dcp::VAlign::CENTER, 0, dcp::Direction::LTR,
"Hello dolly", dcp::Effect::NONE, dcp::Colour(), dcp::Time(), dcp::Time(), 0, std::vector<dcp::Ruby>()
);
optional<string>(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HAlign::CENTER, 0, dcp::VAlign::CENTER, 0, dcp::Direction::LTR,
"Hello dolly", dcp::Effect::NONE, dcp::Colour(), dcp::Time(), dcp::Time(), 0, std::vector<dcp::Ruby>()
);
@@
-754,7
+754,7
@@
audio_asset_filename (shared_ptr<dcp::SoundAsset> asset, int reel_index, int ree
string
string
-subtitle_asset_filename
(shared_ptr<dcp::Subtitle
Asset> asset, int reel_index, int reel_count, optional<string> summary, string extension)
+subtitle_asset_filename
(shared_ptr<dcp::Text
Asset> asset, int reel_index, int reel_count, optional<string> summary, string extension)
{
return asset_filename(asset, "sub", reel_index, reel_count, summary, extension);
}
{
return asset_filename(asset, "sub", reel_index, reel_count, summary, extension);
}
diff --git
a/src/lib/util.h
b/src/lib/util.h
index b92869b253a776167c72bbd1b20159a1a9015e4e..f4bf51e8e7088c5394dd472788e310a6f76abb15 100644
(file)
--- a/
src/lib/util.h
+++ b/
src/lib/util.h
@@
-49,7
+49,7
@@
namespace dcp {
class PictureAsset;
class SoundAsset;
namespace dcp {
class PictureAsset;
class SoundAsset;
- class
Subtitle
Asset;
+ class
Text
Asset;
}
extern std::string program_name;
}
extern std::string program_name;
@@
-81,7
+81,7
@@
extern dcp::Size fit_ratio_within (float ratio, dcp::Size);
extern void set_backtrace_file (boost::filesystem::path);
extern std::string video_asset_filename (std::shared_ptr<dcp::PictureAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
extern std::string audio_asset_filename (std::shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
extern void set_backtrace_file (boost::filesystem::path);
extern std::string video_asset_filename (std::shared_ptr<dcp::PictureAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
extern std::string audio_asset_filename (std::shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
-extern std::string subtitle_asset_filename
(std::shared_ptr<dcp::Subtitle
Asset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary, std::string extension);
+extern std::string subtitle_asset_filename
(std::shared_ptr<dcp::Text
Asset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary, std::string extension);
extern std::string atmos_asset_filename (std::shared_ptr<dcp::AtmosAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
extern std::string careful_string_filter (std::string);
extern std::pair<int, int> audio_channel_types (std::list<int> mapped, int channels);
extern std::string atmos_asset_filename (std::shared_ptr<dcp::AtmosAsset> asset, int reel_index, int reel_count, boost::optional<std::string> content_summary);
extern std::string careful_string_filter (std::string);
extern std::pair<int, int> audio_channel_types (std::list<int> mapped, int channels);
diff --git
a/test/dcp_subtitle_test.cc
b/test/dcp_subtitle_test.cc
index 9b7b77279968f6afffa977c448a685ebb7989ed4..fc7aee984f51873101f35ae98241ef5155c3d0d9 100644
(file)
--- a/
test/dcp_subtitle_test.cc
+++ b/
test/dcp_subtitle_test.cc
@@
-39,7
+39,7
@@
#include "test.h"
#include <dcp/mono_picture_asset.h>
#include <dcp/openjpeg_image.h>
#include "test.h"
#include <dcp/mono_picture_asset.h>
#include <dcp/openjpeg_image.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <boost/test/unit_test.hpp>
#include <iostream>
#include <boost/test/unit_test.hpp>
#include <iostream>
@@
-292,12
+292,12
@@
BOOST_AUTO_TEST_CASE(entity_from_dcp_source)
dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
});
dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
});
- dcp::SMPTE
Subtitle
Asset check(dcp_file(film, "sub_"));
- auto subs = check.
subtitle
s();
+ dcp::SMPTE
Text
Asset check(dcp_file(film, "sub_"));
+ auto subs = check.
text
s();
BOOST_REQUIRE_EQUAL(subs.size(), 1U);
BOOST_REQUIRE_EQUAL(subs.size(), 1U);
- auto sub = std::dynamic_pointer_cast<const dcp::
Subtitle
String>(subs[0]);
+ auto sub = std::dynamic_pointer_cast<const dcp::
Text
String>(subs[0]);
BOOST_REQUIRE(sub);
BOOST_REQUIRE(sub);
- /*
libdcp::Subtitle
Asset gets the text from the XML with get_content(), which
+ /*
dcp::Text
Asset gets the text from the XML with get_content(), which
* resolves the 5 predefined entities & " < > ' so we shouldn't see any
* entity here.
*/
* resolves the 5 predefined entities & " < > ' so we shouldn't see any
* entity here.
*/
diff --git
a/test/render_subtitles_test.cc
b/test/render_subtitles_test.cc
index e3034def01f209d7bab87914163bbe653d20eed4..dec686a21860fb6ddba35ac21d349e984dd51c15 100644
(file)
--- a/
test/render_subtitles_test.cc
+++ b/
test/render_subtitles_test.cc
@@
-30,7
+30,7
@@
#include "lib/render_text.h"
#include "lib/string_text.h"
#include "test.h"
#include "lib/render_text.h"
#include "lib/string_text.h"
#include "test.h"
-#include <dcp/
subtitle
_string.h>
+#include <dcp/
text
_string.h>
#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test.hpp>
@@
-43,7
+43,7
@@
add(std::vector<StringText>& s, std::string text, bool italic, bool bold, bool u
{
s.push_back (
StringText (
{
s.push_back (
StringText (
- dcp::
SubtitleString
(
+ dcp::
TextString
(
boost::optional<std::string> (),
italic,
bold,
boost::optional<std::string> (),
italic,
bold,
@@
-69,7
+69,7
@@
add(std::vector<StringText>& s, std::string text, bool italic, bool bold, bool u
),
2,
std::shared_ptr<dcpomatic::Font>(),
),
2,
std::shared_ptr<dcpomatic::Font>(),
- dcp::
Subtitle
Standard::SMPTE_2014
+ dcp::
Text
Standard::SMPTE_2014
)
);
}
)
);
}
@@
-125,7
+125,7
@@
BOOST_AUTO_TEST_CASE (marked_up_test6)
BOOST_AUTO_TEST_CASE(render_text_with_newline_test)
{
BOOST_AUTO_TEST_CASE(render_text_with_newline_test)
{
- std::list<dcp::
Subtitle
String> ss = {
+ std::list<dcp::
Text
String> ss = {
{
{}, true, false, false, dcp::Colour(255, 255, 255), 42, 1.0,
dcp::Time(0, 0, 0, 0, 24), dcp::Time(0, 0, 1, 0, 24),
{
{}, true, false, false, dcp::Colour(255, 255, 255), 42, 1.0,
dcp::Time(0, 0, 0, 0, 24), dcp::Time(0, 0, 1, 0, 24),
@@
-156,7
+156,7
@@
BOOST_AUTO_TEST_CASE(render_text_with_newline_test)
std::vector<StringText> st;
for (auto i: ss) {
std::vector<StringText> st;
for (auto i: ss) {
- st.push_back({i, 0, make_shared<dcpomatic::Font>("foo"), dcp::
Subtitle
Standard::SMPTE_2014});
+ st.push_back({i, 0, make_shared<dcpomatic::Font>("foo"), dcp::
Text
Standard::SMPTE_2014});
}
auto images = render_text(st, dcp::Size(1998, 1080), {}, 24);
}
auto images = render_text(st, dcp::Size(1998, 1080), {}, 24);
@@
-177,7
+177,7
@@
BOOST_AUTO_TEST_CASE(render_text_with_newline_test)
BOOST_AUTO_TEST_CASE (render_text_test)
{
BOOST_AUTO_TEST_CASE (render_text_test)
{
- auto dcp_string = dcp::
Subtitle
String(
+ auto dcp_string = dcp::
Text
String(
{}, false, false, false, dcp::Colour(255, 255, 255), 42, 1.0,
dcp::Time(0, 0, 0, 0, 24), dcp::Time(0, 0, 1, 0, 24),
0.5, dcp::HAlign::CENTER,
{}, false, false, false, dcp::Colour(255, 255, 255), 42, 1.0,
dcp::Time(0, 0, 0, 0, 24), dcp::Time(0, 0, 1, 0, 24),
0.5, dcp::HAlign::CENTER,
diff --git
a/test/srt_subtitle_test.cc
b/test/srt_subtitle_test.cc
index 0ee9cb197a3f3a38c24aa0ef89b702e79523331f..702d0bbb63d977bc4cbac8c65957dc90a614e51b 100644
(file)
--- a/
test/srt_subtitle_test.cc
+++ b/
test/srt_subtitle_test.cc
@@
-32,8
+32,8
@@
#include "lib/string_text_file_content.h"
#include "lib/text_content.h"
#include "test.h"
#include "lib/string_text_file_content.h"
#include "lib/text_content.h"
#include "test.h"
-#include <dcp/smpte_
subtitle
_asset.h>
-#include <dcp/
subtitle
_string.h>
+#include <dcp/smpte_
text
_asset.h>
+#include <dcp/
text
_string.h>
#include <boost/algorithm/string.hpp>
#include <boost/test/unit_test.hpp>
#include <list>
#include <boost/algorithm/string.hpp>
#include <boost/test/unit_test.hpp>
#include <list>
@@
-237,12
+237,12
@@
BOOST_AUTO_TEST_CASE(srt_subtitle_entity)
dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
});
dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
});
- dcp::SMPTE
Subtitle
Asset check(dcp_file(film, "sub_"));
- auto subs = check.
subtitle
s();
+ dcp::SMPTE
Text
Asset check(dcp_file(film, "sub_"));
+ auto subs = check.
text
s();
BOOST_REQUIRE_EQUAL(subs.size(), 1U);
BOOST_REQUIRE_EQUAL(subs.size(), 1U);
- auto sub = std::dynamic_pointer_cast<const dcp::
Subtitle
String>(subs[0]);
+ auto sub = std::dynamic_pointer_cast<const dcp::
Text
String>(subs[0]);
BOOST_REQUIRE(sub);
BOOST_REQUIRE(sub);
- /*
libdcp::Subtitle
Asset gets the text from the XML with get_content(), which
+ /*
dcp::Text
Asset gets the text from the XML with get_content(), which
* resolves the 5 predefined entities & " < > ' so we shouldn't see any
* entity here.
*/
* resolves the 5 predefined entities & " < > ' so we shouldn't see any
* entity here.
*/
diff --git
a/test/ssa_subtitle_test.cc
b/test/ssa_subtitle_test.cc
index 2d8102a071c16559b92666864036650ca1ffde34..2466de791189e1fa31c601482c4ba9557f6f4300 100644
(file)
--- a/
test/ssa_subtitle_test.cc
+++ b/
test/ssa_subtitle_test.cc
@@
-33,7
+33,7
@@
#include "lib/text_content.h"
#include "test.h"
#include <dcp/equality_options.h>
#include "lib/text_content.h"
#include "test.h"
#include <dcp/equality_options.h>
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
@@
-62,8
+62,8
@@
BOOST_AUTO_TEST_CASE (ssa_subtitle_test1)
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
- auto ref = make_shared<dcp::Interop
Subtitle
Asset>(TestPaths::private_data() / "DKH_UT_EN20160601def.xml");
- auto check = make_shared<dcp::Interop
Subtitle
Asset>(subtitle_file(film));
+ auto ref = make_shared<dcp::Interop
Text
Asset>(TestPaths::private_data() / "DKH_UT_EN20160601def.xml");
+ auto check = make_shared<dcp::Interop
Text
Asset>(subtitle_file(film));
dcp::EqualityOptions options;
options.max_subtitle_vertical_position_error = 0.1;
dcp::EqualityOptions options;
options.max_subtitle_vertical_position_error = 0.1;
diff --git
a/test/subtitle_font_id_test.cc
b/test/subtitle_font_id_test.cc
index f6bd48c51d0859260b5e36e42c63fd57f3db9f47..e420338255632979c74ad8842430daa4c676c85e 100644
(file)
--- a/
test/subtitle_font_id_test.cc
+++ b/
test/subtitle_font_id_test.cc
@@
-29,7
+29,7
@@
#include <dcp/dcp.h>
#include <dcp/reel.h>
#include <dcp/reel_subtitle_asset.h>
#include <dcp/dcp.h>
#include <dcp/reel.h>
#include <dcp/reel_subtitle_asset.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include "test.h"
#include <boost/test/unit_test.hpp>
#include "test.h"
#include <boost/test/unit_test.hpp>
@@
-127,7
+127,7
@@
BOOST_AUTO_TEST_CASE(make_dcp_with_subs_without_font_tag)
});
auto check_file = subtitle_file(film);
});
auto check_file = subtitle_file(film);
- dcp::SMPTE
Subtitle
Asset check_asset(check_file);
+ dcp::SMPTE
Text
Asset check_asset(check_file);
BOOST_CHECK_EQUAL(check_asset.load_font_nodes().size(), 1U);
auto check_font_data = check_asset.font_data();
BOOST_CHECK_EQUAL(check_font_data.size(), 1U);
BOOST_CHECK_EQUAL(check_asset.load_font_nodes().size(), 1U);
auto check_font_data = check_asset.font_data();
BOOST_CHECK_EQUAL(check_font_data.size(), 1U);
@@
-186,7
+186,7
@@
BOOST_AUTO_TEST_CASE(make_dcp_with_subs_in_dcp_without_font_tag)
});
auto check_file = subtitle_file(film);
});
auto check_file = subtitle_file(film);
- dcp::SMPTE
Subtitle
Asset check_asset(check_file);
+ dcp::SMPTE
Text
Asset check_asset(check_file);
BOOST_CHECK_EQUAL(check_asset.load_font_nodes().size(), 1U);
auto check_font_data = check_asset.font_data();
BOOST_CHECK_EQUAL(check_font_data.size(), 1U);
BOOST_CHECK_EQUAL(check_asset.load_font_nodes().size(), 1U);
auto check_font_data = check_asset.font_data();
BOOST_CHECK_EQUAL(check_font_data.size(), 1U);
@@
-254,8
+254,8
@@
BOOST_AUTO_TEST_CASE(subtitle_with_no_font_test)
BOOST_REQUIRE(check_subs);
BOOST_CHECK_EQUAL(check_subs->font_data().size(), 1U);
BOOST_REQUIRE(check_subs);
BOOST_CHECK_EQUAL(check_subs->font_data().size(), 1U);
- BOOST_REQUIRE_EQUAL(check_subs->
subtitle
s().size(), 1U);
- BOOST_CHECK(!std::dynamic_pointer_cast<const dcp::
SubtitleString>(check_subs->subtitle
s()[0])->font().has_value());
+ BOOST_REQUIRE_EQUAL(check_subs->
text
s().size(), 1U);
+ BOOST_CHECK(!std::dynamic_pointer_cast<const dcp::
TextString>(check_subs->text
s()[0])->font().has_value());
auto check_film = new_test_film2(name_base + "_check", { make_shared<DCPContent>(bad_film->dir(bad_film->dcp_name())) });
make_and_verify_dcp(check_film);
auto check_film = new_test_film2(name_base + "_check", { make_shared<DCPContent>(bad_film->dir(bad_film->dcp_name())) });
make_and_verify_dcp(check_film);
diff --git
a/test/subtitle_position_test.cc
b/test/subtitle_position_test.cc
index 94a06b7f82ea2c1dbc6ab924c771f374ed2fd833..785164965034ba8e4a831abb54ec7a0992983ccf 100644
(file)
--- a/
test/subtitle_position_test.cc
+++ b/
test/subtitle_position_test.cc
@@
-25,9
+25,9
@@
#include "lib/make_dcp.h"
#include "lib/text_content.h"
#include "test.h"
#include "lib/make_dcp.h"
#include "lib/text_content.h"
#include "test.h"
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/language_tag.h>
#include <dcp/language_tag.h>
-#include <dcp/smpte_
subtitle
_asset.h>
+#include <dcp/smpte_
text
_asset.h>
#include <boost/test/unit_test.hpp>
#include <vector>
#include <boost/test/unit_test.hpp>
#include <vector>
@@
-55,8
+55,8
@@
BOOST_AUTO_TEST_CASE(srt_correctly_placed_in_interop)
auto output = subtitle_file(film);
auto output = subtitle_file(film);
- dcp::Interop
Subtitle
Asset asset(output);
- auto output_subs = asset.
subtitle
s();
+ dcp::Interop
Text
Asset asset(output);
+ auto output_subs = asset.
text
s();
BOOST_REQUIRE_EQUAL(output_subs.size(), 1U);
BOOST_CHECK(output_subs[0]->v_align() == dcp::VAlign::BOTTOM);
BOOST_REQUIRE_EQUAL(output_subs.size(), 1U);
BOOST_CHECK(output_subs[0]->v_align() == dcp::VAlign::BOTTOM);
@@
-83,8
+83,8
@@
BOOST_AUTO_TEST_CASE(srt_correctly_placed_in_smpte)
auto output = subtitle_file(film);
auto output = subtitle_file(film);
- dcp::SMPTE
Subtitle
Asset asset(output);
- auto output_subs = asset.
subtitle
s();
+ dcp::SMPTE
Text
Asset asset(output);
+ auto output_subs = asset.
text
s();
BOOST_REQUIRE_EQUAL(output_subs.size(), 1U);
BOOST_CHECK(output_subs[0]->v_align() == dcp::VAlign::BOTTOM);
BOOST_REQUIRE_EQUAL(output_subs.size(), 1U);
BOOST_CHECK(output_subs[0]->v_align() == dcp::VAlign::BOTTOM);
@@
-95,18
+95,18
@@
BOOST_AUTO_TEST_CASE(srt_correctly_placed_in_smpte)
/** Make a DCP from some DCP subtitles and check the vertical alignment */
static
void
/** Make a DCP from some DCP subtitles and check the vertical alignment */
static
void
-vpos_test(dcp::VAlign reference, float position, dcp::
Subtitle
Standard from, dcp::Standard to)
+vpos_test(dcp::VAlign reference, float position, dcp::
Text
Standard from, dcp::Standard to)
{
string standard;
switch (from) {
{
string standard;
switch (from) {
- case dcp::
Subtitle
Standard::SMPTE_2007:
- case dcp::
Subtitle
Standard::SMPTE_2010:
+ case dcp::
Text
Standard::SMPTE_2007:
+ case dcp::
Text
Standard::SMPTE_2010:
standard = "smpte_2010";
break;
standard = "smpte_2010";
break;
- case dcp::
Subtitle
Standard::INTEROP:
+ case dcp::
Text
Standard::INTEROP:
standard = "interop";
break;
standard = "interop";
break;
- case dcp::
Subtitle
Standard::SMPTE_2014:
+ case dcp::
Text
Standard::SMPTE_2014:
standard = "smpte_2014";
break;
}
standard = "smpte_2014";
break;
}
@@
-122,13
+122,13
@@
vpos_test(dcp::VAlign reference, float position, dcp::SubtitleStandard from, dcp
BOOST_REQUIRE(!wait_for_jobs());
auto out = subtitle_file(film);
BOOST_REQUIRE(!wait_for_jobs());
auto out = subtitle_file(film);
- vector<shared_ptr<const dcp::
Subtitle
>> subtitles;
+ vector<shared_ptr<const dcp::
Text
>> subtitles;
if (to == dcp::Standard::INTEROP) {
if (to == dcp::Standard::INTEROP) {
- dcp::Interop
Subtitle
Asset asset(out);
- subtitles = asset.
subtitle
s();
+ dcp::Interop
Text
Asset asset(out);
+ subtitles = asset.
text
s();
} else {
} else {
- dcp::SMPTE
Subtitle
Asset asset(out);
- subtitles = asset.
subtitle
s();
+ dcp::SMPTE
Text
Asset asset(out);
+ subtitles = asset.
text
s();
}
BOOST_REQUIRE_EQUAL(subtitles.size(), 1U);
}
BOOST_REQUIRE_EQUAL(subtitles.size(), 1U);
@@
-144,7
+144,7
@@
BOOST_AUTO_TEST_CASE(subtitles_correctly_placed_with_all_references)
constexpr auto height = 0.0462963;
/* Interop source */
constexpr auto height = 0.0462963;
/* Interop source */
- auto from = dcp::
Subtitle
Standard::INTEROP;
+ auto from = dcp::
Text
Standard::INTEROP;
// -> Interop
vpos_test(dcp::VAlign::TOP, 0.2, from, dcp::Standard::INTEROP);
// -> Interop
vpos_test(dcp::VAlign::TOP, 0.2, from, dcp::Standard::INTEROP);
@@
-157,7
+157,7
@@
BOOST_AUTO_TEST_CASE(subtitles_correctly_placed_with_all_references)
vpos_test(dcp::VAlign::BOTTOM, 0.08, from, dcp::Standard::SMPTE);
/* SMPTE 2010 source */
vpos_test(dcp::VAlign::BOTTOM, 0.08, from, dcp::Standard::SMPTE);
/* SMPTE 2010 source */
- from = dcp::
Subtitle
Standard::SMPTE_2010;
+ from = dcp::
Text
Standard::SMPTE_2010;
// -> Interop
vpos_test(dcp::VAlign::TOP, 0.1 + height - baseline_to_bottom, from, dcp::Standard::INTEROP);
// -> Interop
vpos_test(dcp::VAlign::TOP, 0.1 + height - baseline_to_bottom, from, dcp::Standard::INTEROP);
@@
-170,7
+170,7
@@
BOOST_AUTO_TEST_CASE(subtitles_correctly_placed_with_all_references)
vpos_test(dcp::VAlign::BOTTOM, 0.10 + baseline_to_bottom, from, dcp::Standard::SMPTE);
/* SMPTE 2014 source */
vpos_test(dcp::VAlign::BOTTOM, 0.10 + baseline_to_bottom, from, dcp::Standard::SMPTE);
/* SMPTE 2014 source */
- from = dcp::
Subtitle
Standard::SMPTE_2014;
+ from = dcp::
Text
Standard::SMPTE_2014;
// -> Interop
vpos_test(dcp::VAlign::TOP, 0.2, from, dcp::Standard::INTEROP);
// -> Interop
vpos_test(dcp::VAlign::TOP, 0.2, from, dcp::Standard::INTEROP);
diff --git
a/test/subtitle_reel_number_test.cc
b/test/subtitle_reel_number_test.cc
index 743d809ddfd1847842eb437365086d1ede439043..e7ac0c907cbcbf964b24b2b87d60722ac6e80a1c 100644
(file)
--- a/
test/subtitle_reel_number_test.cc
+++ b/
test/subtitle_reel_number_test.cc
@@
-28,7
+28,7
@@
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/reel.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/reel.h>
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/reel_subtitle_asset.h>
#include <dcp/raw_convert.h>
#include <boost/test/unit_test.hpp>
#include <dcp/reel_subtitle_asset.h>
#include <dcp/raw_convert.h>
#include <boost/test/unit_test.hpp>
@@
-65,7
+65,7
@@
BOOST_AUTO_TEST_CASE (subtitle_reel_number_test)
int n = 1;
for (auto i: cpl->reels()) {
if (i->main_subtitle()) {
int n = 1;
for (auto i: cpl->reels()) {
if (i->main_subtitle()) {
- auto ass = dynamic_pointer_cast<dcp::Interop
Subtitle
Asset>(i->main_subtitle()->asset());
+ auto ass = dynamic_pointer_cast<dcp::Interop
Text
Asset>(i->main_subtitle()->asset());
BOOST_REQUIRE (ass);
BOOST_CHECK_EQUAL (ass->reel_number(), dcp::raw_convert<string>(n));
++n;
BOOST_REQUIRE (ass);
BOOST_CHECK_EQUAL (ass->reel_number(), dcp::raw_convert<string>(n));
++n;
diff --git
a/test/subtitle_reel_test.cc
b/test/subtitle_reel_test.cc
index d7eb90d251eb45382eff78d2c4a78a2a1213a852..0f9abe78297291dfeda352d1916e3d6f1f78ba03 100644
(file)
--- a/
test/subtitle_reel_test.cc
+++ b/
test/subtitle_reel_test.cc
@@
-28,7
+28,7
@@
#include <dcp/dcp.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
#include <dcp/dcp.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
-#include <dcp/interop_
subtitle
_asset.h>
+#include <dcp/interop_
text
_asset.h>
#include <dcp/reel_closed_caption_asset.h>
#include <dcp/reel_subtitle_asset.h>
#include <boost/test/unit_test.hpp>
#include <dcp/reel_closed_caption_asset.h>
#include <dcp/reel_subtitle_asset.h>
#include <boost/test/unit_test.hpp>
@@
-78,25
+78,25
@@
BOOST_AUTO_TEST_CASE (subtitle_reel_test)
auto i = reels.begin ();
BOOST_REQUIRE ((*i)->main_subtitle());
BOOST_REQUIRE ((*i)->main_subtitle()->asset());
auto i = reels.begin ();
BOOST_REQUIRE ((*i)->main_subtitle());
BOOST_REQUIRE ((*i)->main_subtitle()->asset());
- auto A = std::dynamic_pointer_cast<dcp::Interop
Subtitle
Asset>((*i)->main_subtitle()->asset());
+ auto A = std::dynamic_pointer_cast<dcp::Interop
Text
Asset>((*i)->main_subtitle()->asset());
BOOST_REQUIRE (A);
++i;
BOOST_REQUIRE ((*i)->main_subtitle());
BOOST_REQUIRE ((*i)->main_subtitle()->asset());
BOOST_REQUIRE (A);
++i;
BOOST_REQUIRE ((*i)->main_subtitle());
BOOST_REQUIRE ((*i)->main_subtitle()->asset());
- auto B = std::dynamic_pointer_cast<dcp::Interop
Subtitle
Asset>((*i)->main_subtitle()->asset());
+ auto B = std::dynamic_pointer_cast<dcp::Interop
Text
Asset>((*i)->main_subtitle()->asset());
BOOST_REQUIRE (B);
BOOST_REQUIRE (B);
- BOOST_REQUIRE_EQUAL
(A->subtitle
s().size(), 1U);
- BOOST_REQUIRE_EQUAL
(B->subtitle
s().size(), 1U);
+ BOOST_REQUIRE_EQUAL
(A->text
s().size(), 1U);
+ BOOST_REQUIRE_EQUAL
(B->text
s().size(), 1U);
/* These times should be the same as they are should be offset from the start of the reel */
/* These times should be the same as they are should be offset from the start of the reel */
- BOOST_CHECK
(A->subtitles().front()->in() == B->subtitle
s().front()->in());
+ BOOST_CHECK
(A->texts().front()->in() == B->text
s().front()->in());
}
/** Check that with a SMPTE DCP if we have subtitles in one reel, all reels have a
}
/** Check that with a SMPTE DCP if we have subtitles in one reel, all reels have a
- *
Subtitle
Asset (even if it's empty); SMPTE Bv2.1 section 8.3.1.
+ *
Text
Asset (even if it's empty); SMPTE Bv2.1 section 8.3.1.
*/
BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
{
*/
BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
{
@@
-224,7
+224,7
@@
BOOST_AUTO_TEST_CASE (subtitles_split_at_reel_boundaries)
BOOST_REQUIRE (reel_sub);
auto sub = reel_sub->asset();
BOOST_REQUIRE (sub);
BOOST_REQUIRE (reel_sub);
auto sub = reel_sub->asset();
BOOST_REQUIRE (sub);
- BOOST_CHECK_EQUAL
(sub->subtitle
s().size(), 1U);
+ BOOST_CHECK_EQUAL
(sub->text
s().size(), 1U);
}
}
}
}
diff --git
a/test/subtitle_timing_test.cc
b/test/subtitle_timing_test.cc
index e5a4133adea5e709ae42f70de36be50654c6ddb2..48c3d00e52b180c7b305f38b8cd6950ecc167910 100644
(file)
--- a/
test/subtitle_timing_test.cc
+++ b/
test/subtitle_timing_test.cc
@@
-61,7
+61,7
@@
BOOST_AUTO_TEST_CASE (test_subtitle_timing_with_frame_rate_change)
BOOST_REQUIRE(reel->main_subtitle());
BOOST_REQUIRE(reel->main_subtitle()->asset());
BOOST_REQUIRE(reel->main_subtitle());
BOOST_REQUIRE(reel->main_subtitle()->asset());
- auto subs = reel->main_subtitle()->asset()->
subtitle
s();
+ auto subs = reel->main_subtitle()->asset()->
text
s();
int index = 0;
for (auto i: subs) {
auto error = std::abs(i->in().as_seconds() - (index * content_frame_rate / dcp_frame_rate));
int index = 0;
for (auto i: subs) {
auto error = std::abs(i->in().as_seconds() - (index * content_frame_rate / dcp_frame_rate));