+++ /dev/null
-/*
- 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.
-
-*/
-
-namespace sub {
-
-class DCPWriter
-{
-
-
-};
-
-}
using boost::optional;
using namespace sub;
-STLTextWriter::STLTextWriter (list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, ostream& out)
- : Writer (subtitles, screen_height_in_points, frames_per_second)
+void
+sub::write_stl_text (list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, ostream& out)
{
optional<string> font;
optional<int> font_size;
*/
-#include "writer.h"
#include "subtitle.h"
namespace sub {
-class STLTextWriter : public Writer
-{
-public:
- STLTextWriter (std::list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, std::ostream &);
-};
+extern void write_stl_text (std::list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second, std::ostream &);
}
+++ /dev/null
-/*
- 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 <list>
-#include <iostream>
-
-namespace sub {
-
-class Subtitle;
-
-class Writer
-{
-public:
- Writer (std::list<Subtitle> subtitles, int screen_height_in_points, float frames_per_second)
- : _subs (subtitles)
- , _screen_height_in_points (screen_height_in_points)
- , _frames_per_second (frames_per_second)
- {}
-
-protected:
- std::list<Subtitle> _subs;
- int _screen_height_in_points;
- float _frames_per_second;
-};
-
-}
sub::DCPReader r (f);
path const q = path ("build") / path ("test") / path ("fd586c30-6d38-48f2-8241-27359acf184c_sub.stl");
ofstream g (q.c_str ());
- sub::STLTextWriter w (r.subtitles (), 72 * 11, 24, g);
+ sub::write_stl_text (r.subtitles (), 72 * 11, 24, g);
path const c = private_test / "fd586c30-6d38-48f2-8241-27359acf184c_sub.stl";
g.close ();
check_text (q, c);
subs.push_back (make (".", false, false, false, 0, sub::FrameTime (0, 1, 1, 1), sub::FrameTime (0, 1, 2, 10)));
ofstream f ("build/test/test.stl");
- sub::STLTextWriter writer (subs, 24, 72 * 11, f);
+ write_stl_text (subs, 24, 72 * 11, f);
f.close ();
check_text ("test/ref/test.stl", "build/test/test.stl");