#include "screen_kdm.h"
#include "cinema.h"
#include "change_signaller.h"
+#include "check_content_change_job.h"
#include <libcxml/cxml.h>
#include <dcp/cpl.h>
#include <dcp/certificate_chain.h>
shared_ptr<TranscodeJob> tj (new TranscodeJob (shared_from_this()));
tj->set_encoder (shared_ptr<Encoder> (new DCPEncoder (shared_from_this(), tj)));
- JobManager::instance()->add (tj);
+ shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob (shared_from_this(), tj));
+ JobManager::instance()->add (cc);
}
/** Start a job to send our DCP to the configured TMS */
if (type == CHANGE_TYPE_DONE) {
_dirty = true;
- switch (p) {
- case Film::CONTENT:
+ if (p == Film::CONTENT) {
set_video_frame_rate (_playlist->best_video_frame_rate ());
- break;
- case Film::VIDEO_FRAME_RATE:
- case Film::SEQUENCE:
- _playlist->maybe_sequence ();
- break;
- default:
- break;
}
emit (boost::bind (boost::ref (Change), type, p));
+
+ if (p == Film::VIDEO_FRAME_RATE || p == Film::SEQUENCE) {
+ /* We want to call Playlist::maybe_sequence but this must happen after the
+ main signal emission (since the butler will see that emission and un-suspend itself).
+ Doing it this way ensures that the Change signal above is emitted first.
+ */
+ signal_manager->when_idle (boost::bind(&Playlist::maybe_sequence, _playlist.get()));
+ }
} else {
Change (type, p);
}
return false;
}
+
+list<DCPTextTrack>
+Film::closed_caption_tracks () const
+{
+ list<DCPTextTrack> tt;
+ BOOST_FOREACH (shared_ptr<Content> i, content()) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
+ /* XXX: Empty DCPTextTrack ends up being a magic value here */
+ DCPTextTrack dtt = j->dcp_track().get_value_or(DCPTextTrack());
+ if (j->type() == TEXT_CLOSED_CAPTION && find(tt.begin(), tt.end(), dtt) == tt.end()) {
+ tt.push_back (dtt);
+ }
+ }
+ }
+
+ return tt;
+}