diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-03-23 00:50:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-03-31 22:48:53 +0200 |
| commit | e0a70cd5cfb11fc2de167f3146acdd437a6faa82 (patch) | |
| tree | 022ceef78d7daa12bccf519ebab0db5e23a3feb6 /src/lib/text_content.h | |
| parent | 8640da877450479a85c73b2a921897d83b478c84 (diff) | |
Put subtitle language back into content from the film (#1930).
This also adds the main/additional language flag.
Of all the considerations about how to specify subtitle language,
the most important seems to be that the language specification happens
for the content where the language is; i.e. in the content text tab.
Diffstat (limited to 'src/lib/text_content.h')
| -rw-r--r-- | src/lib/text_content.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/text_content.h b/src/lib/text_content.h index e566d0552..4c6918a42 100644 --- a/src/lib/text_content.h +++ b/src/lib/text_content.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,15 +18,19 @@ */ + #ifndef DCPOMATIC_CAPTION_CONTENT_H #define DCPOMATIC_CAPTION_CONTENT_H + #include "content_part.h" #include "dcp_text_track.h" #include <libcxml/cxml.h> +#include <dcp/language_tag.h> #include <dcp/types.h> #include <boost/signals2.hpp> + namespace dcpomatic { class Font; } @@ -50,8 +54,11 @@ public: static int const OUTLINE_WIDTH; static int const TYPE; static int const DCP_TRACK; + static int const LANGUAGE; + static int const LANGUAGE_IS_ADDITIONAL; }; + /** @class TextContent * @brief Description of how some text content should be presented. * @@ -92,6 +99,8 @@ public: void set_type (TextType type); void set_dcp_track (DCPTextTrack track); void unset_dcp_track (); + void set_language (boost::optional<dcp::LanguageTag> language = boost::none); + void set_language_is_additional (bool additional); bool use () const { boost::mutex::scoped_lock lm (_mutex); @@ -178,7 +187,17 @@ public: return _dcp_track; } - static std::list<std::shared_ptr<TextContent> > from_xml (Content* parent, cxml::ConstNodePtr, int version); + boost::optional<dcp::LanguageTag> language () const { + boost::mutex::scoped_lock lm (_mutex); + return _language; + } + + bool language_is_additional () const { + boost::mutex::scoped_lock lm (_mutex); + return _language_is_additional; + } + + static std::list<std::shared_ptr<TextContent>> from_xml (Content* parent, cxml::ConstNodePtr, int version); private: friend struct ffmpeg_pts_offset_test; @@ -219,6 +238,8 @@ private: TextType _original_type; /** the track of closed captions that this content should be put in, or empty to put in the default (only) track */ boost::optional<DCPTextTrack> _dcp_track; + boost::optional<dcp::LanguageTag> _language; + bool _language_is_additional = false; }; #endif |
