#include "i18n.h"
-using std::string;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
using std::weak_ptr;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
void
AnalyseSubtitlesJob::run ()
{
- shared_ptr<Playlist> playlist (new Playlist());
- shared_ptr<Content> content = _content.lock ();
+ auto playlist = make_shared<Playlist>();
+ auto content = _content.lock ();
DCPOMATIC_ASSERT (content);
playlist->add (_film, content);
- shared_ptr<Player> player (new Player(_film, playlist));
+ auto player = make_shared<Player>(_film, playlist);
player->set_ignore_audio ();
player->set_fast ();
player->set_play_referenced ();
void
AnalyseSubtitlesJob::analyse (PlayerText text, TextType type)
{
- if (type != TEXT_OPEN_SUBTITLE) {
+ if (type != TextType::OPEN_SUBTITLE) {
return;
}
- BOOST_FOREACH (BitmapText const& i, text.bitmap) {
+ for (auto const& i: text.bitmap) {
if (!_bounding_box) {
_bounding_box = i.rectangle;
} else {
if (!text.string.empty()) {
/* 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();
- BOOST_FOREACH (PositionImage i, render_text(text.string, text.fonts, frame, dcpomatic::DCPTime(), 24)) {
+ for (auto i: render_text(text.string, text.fonts, frame, dcpomatic::DCPTime(), 24)) {
dcpomatic::Rect<double> rect (
double(i.position.x) / frame.width, double(i.position.y) / frame.height,
double(i.image->size().width) / frame.width, double(i.image->size().height) / frame.height