#include "text_caption_file_content.h"
#include "util.h"
-#include "plain_text_file.h"
+#include "text_caption_file.h"
#include "film.h"
#include "font.h"
-#include "text_content.h"
+#include "caption_content.h"
#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
#include <iostream>
TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
: Content (film, path)
{
- subtitle.reset (new TextContent (this));
+ caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, CAPTION_OPEN)));
}
TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
: Content (film, node)
, _length (node->number_child<ContentTime::Type> ("Length"))
{
- subtitle = TextContent::from_xml (this, node, version);
+ caption = CaptionContent::from_xml (this, node, version);
}
void
TextCaptionFile s (shared_from_this ());
/* Default to turning these subtitles on */
- subtitle->set_use (true);
+ only_caption()->set_use (true);
boost::mutex::scoped_lock lm (_mutex);
_length = s.length ();
- subtitle->add_font (shared_ptr<Font> (new Font (TEXT_FONT_ID)));
+ only_caption()->add_font (shared_ptr<Font> (new Font (TEXT_FONT_ID)));
}
string
node->add_child("Type")->add_child_text ("TextSubtitle");
Content::as_xml (node, with_paths);
- if (subtitle) {
- subtitle->as_xml (node);
+ if (only_caption()) {
+ only_caption()->as_xml (node);
}
node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));