From 8edb46702b372b6e672d0ac8f810e151e1aa5707 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 20 Mar 2025 21:02:55 +0100 Subject: Read/write subtitle variable Z. --- src/text.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/text.cc') 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 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 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 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; +} + -- cgit v1.2.3