diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-14 10:51:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-14 23:51:12 +0100 |
| commit | 3433dfa45f15e40ed9d5f5d17045f02bb6fd01ce (patch) | |
| tree | 4badeb29e90ca28ca586baf39a2039db99e9c4ef /src/lib/film_util.cc | |
| parent | faa7efd869e11c6e0ec4f00da8e1ad99415c709b (diff) | |
Extract dcpomatic::film::is_vf().
Diffstat (limited to 'src/lib/film_util.cc')
| -rw-r--r-- | src/lib/film_util.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/film_util.cc b/src/lib/film_util.cc index e5bc30db4..13068e91d 100644 --- a/src/lib/film_util.cc +++ b/src/lib/film_util.cc @@ -20,10 +20,13 @@ #include "config.h" +#include "content.h" +#include "dcp_content.h" #include "film.h" #include "film_util.h" +using std::dynamic_pointer_cast; using std::shared_ptr; using boost::optional; @@ -45,3 +48,28 @@ dcpomatic::film::add_files_override_path(shared_ptr<const Film> film) : boost::optional<boost::filesystem::path>(); } + + +bool +dcpomatic::film::is_vf(shared_ptr<const Film> film) +{ + for (auto content: film->content()) { + auto dcp = dynamic_pointer_cast<const DCPContent>(content); + if (!dcp) { + continue; + } + + bool any_text = false; + for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) { + if (dcp->reference_text(static_cast<TextType>(i))) { + any_text = true; + } + } + if (dcp->reference_video() || dcp->reference_audio() || any_text) { + return true; + } + } + + return false; +} + |
