#include <dcp/smpte_subtitle_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/subtitle_image.h>
-#include <boost/foreach.hpp>
#include "i18n.h"
using std::set;
using std::vector;
using std::shared_ptr;
+using std::make_shared;
using boost::optional;
using std::dynamic_pointer_cast;
#if BOOST_VERSION >= 106100
output. We will hard-link it into the DCP later.
*/
- dcp::Standard const standard = film()->interop() ? dcp::INTEROP : dcp::SMPTE;
+ dcp::Standard const standard = film()->interop() ? dcp::Standard::INTEROP : dcp::Standard::SMPTE;
boost::filesystem::path const asset =
film()->internal_video_asset_dir() / film()->internal_video_asset_filename(_period);
DCPOMATIC_ASSERT (film()->directory());
vector<dcp::Channel> active;
- BOOST_FOREACH (int i, film()->mapped_audio_channels()) {
+ for (auto i: film()->mapped_audio_channels()) {
active.push_back (static_cast<dcp::Channel>(i));
}
if (asset) {
/* Add the font to the subtitle content */
- BOOST_FOREACH (FontData const& j, fonts) {
+ for (auto const& j: fonts) {
asset->add_font (j.id, j.data.get_value_or(default_font));
}
);
} else {
/* We don't have a subtitle asset of our own; hopefully we have one to reference */
- BOOST_FOREACH (ReferencedReelAsset j, refs) {
+ for (auto j: refs) {
shared_ptr<T> k = dynamic_pointer_cast<T> (j.asset);
if (k && j.period == period) {
reel_asset = k;
} else {
LOG_GENERAL ("no picture asset of our own; look through %1", refs.size());
/* We don't have a picture asset of our own; hopefully we have one to reference */
- BOOST_FOREACH (ReferencedReelAsset j, refs) {
+ for (auto j: refs) {
shared_ptr<dcp::ReelPictureAsset> k = dynamic_pointer_cast<dcp::ReelPictureAsset> (j.asset);
if (k) {
LOG_GENERAL ("candidate picture asset period is %1-%2", j.period.from.get(), j.period.to.get());
} else {
LOG_GENERAL ("no sound asset of our own; look through %1", refs.size());
/* We don't have a sound asset of our own; hopefully we have one to reference */
- BOOST_FOREACH (ReferencedReelAsset j, refs) {
+ for (auto j: refs) {
shared_ptr<dcp::ReelSoundAsset> k = dynamic_pointer_cast<dcp::ReelSoundAsset> (j.asset);
if (k) {
LOG_GENERAL ("candidate sound asset period is %1-%2", j.period.from.get(), j.period.to.get());
}
/* Make empty tracks for anything we've been asked to ensure but that we haven't added */
- BOOST_FOREACH (DCPTextTrack i, ensure_closed_captions) {
+ for (auto i: ensure_closed_captions) {
shared_ptr<dcp::ReelClosedCaptionAsset> a = maybe_add_text<dcp::ReelClosedCaptionAsset> (
empty_text_asset(TEXT_CLOSED_CAPTION, i), duration, reel, refs, fonts, _default_font, film(), _period, output_dcp, _text_only
);
}
if (!reel_markers.empty ()) {
- shared_ptr<dcp::ReelMarkersAsset> ma (new dcp::ReelMarkersAsset(dcp::Fraction(film()->video_frame_rate(), 1), 0));
+ auto ma = make_shared<dcp::ReelMarkersAsset>(dcp::Fraction(film()->video_frame_rate(), 1), reel->duration(), 0);
for (map<dcp::Marker, DCPTime>::const_iterator i = reel_markers.begin(); i != reel_markers.end(); ++i) {
int h, m, s, f;
DCPTime relative = i->second - _period.from;
DCPOMATIC_ASSERT (false);
}
- BOOST_FOREACH (StringText i, subs.string) {
+ for (auto i: subs.string) {
/* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */
i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr));
i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr));
asset->add (shared_ptr<dcp::Subtitle>(new dcp::SubtitleString(i)));
}
- BOOST_FOREACH (BitmapText i, subs.bitmap) {
+ for (auto i: subs.bitmap) {
asset->add (
shared_ptr<dcp::Subtitle>(
new dcp::SubtitleImage(
i.image->as_png(),
dcp::Time(period.from.seconds() - _period.from.seconds(), film()->video_frame_rate()),
dcp::Time(period.to.seconds() - _period.from.seconds(), film()->video_frame_rate()),
- i.rectangle.x, dcp::HALIGN_LEFT, i.rectangle.y, dcp::VALIGN_TOP,
+ i.rectangle.x, dcp::HAlign::LEFT, i.rectangle.y, dcp::VAlign::TOP,
dcp::Time(), dcp::Time()
)
)