summaryrefslogtreecommitdiff
path: root/src/text.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-20 21:02:55 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-24 00:29:31 +0100
commit8edb46702b372b6e672d0ac8f810e151e1aa5707 (patch)
treee2a458fc456b3bd98982e6e31c0ec7589ab25274 /src/text.cc
parent0322c4604bf79c11a99dcd929a6f74685a0a4e31 (diff)
Read/write subtitle variable Z.v1.10.16
Diffstat (limited to 'src/text.cc')
-rw-r--r--src/text.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/text.cc b/src/text.cc
index 158af38c..8f72b953 100644
--- a/src/text.cc
+++ b/src/text.cc
@@ -44,6 +44,9 @@
using std::shared_ptr;
+using std::string;
+using std::vector;
+using boost::optional;
using namespace dcp;
@@ -56,6 +59,7 @@ Text::Text(
float v_position,
VAlign v_align,
float z_position,
+ vector<VariableZPosition> variable_z_positions,
Time fade_up_time,
Time fade_down_time
)
@@ -66,6 +70,7 @@ Text::Text(
, _v_position (v_position)
, _v_align (v_align)
, _z_position(z_position)
+ , _variable_z_positions(variable_z_positions)
, _fade_up_time (fade_up_time)
, _fade_down_time (fade_down_time)
{
@@ -117,6 +122,11 @@ Text::equals(shared_ptr<const Text> other, EqualityOptions const& options, NoteH
same = false;
}
+ if (variable_z_positions() != other->variable_z_positions()) {
+ note(NoteType::ERROR, "text variable Z positions differ");
+ same = false;
+ }
+
if (fade_up_time() != other->fade_up_time()) {
note(NoteType::ERROR, "text fade-up times differ");
same = false;
@@ -129,3 +139,10 @@ Text::equals(shared_ptr<const Text> other, EqualityOptions const& options, NoteH
return same;
}
+
+
+bool dcp::operator==(Text::VariableZPosition a, Text::VariableZPosition b)
+{
+ return a.position == b.position && a.duration == b.duration;
+}
+