#include "screen.h"
#include "audio_content.h"
#include "video_content.h"
-#include "subtitle_content.h"
+#include "text_content.h"
#include "ffmpeg_content.h"
#include "dcp_content.h"
#include "screen_kdm.h"
* VideoFrameType in VideoContent is a string rather than an integer.
* 35 -> 36
* EffectColour rather than OutlineColour in Subtitle.
+ * 36 -> 37
+ * TextContent can be in a Caption tag, and some of the tag names
+ * have had Subtitle prefixes or suffixes removed.
*/
-int const Film::current_state_version = 36;
+int const Film::current_state_version = 37;
/** Construct a Film object in a given directory.
*
d += "_" + dm.audio_language;
if (!dm.subtitle_language.empty()) {
- bool burnt_in = true;
- BOOST_FOREACH (shared_ptr<Content> i, content ()) {
- if (!i->subtitle) {
- continue;
- }
+ /* I'm not clear on the precise details of the convention for CCAP labelling;
+ for now I'm just appending -CCAP if we have any closed captions.
+ */
- if (i->subtitle->use() && !i->subtitle->burn()) {
- burnt_in = false;
+ bool burnt_in = true;
+ bool ccap = false;
+ BOOST_FOREACH (shared_ptr<Content> i, content()) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->caption) {
+ if (j->type() == CAPTION_OPEN && j->use() && !j->burn()) {
+ burnt_in = false;
+ } else if (j->type() == CAPTION_CLOSED) {
+ ccap = true;
+ }
}
}
}
d += "-" + language;
+ if (ccap) {
+ d += "-CCAP";
+ }
} else {
d += "-XX";
}
bool vf = false;
BOOST_FOREACH (shared_ptr<Content> i, content ()) {
shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (i);
- if (dc && (dc->reference_video() || dc->reference_audio() || dc->reference_subtitle())) {
+ if (!dc) {
+ continue;
+ }
+
+ bool any_caption = false;
+ for (int i = 0; i < CAPTION_COUNT; ++i) {
+ if (dc->reference_caption(static_cast<TextType>(i))) {
+ any_caption = true;
+ }
+ }
+ if (dc->reference_video() || dc->reference_audio() || any_caption) {
vf = true;
}
}
{
/* Add {video,subtitle} content after any existing {video,subtitle} content */
if (c->video) {
- c->set_position (_playlist->video_end ());
- } else if (c->subtitle) {
- c->set_position (_playlist->subtitle_end ());
+ c->set_position (_playlist->video_end());
+ } else if (!c->caption.empty()) {
+ c->set_position (_playlist->caption_end());
}
if (_template_film) {
void
Film::set_sequence (bool s)
{
+ if (s == _sequence) {
+ return;
+ }
+
_sequence = s;
_playlist->set_sequence (s);
signal_changed (SEQUENCE);
{
set<string> languages;
- ContentList cl = content ();
- BOOST_FOREACH (shared_ptr<Content>& c, cl) {
- if (c->subtitle) {
- languages.insert (c->subtitle->language ());
+ BOOST_FOREACH (shared_ptr<Content> i, content()) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->caption) {
+ languages.insert (j->language ());
}
}