/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ 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
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/locale.hpp>
+#include <iostream>
using std::map;
using std::vector;
editor_contact_details = get_string (341, 32);
for (int i = 0; i < tti_blocks; ++i) {
-
+
in.read ((char *) _buffer, 128);
if (in.gcount() != 128) {
throw STLError ("Could not read TTI block from binary STL file");
for (size_t i = 0; i < lines.size(); ++i) {
RawSubtitle sub;
- sub.from.set_frame (get_timecode (5));
- sub.to.set_frame (get_timecode (9));
+ sub.from = get_timecode (5);
+ sub.to = get_timecode (9);
sub.vertical_position.line = get_int (13, 1) + i;
+ sub.vertical_position.lines = maximum_rows;
sub.vertical_position.reference = TOP_OF_SCREEN;
string text;
sub.text = utf_to_utf<char> (iso6937_to_utf16 (text.c_str()));
_subs.push_back (sub);
}
-
+
/* XXX: justification */
}
}
return v;
}
-FrameTime
+Time
STLBinaryReader::get_timecode (int offset) const
{
- return FrameTime (_buffer[offset], _buffer[offset + 1], _buffer[offset + 2], _buffer[offset + 3]);
+ return Time::from_hmsf (_buffer[offset], _buffer[offset + 1], _buffer[offset + 2], _buffer[offset + 3], Rational (frame_rate, 1));
}
map<string, string>