summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-12 23:14:06 +0200
committerCarl Hetherington <cth@carlh.net>2023-09-12 23:14:06 +0200
commit960c69dcaef94e0e4fbbaa9721d5ea6a4a744726 (patch)
tree1e79d9fef25fcbfc02b74a4aeb8f00682a2165d3
parent919220417db76c90e417144dbc8c31493561da11 (diff)
Add Film::closed_caption_languages().
-rw-r--r--src/lib/film.cc16
-rw-r--r--src/lib/film.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index daa88282d..dabef62bb 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -815,6 +815,22 @@ Film::subtitle_languages () const
}
+vector<dcp::LanguageTag>
+Film::closed_caption_languages() const
+{
+ vector<dcp::LanguageTag> result;
+ for (auto i: content()) {
+ for (auto text: i->text) {
+ if (text->use() && text->type() == TextType::CLOSED_CAPTION && text->dcp_track() && text->dcp_track()->language) {
+ result.push_back(*text->dcp_track()->language);
+ }
+ }
+ }
+
+ return result;
+}
+
+
/** @return a ISDCF-compliant name for a DCP of this film */
string
Film::isdcf_name (bool if_created_now) const
diff --git a/src/lib/film.h b/src/lib/film.h
index 22b58f746..5c230614d 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -192,6 +192,8 @@ public:
/** @return pair containing the main subtitle language, and additional languages */
std::pair<boost::optional<dcp::LanguageTag>, std::vector<dcp::LanguageTag>> subtitle_languages () const;
+ /** @return all closed caption languages in the film */
+ std::vector<dcp::LanguageTag> closed_caption_languages() const;
std::string content_summary (dcpomatic::DCPTimePeriod period) const;