diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-11 23:04:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-12 02:06:50 +0100 |
| commit | 20c749bb5aee7a12d6a4365bc35fee01b9810fe3 (patch) | |
| tree | 71b6e2894281d0c0e5109b5161bf3441aa46072b /src | |
| parent | 5d9b8579950a4440b43a649c27fa36082144773d (diff) | |
Rename subtitle_languages() -> open_text_languages().
Also make it return open captions as well as open subtitles (#2941).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/film.cc | 6 | ||||
| -rw-r--r-- | src/lib/film.h | 6 | ||||
| -rw-r--r-- | src/lib/reel_writer.cc | 4 | ||||
| -rw-r--r-- | src/lib/subtitle_film_encoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/writer.cc | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index cf04ac0da..8f884a8a5 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -819,7 +819,7 @@ Film::mapped_audio_channels () const pair<optional<dcp::LanguageTag>, vector<dcp::LanguageTag>> -Film::subtitle_languages(bool* burnt_in) const +Film::open_text_languages(bool* burnt_in) const { if (burnt_in) { *burnt_in = true; @@ -830,7 +830,7 @@ Film::subtitle_languages(bool* burnt_in) const auto dcp = dynamic_pointer_cast<DCPContent>(i); for (auto const& text: i->text) { auto const use = text->use() || (dcp && dcp->reference_text(TextType::OPEN_SUBTITLE)); - if (use && text->type() == TextType::OPEN_SUBTITLE) { + if (use && is_open(text->type())) { if (!text->burn() && burnt_in) { *burnt_in = false; } @@ -1012,7 +1012,7 @@ Film::isdcf_name (bool if_created_now) const isdcf_name += "_" + to_upper (audio_language); bool burnt_in; - auto sub_langs = subtitle_languages(&burnt_in); + auto sub_langs = open_text_languages(&burnt_in); auto ccap_langs = closed_caption_languages(); if (sub_langs.first && sub_langs.first->language()) { auto lang = entry_for_language(*sub_langs.first); diff --git a/src/lib/film.h b/src/lib/film.h index 648d9828b..f095023a3 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -177,10 +177,10 @@ public: return _audio_language; } - /** @param burnt_in If non-null, filled with true if all subtitles are burnt in, otherwise false. - * @return pair containing the main subtitle language, and additional languages + /** @param burnt_in If non-null, filled with true if all open subtitles/captions are burnt in, otherwise false. + * @return pair containing the main open subtitle/caption language, and additional languages */ - std::pair<boost::optional<dcp::LanguageTag>, std::vector<dcp::LanguageTag>> subtitle_languages(bool* burnt_in = nullptr) const; + std::pair<boost::optional<dcp::LanguageTag>, std::vector<dcp::LanguageTag>> open_text_languages(bool* burnt_in = nullptr) const; /** @return all closed caption languages in the film */ std::vector<dcp::LanguageTag> closed_caption_languages() const; diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index ec7fc9e39..3cd889249 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -623,7 +623,7 @@ ReelWriter::create_reel_text ( if (subtitle) { /* We have a subtitle asset that we either made or are referencing */ - if (auto main_language = film()->subtitle_languages().first) { + if (auto main_language = film()->open_text_languages().first) { subtitle->set_language (*main_language); } } @@ -796,7 +796,7 @@ ReelWriter::empty_text_asset (TextType type, optional<DCPTextTrack> track, bool shared_ptr<dcp::TextAsset> asset; optional<string> font; - auto lang = film()->subtitle_languages(); + auto lang = film()->open_text_languages(); if (film()->interop()) { auto s = make_shared<dcp::InteropTextAsset>(); s->set_movie_title (film()->name()); diff --git a/src/lib/subtitle_film_encoder.cc b/src/lib/subtitle_film_encoder.cc index c9520bf0b..a127ba73f 100644 --- a/src/lib/subtitle_film_encoder.cc +++ b/src/lib/subtitle_film_encoder.cc @@ -140,7 +140,7 @@ SubtitleFilmEncoder::text(PlayerText subs, TextType type, optional<DCPTextTrack> if (!_assets[_reel_index].first) { shared_ptr<dcp::TextAsset> asset; - auto lang = _film->subtitle_languages (); + auto const lang = _film->open_text_languages(); if (_film->interop ()) { auto s = make_shared<dcp::InteropTextAsset>(); s->set_movie_title (_film->name()); diff --git a/src/lib/writer.cc b/src/lib/writer.cc index b1d21cae1..9b7f059f9 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -695,7 +695,7 @@ Writer::finish() cpl->set_main_picture_active_area({ active_area.width & ~1, active_area.height & ~1}); } - auto sl = film()->subtitle_languages().second; + auto const sl = film()->open_text_languages().second; if (!sl.empty()) { cpl->set_additional_subtitle_languages(sl); } @@ -746,7 +746,7 @@ Writer::write_cover_sheet() boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", _("None")); } - auto subtitle_languages = film()->subtitle_languages(); + auto const subtitle_languages = film()->open_text_languages(); if (subtitle_languages.first) { boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_languages.first->description()); } else { |
