/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2016 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
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <vector>
+#include <iostream>
-using std::list;
using std::ostream;
using std::istream;
using std::string;
STLTextReader::STLTextReader (istream& in)
{
+ /* This reader extracts no information about where the subtitle
+ should be on screen, so its reference is TOP_OF_SUBTITLE.
+ */
_subtitle.vertical_position.line = 0;
- /* XXX: no idea what this should be */
- _subtitle.vertical_position.lines = 32;
- _subtitle.vertical_position.reference = TOP_OF_SCREEN;
-
+ _subtitle.vertical_position.reference = TOP_OF_SUBTITLE;
+
while (in.good ()) {
string line;
getline (in, line);
if (divider[0] != string::npos) {
divider[1] = line.find_first_of (",", divider[0] + 1);
}
-
+
if (divider[0] == string::npos || divider[1] == string::npos || divider[0] <= 1 || divider[1] >= line.length() - 1) {
warn (String::compose ("Unrecognised line %1", line));
continue;