summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-01 22:44:38 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-03 10:12:52 +0100
commit032e484a267da1262803297a96f23420f01a65c8 (patch)
tree7d196ce81955dbd70e6324f2b09744c557defb33
parent08fa1aa2bc718635c3ae0f991800c6c6cfd62a2b (diff)
Remove DCP subtitle support.v1.6.41
This was only a thin wrapper around libdcp, used by videocon but not by DCP-o-matic. It seems very unlikely that anybody else will want it, and the dependency of libsub on libdcp causes hassle that will be gladly avoided.
-rw-r--r--cscript3
-rw-r--r--doc/mainpage.txt1
-rwxr-xr-xrun/tests2
-rw-r--r--src/collect.h1
-rw-r--r--src/colour.h5
-rw-r--r--src/dcp_reader.cc137
-rw-r--r--src/dcp_reader.h39
-rw-r--r--src/exceptions.h8
-rw-r--r--src/reader_factory.cc11
-rw-r--r--src/stl_binary_reader.h1
-rw-r--r--src/util.cc1
-rw-r--r--src/web_vtt_reader.h1
-rw-r--r--src/wscript5
-rw-r--r--test/dcp_reader_test.cc602
-rw-r--r--test/dcp_to_stl_binary_test.cc249
-rw-r--r--test/wscript4
-rw-r--r--tools/wscript2
-rw-r--r--wscript13
18 files changed, 8 insertions, 1077 deletions
diff --git a/cscript b/cscript
index 50aba54..776fd56 100644
--- a/cscript
+++ b/cscript
@@ -21,9 +21,6 @@ import os
option_defaults = { 'force-cpp11': False }
-def dependencies(target, options):
- return (('asdcplib', '825e47522e3ae179a7820b2665c9de299b34494b'), ('libdcp', 'v1.8.34'))
-
def build(target, options):
cmd = './waf configure --prefix=%s' % target.directory
if target.platform == 'linux':
diff --git a/doc/mainpage.txt b/doc/mainpage.txt
index db090ee..67e0bae 100644
--- a/doc/mainpage.txt
+++ b/doc/mainpage.txt
@@ -9,7 +9,6 @@ them or to convert between formats.
The current version has reasonable support for the following subtitle
formats:
-- Digital Cinema Package (DCP) XML
- SubRip (.srt)
- SubStation Alpha and Advanced SubStation Alpha (SSA/ASS)
- EBU-STL text and binary
diff --git a/run/tests b/run/tests
index 8834a57..5154e73 100755
--- a/run/tests
+++ b/run/tests
@@ -2,7 +2,7 @@
private=../libsub-test-private
-export LD_LIBRARY_PATH=build/src:build/asdcplib/src:/usr/local/lib64:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=build/src:/usr/local/lib64:$LD_LIBRARY_PATH
if [ "$1" == "--debug" ]; then
shift
gdb --args build/test/tests $private $*
diff --git a/src/collect.h b/src/collect.h
index 5fcf694..374386c 100644
--- a/src/collect.h
+++ b/src/collect.h
@@ -22,6 +22,7 @@
#include "subtitle.h"
#include "raw_subtitle.h"
+#include <algorithm>
namespace sub {
diff --git a/src/colour.h b/src/colour.h
index f3a4964..65660a5 100644
--- a/src/colour.h
+++ b/src/colour.h
@@ -24,7 +24,6 @@
#ifndef LIBSUB_COLOUR_H
#define LIBSUB_COLOUR_H
-#include <dcp/types.h>
#include <string>
#include <cmath>
@@ -57,10 +56,6 @@ public:
float g;
/** blue component (from 0 to 1) */
float b;
-
- dcp::Colour dcp() const {
- return dcp::Colour(lrintf(r * 255), lrintf(g * 255), lrintf(b * 255));
- }
};
bool
diff --git a/src/dcp_reader.cc b/src/dcp_reader.cc
deleted file mode 100644
index 0c7a29a..0000000
--- a/src/dcp_reader.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "dcp_reader.h"
-#include "compose.hpp"
-#include "exceptions.h"
-#include <dcp/subtitle_string.h>
-#include <dcp/interop_subtitle_asset.h>
-#include <dcp/smpte_subtitle_asset.h>
-#include <boost/filesystem.hpp>
-
-using std::dynamic_pointer_cast;
-using std::exception;
-using std::make_shared;
-using std::shared_ptr;
-using std::string;
-using boost::optional;
-using namespace sub;
-
-static Time
-dcp_to_sub_time (dcp::Time t)
-{
- return Time::from_hms (t.h, t.m, t.s, t.e * 1000.0 / t.tcr);
-}
-
-static Colour
-dcp_to_sub_colour (dcp::Colour c)
-{
- return Colour (c.r / 255.0, c.g / 255.0, c.b / 255.0);
-}
-
-DCPReader::DCPReader (boost::filesystem::path file)
-{
- shared_ptr<dcp::SubtitleAsset> sc;
- string interop_error;
- string smpte_error;
-
- try {
- sc = make_shared<dcp::InteropSubtitleAsset>(file);
- } catch (exception& e) {
- interop_error = e.what ();
- }
-
- if (!sc) {
- try {
- sc = make_shared<dcp::SMPTESubtitleAsset>(file);
- } catch (exception& e) {
- smpte_error = e.what();
- }
- }
-
- if (!sc) {
- throw DCPError(String::compose("Could not read subtitles (%1 / %2)", interop_error, smpte_error));
- }
-
-
- for (auto i: sc->subtitles()) {
-
- /* We don't deal with image subs */
- auto is = dynamic_pointer_cast<const dcp::SubtitleString>(i);
- if (!is) {
- continue;
- }
-
- RawSubtitle rs;
- rs.text = is->text ();
- rs.font = is->font ();
- rs.font_size = FontSize::from_proportional (is->size() / (72.0 * 11.0));
-
- switch (is->effect ()) {
- case dcp::Effect::BORDER:
- rs.effect = BORDER;
- break;
- case dcp::Effect::SHADOW:
- rs.effect = SHADOW;
- break;
- default:
- break;
- }
-
- rs.effect_colour = dcp_to_sub_colour (is->effect_colour());
-
- rs.colour = dcp_to_sub_colour (is->colour());
- rs.bold = is->bold ();
- rs.italic = is->italic ();
- rs.underline = is->underline ();
-
- switch (is->h_align()) {
- case dcp::HAlign::LEFT:
- rs.horizontal_position.reference = LEFT_OF_SCREEN;
- break;
- case dcp::HAlign::CENTER:
- rs.horizontal_position.reference = HORIZONTAL_CENTRE_OF_SCREEN;
- break;
- case dcp::HAlign::RIGHT:
- rs.horizontal_position.reference = RIGHT_OF_SCREEN;
- break;
- }
-
- rs.vertical_position.proportional = is->v_position();
- switch (is->v_align()) {
- case dcp::VAlign::TOP:
- rs.vertical_position.reference = TOP_OF_SCREEN;
- break;
- case dcp::VAlign::CENTER:
- rs.vertical_position.reference = VERTICAL_CENTRE_OF_SCREEN;
- break;
- case dcp::VAlign::BOTTOM:
- rs.vertical_position.reference = BOTTOM_OF_SCREEN;
- break;
- }
-
- rs.from = dcp_to_sub_time (is->in ());
- rs.to = dcp_to_sub_time (is->out ());
-
- rs.fade_up = dcp_to_sub_time (is->fade_up_time ());
- rs.fade_down = dcp_to_sub_time (is->fade_down_time ());
-
- _subs.push_back (rs);
- }
-}
diff --git a/src/dcp_reader.h b/src/dcp_reader.h
deleted file mode 100644
index 8f49dfd..0000000
--- a/src/dcp_reader.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright (C) 2014-2017 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef LIBSUB_DCP_READER_H
-#define LIBSUB_DCP_READER_H
-
-#include "reader.h"
-#include <boost/filesystem.hpp>
-
-namespace sub {
-
-/** @class DCPReader
- * @brief A class which reads DCP subtitles.
- */
-class DCPReader : public Reader
-{
-public:
- DCPReader (boost::filesystem::path file);
-};
-
-}
-
-#endif
diff --git a/src/exceptions.h b/src/exceptions.h
index 2b2b09c..1895f11 100644
--- a/src/exceptions.h
+++ b/src/exceptions.h
@@ -114,14 +114,6 @@ public:
{}
};
-class DCPError : public std::runtime_error
-{
-public:
- DCPError (std::string const & message)
- : std::runtime_error (message)
- {}
-};
-
class ProgrammingError : public std::runtime_error
{
public:
diff --git a/src/reader_factory.cc b/src/reader_factory.cc
index fb717ea..282f14b 100644
--- a/src/reader_factory.cc
+++ b/src/reader_factory.cc
@@ -20,10 +20,8 @@
#include "reader_factory.h"
#include "stl_binary_reader.h"
#include "stl_text_reader.h"
-#include "dcp_reader.h"
#include "subrip_reader.h"
#include "sub_assert.h"
-#include <libxml++/libxml++.h>
#include <boost/algorithm/string.hpp>
#include <fstream>
@@ -39,15 +37,6 @@ sub::reader_factory (boost::filesystem::path file_name)
string ext = file_name.extension().string();
transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
- if (ext == ".xml") {
- return shared_ptr<Reader> (new DCPReader (file_name));
- }
-
- if (ext == ".mxf") {
- /* Assume this is some MXF-wrapped SMPTE subtitles */
- return shared_ptr<Reader> (new DCPReader (file_name));
- }
-
if (ext == ".stl") {
/* Check the start of the DFC */
ifstream f (file_name.string().c_str ());
diff --git a/src/stl_binary_reader.h b/src/stl_binary_reader.h
index beb9de2..75e328a 100644
--- a/src/stl_binary_reader.h
+++ b/src/stl_binary_reader.h
@@ -23,6 +23,7 @@
#include "reader.h"
#include "stl_binary_tables.h"
#include <map>
+#include <memory>
namespace sub {
diff --git a/src/util.cc b/src/util.cc
index eb68752..244630d 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -31,7 +31,6 @@ using std::string;
using std::getline;
using std::ostream;
using std::map;
-using std::list;
using std::shared_ptr;
using std::vector;
using boost::optional;
diff --git a/src/web_vtt_reader.h b/src/web_vtt_reader.h
index 495e2bc..42e83f1 100644
--- a/src/web_vtt_reader.h
+++ b/src/web_vtt_reader.h
@@ -24,6 +24,7 @@
#include "reader.h"
#include <cstdio>
+#include <list>
#include <string>
diff --git a/src/wscript b/src/wscript
index ff029a0..563b331 100644
--- a/src/wscript
+++ b/src/wscript
@@ -8,12 +8,10 @@ def build(bld):
obj.name = 'libsub%s' % bld.env.API_VERSION
obj.target = 'sub%s' % bld.env.API_VERSION
- obj.uselib = 'CXML DCP BOOST_FILESYSTEM BOOST_LOCALE BOOST_REGEX ASDCPLIB_CTH'
- obj.use = 'libkumu-libsub%s libasdcp-libsub%s' % (bld.env.API_VERSION, bld.env.API_VERSION)
+ obj.uselib = 'CXML BOOST_FILESYSTEM BOOST_LOCALE BOOST_REGEX'
obj.export_includes = ['.']
obj.source = """
colour.cc
- dcp_reader.cc
effect.cc
exceptions.cc
font_size.cc
@@ -44,7 +42,6 @@ def build(bld):
headers = """
collect.h
colour.h
- dcp_reader.h
effect.h
exceptions.h
font_size.h
diff --git a/test/dcp_reader_test.cc b/test/dcp_reader_test.cc
deleted file mode 100644
index 9105c28..0000000
--- a/test/dcp_reader_test.cc
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "dcp_reader.h"
-#include "collect.h"
-#include <boost/test/unit_test.hpp>
-#include <boost/optional/optional_io.hpp>
-
-using std::shared_ptr;
-using std::vector;
-
-/* Test reading of a DCP XML file */
-BOOST_AUTO_TEST_CASE (dcp_reader_test1)
-{
- sub::DCPReader reader ("test/data/test1.xml");
- auto subs = sub::collect<vector<sub::Subtitle>> (reader.subtitles());
-
- auto i = subs.begin();
- BOOST_REQUIRE (i != subs.end());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 5, 198 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 0, 7, 115 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 4));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 4));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- sub::Block b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFontId");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (39) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.15, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::BOTTOM_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "My jacket was Idi Amin's");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 7, 177 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 0, 11, 31 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 4));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 4));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFontId");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (39) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.21, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::BOTTOM_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "My corset was H.M. The Queen's");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFontId");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (39) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.15, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::BOTTOM_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "My large wonderbra");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 11, 94 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 0, 13, 63 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 4));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 4));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFontId");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (39) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.15, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::BOTTOM_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "Once belonged to the Shah");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 13, 104 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 0, 15, 177 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 4));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 4));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFontId");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (39) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.15, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::BOTTOM_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "And these are Roy Hattersley's jeans");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j == i->lines.end ());
- }
-}
-
-/* And another one */
-BOOST_AUTO_TEST_CASE (dcp_reader_test2)
-{
- sub::DCPReader reader ("test/data/test2.xml");
- auto subs = sub::collect<vector<sub::Subtitle>> (reader.subtitles ());
-
- auto i = subs.begin ();
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 41, 62 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 0, 43, 52 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin ();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "At afternoon tea with John Peel");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "I enquired if his accent was real");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 0, 50, 42 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 0, 52, 21 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin ();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "He said \"out of the house");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "I'm incredibly scouse");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 2, 208 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 04, 10 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "At home it depends how I feel.\"");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 2, 208 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 4, 10 * 4));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "I spent a long weekend in Brighton");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 15, 42 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 16, 42 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "With the legendary Miss Enid Blyton");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "She said \"you be Noddy");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 20, 219 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 22, 73 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "and I'll show you my body\"");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "But Big Ears kept turning the light on.");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 27, 115 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 28, 208 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "That curious creature the Sphinx");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "Is smarter than anyone thinks");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 42, 229 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 45, 62 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "It sits there and smirks");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "And you don't think it works");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 45, 146 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 47, 94 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "Then when you're not looking, it winks.");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "When it snows you will find Sister Sledge");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 47, 146 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 48, 167 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "Out mooning, at night, on the ledge");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "One storey down");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 1, 53, 21 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 1, 56, 10 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "Is the maestro, James Brown");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, false);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "Displaying his meat and two veg.");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-
- ++i;
- BOOST_REQUIRE (i != subs.end ());
- BOOST_CHECK_EQUAL (i->from, sub::Time::from_hms (0, 2, 5, 208 * 4));
- BOOST_CHECK_EQUAL (i->to, sub::Time::from_hms (0, 2, 7, 31 * 4));
- BOOST_CHECK_EQUAL (i->fade_up.get(), sub::Time::from_hms (0, 0, 0, 0));
- BOOST_CHECK_EQUAL (i->fade_down.get(), sub::Time::from_hms (0, 0, 0, 0));
-
- {
- auto j = i->lines.begin();
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- auto b = j->blocks.front();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.89, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "HELLO");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_REQUIRE (j != i->lines.end ());
- BOOST_REQUIRE_EQUAL (j->blocks.size(), 1);
- b = j->blocks.front ();
- BOOST_CHECK_EQUAL (b.font.get(), "theFont");
- BOOST_CHECK_EQUAL (b.italic, true);
- BOOST_CHECK (b.colour == sub::Colour (1, 1, 1));
- BOOST_CHECK_EQUAL (b.font_size.proportional().get(), float (42) / (72 * 11));
- BOOST_CHECK_CLOSE (j->vertical_position.proportional.get(), 0.95, 1);
- BOOST_CHECK_EQUAL (j->vertical_position.reference.get(), sub::TOP_OF_SCREEN);
- BOOST_CHECK_EQUAL (b.text, "WORLD");
- BOOST_CHECK_EQUAL (b.effect, sub::BORDER);
- BOOST_CHECK (b.effect_colour.get() == sub::Colour (0, 0, 0));
-
- ++j;
- BOOST_CHECK (j == i->lines.end ());
- }
-}
diff --git a/test/dcp_to_stl_binary_test.cc b/test/dcp_to_stl_binary_test.cc
deleted file mode 100644
index 450b730..0000000
--- a/test/dcp_to_stl_binary_test.cc
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "test.h"
-#include "dcp_reader.h"
-#include "stl_binary_writer.h"
-#include "collect.h"
-#include <boost/test/unit_test.hpp>
-#include <fstream>
-
-using std::ifstream;
-using std::vector;
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test1)
-{
- if (private_test.empty ()) {
- return;
- }
-
- boost::filesystem::path p = private_test / "fd586c30-6d38-48f2-8241-27359acf184c_sub.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 25,
- sub::LANGUAGE_FRENCH,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/fd586c30-6d38-48f2-8241-27359acf184c_sub.stl"
- );
-
- check_file (
- private_test / "fd586c30-6d38-48f2-8241-27359acf184c_sub.stl",
- "build/test/fd586c30-6d38-48f2-8241-27359acf184c_sub.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test2)
-{
- if (private_test.empty ()) {
- return;
- }
-
- boost::filesystem::path p = private_test / "93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 25,
- sub::LANGUAGE_FRENCH,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.stl"
- );
-
- check_file (
- private_test / "93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.stl",
- "build/test/93e8a6bf-499e-4d36-9350-a9bfa2e6758a_sub.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test3)
-{
- if (private_test.empty ()) {
- return;
- }
-
- boost::filesystem::path p = private_test / "P_FTR_Subs_DE-FR_24fps_R1.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 25,
- sub::LANGUAGE_FRENCH,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/P_FTR_Subs_DE-FR_24fps_R1.stl"
- );
-
- check_file (
- private_test / "P_FTR_Subs_DE-FR_24fps_R1.stl",
- "build/test/P_FTR_Subs_DE-FR_24fps_R1.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test4)
-{
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader("test/data/test1.xml").subtitles()),
- 25,
- sub::LANGUAGE_FRENCH,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/test1.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test5)
-{
- if (private_test.empty ()) {
- return;
- }
-
- boost::filesystem::path p = private_test / "065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.mxf";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 25,
- sub::LANGUAGE_FRENCH,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.stl"
- );
-
- check_file (
- private_test / "065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.stl",
- "build/test/065d39ff-6723-4dbf-a94f-849cde82f5e1_sub.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test6)
-{
- if (private_test.empty ()) {
- return;
- }
-
- boost::filesystem::path p = private_test / "P_FTR_FullSubs_DE_24fps.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 24,
- sub::LANGUAGE_GERMAN,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/P_FTR_FullSubs_DE_24fps.stl"
- );
-
- check_file (
- private_test / "P_FTR_FullSubs_DE_24fps.stl",
- "build/test/P_FTR_FullSubs_DE_24fps.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test7)
-{
- boost::filesystem::path p = "test/data/test3.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 24,
- sub::LANGUAGE_GERMAN,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/test3.stl"
- );
-
- check_file (
- "test/ref/test3.stl",
- "build/test/test3.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test8)
-{
- boost::filesystem::path p = private_test / "91a30f25-b415-4ffe-9623-bdae43a381d3_sub.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 24,
- sub::LANGUAGE_GERMAN,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/91a30f25-b415-4ffe-9623-bdae43a381d3_sub.stl"
- );
-
- check_file (
- private_test / "91a30f25-b415-4ffe-9623-bdae43a381d3_sub.stl",
- "build/test/91a30f25-b415-4ffe-9623-bdae43a381d3_sub.stl"
- );
-}
-
-BOOST_AUTO_TEST_CASE (dcp_to_stl_binary_test9)
-{
- boost::filesystem::path p = private_test / "8b95f204-f2a6-4586-8e67-2dc671a78e72_sub.xml";
- sub::write_stl_binary (
- sub::collect<vector<sub::Subtitle>> (sub::DCPReader(p).subtitles()),
- 24,
- sub::LANGUAGE_GERMAN,
- "", "",
- "", "",
- "", "",
- "300514", "300514", 0,
- "GBR",
- "",
- "", "",
- "build/test/8b95f204-f2a6-4586-8e67-2dc671a78e72_sub.stl"
- );
-
- check_file (
- private_test / "8b95f204-f2a6-4586-8e67-2dc671a78e72_sub.stl",
- "build/test/8b95f204-f2a6-4586-8e67-2dc671a78e72_sub.stl"
- );
-}
diff --git a/test/wscript b/test/wscript
index 4653bd0..348b138 100644
--- a/test/wscript
+++ b/test/wscript
@@ -17,11 +17,9 @@ def configure(conf):
def build(bld):
obj = bld(features='cxx cxxprogram')
obj.name = 'tests'
- obj.uselib = 'BOOST_TEST BOOST_REGEX BOOST_FILESYSTEM DCP CXML ASDCPLIB_CTH'
+ obj.uselib = 'BOOST_TEST BOOST_REGEX BOOST_FILESYSTEM CXML'
obj.use = 'libsub-1.0'
obj.source = """
- dcp_reader_test.cc
- dcp_to_stl_binary_test.cc
iso6937_test.cc
ssa_reader_test.cc
stl_binary_reader_test.cc
diff --git a/tools/wscript b/tools/wscript
index 052d47f..9de44d1 100644
--- a/tools/wscript
+++ b/tools/wscript
@@ -1,6 +1,6 @@
def build(bld):
obj = bld(features='cxx cxxprogram')
obj.use = ['libsub-1.0']
- obj.uselib = 'OPENJPEG DCP CXML ASDCPLIB_CTH BOOST_FILESYSTEM BOOST_REGEX'
+ obj.uselib = 'OPENJPEG CXML BOOST_FILESYSTEM BOOST_REGEX'
obj.source = 'dumpsubs.cc'
obj.target = 'dumpsubs'
diff --git a/wscript b/wscript
index abe8851..ee5e19b 100644
--- a/wscript
+++ b/wscript
@@ -22,7 +22,6 @@ import shlex
from waflib import Context
APPNAME = 'libsub'
-libdcp_version = '1.8.13'
this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
@@ -76,7 +75,7 @@ except ImportError:
def options(opt):
opt.load('compiler_cxx')
opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
- opt.add_option('--static', action='store_true', default=False, help='build libsub statically and link statically to dcp')
+ opt.add_option('--static', action='store_true', default=False, help='build libsub statically')
opt.add_option('--target-windows-64', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package 64-bit')
opt.add_option('--target-windows-32', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package 32-bit')
opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
@@ -112,16 +111,6 @@ def configure(conf):
conf.check_cfg(package='openssl', args='--cflags --libs', uselib_store='OPENSSL', mandatory=True)
- if conf.options.static:
- conf.check_cfg(package='libdcp-1.0', atleast_version=libdcp_version, args='--cflags', uselib_store='DCP', mandatory=True)
- conf.env.HAVE_DCP = 1
- conf.env.STLIB_DCP = ['dcp-1.0', 'asdcp-carl', 'kumu-carl', 'openjp2', 'cxml']
- conf.env.LIB_DCP = ['ssl', 'crypto', 'xmlsec1-openssl', 'xmlsec1', 'glibmm-2.4', 'xml++-2.6', 'xml2', 'dl']
- else:
- conf.check_cfg(package='libdcp-1.0', atleast_version=libdcp_version, args='--cflags --libs', uselib_store='DCP', mandatory=True)
-
- conf.env.DEFINES_DCP = [f.replace('\\', '') for f in conf.env.DEFINES_DCP]
-
boost_lib_suffix = ''
if conf.env.TARGET_WINDOWS_64:
boost_lib_suffix = '-mt-x64'