/*
- Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#include "analyse_subtitles_job.h"
-#include "playlist.h"
-#include "player.h"
-#include "subtitle_analysis.h"
#include "bitmap_text.h"
+#include "image.h"
+#include "player.h"
+#include "playlist.h"
#include "render_text.h"
+#include "subtitle_analysis.h"
#include "text_content.h"
-#include "image.h"
#include <iostream>
#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;
#endif
+
AnalyseSubtitlesJob::AnalyseSubtitlesJob (shared_ptr<const Film> film, shared_ptr<Content> content)
: Job (film)
, _content (content)
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;
}