projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow specifying and writing sign language video language metadata (#2062).
[dcpomatic.git]
/
src
/
lib
/
text_content.h
diff --git
a/src/lib/text_content.h
b/src/lib/text_content.h
index e5981acafe90edda62f7aa389dbc1fd6f16efc13..4c6918a4220d0d5cc39610f7d20a1e89245199cf 100644
(file)
--- a/
src/lib/text_content.h
+++ b/
src/lib/text_content.h
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2013-20
18
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-20
21
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,15
+18,22
@@
*/
*/
+
#ifndef DCPOMATIC_CAPTION_CONTENT_H
#define DCPOMATIC_CAPTION_CONTENT_H
#ifndef DCPOMATIC_CAPTION_CONTENT_H
#define DCPOMATIC_CAPTION_CONTENT_H
+
#include "content_part.h"
#include "content_part.h"
+#include "dcp_text_track.h"
#include <libcxml/cxml.h>
#include <libcxml/cxml.h>
+#include <dcp/language_tag.h>
#include <dcp/types.h>
#include <boost/signals2.hpp>
#include <dcp/types.h>
#include <boost/signals2.hpp>
-class Font;
+
+namespace dcpomatic {
+ class Font;
+}
class TextContentProperty
{
class TextContentProperty
{
@@
-37,7
+44,6
@@
public:
static int const Y_SCALE;
static int const USE;
static int const BURN;
static int const Y_SCALE;
static int const USE;
static int const BURN;
- static int const LANGUAGE;
static int const FONTS;
static int const COLOUR;
static int const EFFECT;
static int const FONTS;
static int const COLOUR;
static int const EFFECT;
@@
-47,8
+53,12
@@
public:
static int const FADE_OUT;
static int const OUTLINE_WIDTH;
static int const TYPE;
static int const FADE_OUT;
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.
*
/** @class TextContent
* @brief Description of how some text content should be presented.
*
@@
-59,13
+69,14
@@
class TextContent : public ContentPart
{
public:
TextContent (Content* parent, TextType type, TextType original_type);
{
public:
TextContent (Content* parent, TextType type, TextType original_type);
- TextContent (Content* parent, std::vector<boost::shared_ptr<Content> >);
+ TextContent (Content* parent, std::vector<std::shared_ptr<Content> >);
+ TextContent (Content* parent, cxml::ConstNodePtr, int version);
void as_xml (xmlpp::Node *) const;
std::string identifier () const;
void as_xml (xmlpp::Node *) const;
std::string identifier () const;
- void take_settings_from (
boost
::shared_ptr<const TextContent> c);
+ void take_settings_from (
std
::shared_ptr<const TextContent> c);
- void add_font (
boost::shared_ptr<
Font> font);
+ void add_font (
std::shared_ptr<dcpomatic::
Font> font);
void set_use (bool);
void set_burn (bool);
void set_use (bool);
void set_burn (bool);
@@
-73,7
+84,6
@@
public:
void set_y_offset (double);
void set_x_scale (double);
void set_y_scale (double);
void set_y_offset (double);
void set_x_scale (double);
void set_y_scale (double);
- void set_language (std::string language);
void set_colour (dcp::Colour);
void unset_colour ();
void set_effect (dcp::Effect);
void set_colour (dcp::Colour);
void unset_colour ();
void set_effect (dcp::Effect);
@@
-81,12
+91,16
@@
public:
void set_effect_colour (dcp::Colour);
void unset_effect_colour ();
void set_line_spacing (double s);
void set_effect_colour (dcp::Colour);
void unset_effect_colour ();
void set_line_spacing (double s);
- void set_fade_in (ContentTime);
+ void set_fade_in (
dcpomatic::
ContentTime);
void unset_fade_in ();
void unset_fade_in ();
- void set_fade_out (ContentTime);
+ void set_fade_out (
dcpomatic::
ContentTime);
void set_outline_width (int);
void unset_fade_out ();
void set_type (TextType type);
void set_outline_width (int);
void unset_fade_out ();
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);
bool use () const {
boost::mutex::scoped_lock lm (_mutex);
@@
-118,16
+132,11
@@
public:
return _y_scale;
}
return _y_scale;
}
- std::list<
boost::shared_ptr<
Font> > fonts () const {
+ std::list<
std::shared_ptr<dcpomatic::
Font> > fonts () const {
boost::mutex::scoped_lock lm (_mutex);
return _fonts;
}
boost::mutex::scoped_lock lm (_mutex);
return _fonts;
}
- std::string language () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _language;
- }
-
boost::optional<dcp::Colour> colour () const {
boost::mutex::scoped_lock lm (_mutex);
return _colour;
boost::optional<dcp::Colour> colour () const {
boost::mutex::scoped_lock lm (_mutex);
return _colour;
@@
-148,12
+157,12
@@
public:
return _line_spacing;
}
return _line_spacing;
}
- boost::optional<ContentTime> fade_in () const {
+ boost::optional<
dcpomatic::
ContentTime> fade_in () const {
boost::mutex::scoped_lock lm (_mutex);
return _fade_in;
}
boost::mutex::scoped_lock lm (_mutex);
return _fade_in;
}
- boost::optional<ContentTime> fade_out () const {
+ boost::optional<
dcpomatic::
ContentTime> fade_out () const {
boost::mutex::scoped_lock lm (_mutex);
return _fade_out;
}
boost::mutex::scoped_lock lm (_mutex);
return _fade_out;
}
@@
-173,16
+182,26
@@
public:
return _original_type;
}
return _original_type;
}
- static std::list<boost::shared_ptr<TextContent> > from_xml (Content* parent, cxml::ConstNodePtr, int version);
+ boost::optional<DCPTextTrack> dcp_track () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _dcp_track;
+ }
+
+ boost::optional<dcp::LanguageTag> language () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _language;
+ }
-protected:
- /** subtitle language (e.g. "German") or empty if it is not known */
- std::string _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;
private:
friend struct ffmpeg_pts_offset_test;
- TextContent (Content* parent, cxml::ConstNodePtr, int version);
void font_changed ();
void connect_to_fonts ();
void font_changed ();
void connect_to_fonts ();
@@
-202,14
+221,14
@@
private:
double _x_scale;
/** y scale factor to apply to subtitles */
double _y_scale;
double _x_scale;
/** y scale factor to apply to subtitles */
double _y_scale;
- std::list<
boost::shared_ptr<
Font> > _fonts;
+ std::list<
std::shared_ptr<dcpomatic::
Font> > _fonts;
boost::optional<dcp::Colour> _colour;
boost::optional<dcp::Effect> _effect;
boost::optional<dcp::Colour> _effect_colour;
/** scaling factor for line spacing; 1 is "standard", < 1 is closer together, > 1 is further apart */
double _line_spacing;
boost::optional<dcp::Colour> _colour;
boost::optional<dcp::Effect> _effect;
boost::optional<dcp::Colour> _effect_colour;
/** scaling factor for line spacing; 1 is "standard", < 1 is closer together, > 1 is further apart */
double _line_spacing;
- boost::optional<ContentTime> _fade_in;
- boost::optional<ContentTime> _fade_out;
+ boost::optional<
dcpomatic::
ContentTime> _fade_in;
+ boost::optional<
dcpomatic::
ContentTime> _fade_out;
int _outline_width;
/** what these captions will be used for in the output DCP (not necessarily what
* they were originally).
int _outline_width;
/** what these captions will be used for in the output DCP (not necessarily what
* they were originally).
@@
-217,6
+236,10
@@
private:
TextType _type;
/** the original type of these captions in their content */
TextType _original_type;
TextType _type;
/** the original type of these captions in their content */
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
};
#endif