diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-01-11 23:18:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-01-12 02:06:50 +0100 |
| commit | 573d8ffc23d27f67d84b320ca8707e8ebd0a5171 (patch) | |
| tree | 9b0c96eab48715a29f086b443b0c7009714d606d | |
| parent | 20c749bb5aee7a12d6a4365bc35fee01b9810fe3 (diff) | |
Add is_closed() for TextType and dcp::TextType.
| -rw-r--r-- | src/lib/text_type.cc | 14 | ||||
| -rw-r--r-- | src/lib/text_type.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/text_type.cc b/src/lib/text_type.cc index 33e74bdca..99799abcd 100644 --- a/src/lib/text_type.cc +++ b/src/lib/text_type.cc @@ -97,7 +97,21 @@ is_open(TextType type) bool +is_closed(TextType type) +{ + return type == TextType::CLOSED_SUBTITLE || type == TextType::CLOSED_CAPTION; +} + + +bool is_open(dcp::TextType type) { return type == dcp::TextType::OPEN_SUBTITLE || type == dcp::TextType::OPEN_CAPTION; } + + +bool +is_closed(dcp::TextType type) +{ + return type == dcp::TextType::CLOSED_SUBTITLE || type == dcp::TextType::CLOSED_CAPTION; +} diff --git a/src/lib/text_type.h b/src/lib/text_type.h index 1f2a5aeec..20ed0e080 100644 --- a/src/lib/text_type.h +++ b/src/lib/text_type.h @@ -52,7 +52,9 @@ extern std::string text_type_to_string(TextType t); extern std::string text_type_to_name(TextType t); extern TextType string_to_text_type(std::string s); bool is_open(TextType type); +bool is_closed(TextType type); bool is_open(dcp::TextType type); +bool is_closed(dcp::TextType type); #endif |
