summaryrefslogtreecommitdiff
path: root/src/lib/analyse_subtitles_job.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-23 00:11:38 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-24 00:46:31 +0200
commitcef7a679a59044a5c807768042deecfd56ec6fc2 (patch)
treeb0e020a2a70db228df0e96fd85b63a84d7d69b64 /src/lib/analyse_subtitles_job.h
parent87d5a977da0696fbe73b96b2679b7cbb471e7255 (diff)
Add subtitle analysis so that the outline of all subtitles
in a piece of content can be overlaid onto the preview (#1233).
Diffstat (limited to 'src/lib/analyse_subtitles_job.h')
-rw-r--r--src/lib/analyse_subtitles_job.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/lib/analyse_subtitles_job.h b/src/lib/analyse_subtitles_job.h
new file mode 100644
index 000000000..88b5d23dc
--- /dev/null
+++ b/src/lib/analyse_subtitles_job.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "job.h"
+#include "types.h"
+#include "player_text.h"
+
+class Film;
+class Content;
+
+class AnalyseSubtitlesJob : public Job
+{
+public:
+ AnalyseSubtitlesJob (boost::shared_ptr<const Film> film, boost::shared_ptr<Content> content);
+
+ std::string name () const;
+ std::string json_name () const;
+ void run ();
+
+ boost::filesystem::path path () const {
+ return _path;
+ }
+
+private:
+ void analyse (PlayerText text, TextType type);
+
+ boost::weak_ptr<Content> _content;
+ boost::filesystem::path _path;
+ boost::optional<dcpomatic::Rect<double> > _bounding_box;
+};
+