#include "screen.h"
#include "audio_content.h"
#include "video_content.h"
-#include "subtitle_content.h"
+#include "caption_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
+ * CaptionContent 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.
*
Film::make_dcp ()
{
if (dcp_name().find ("/") != string::npos) {
- throw BadSettingError (_("name"), _("cannot contain slashes"));
+ throw BadSettingError (_("name"), _("Cannot contain slashes"));
}
if (container() == 0) {
}
if (content().empty()) {
- throw runtime_error (_("you must add some content to the DCP before creating it"));
+ throw runtime_error (_("You must add some content to the DCP before creating it"));
}
if (dcp_content_type() == 0) {
}
shared_ptr<const DCPContent> dcp = dynamic_pointer_cast<const DCPContent> (i);
if (dcp && dcp->needs_kdm()) {
- throw runtime_error (_("some of your content needs a KDM"));
+ throw runtime_error (_("Some of your content needs a KDM"));
}
if (dcp && dcp->needs_assets()) {
- throw runtime_error (_("some of your content needs an OV"));
+ throw runtime_error (_("Some of your content needs an OV"));
}
}
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<CaptionContent> 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";
}
/* Count mapped audio channels */
pair<int, int> ch = audio_channel_types (mapped_audio_channels(), audio_channels());
- if (ch.first) {
+ if (!ch.first && !ch.second) {
+ d += "_MOS";
+ } else if (ch.first) {
d += String::compose("_%1%2", ch.first, ch.second);
}
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<CaptionType>(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);
* @param from KDM from time expressed as a local time with an offset from UTC.
* @param until KDM to time expressed as a local time with an offset from UTC.
* @param formulation KDM formulation to use.
+ * @param disable_forensic_marking_picture true to disable forensic marking of picture.
+ * @param disable_forensic_marking_audio if not set, don't disable forensic marking of audio. If set to 0,
+ * disable all forensic marking; if set above 0, disable forensic marking above that channel.
*/
dcp::EncryptedKDM
Film::make_kdm (
boost::filesystem::path cpl_file,
dcp::LocalTime from,
dcp::LocalTime until,
- dcp::Formulation formulation
+ dcp::Formulation formulation,
+ bool disable_forensic_marking_picture,
+ optional<int> disable_forensic_marking_audio
) const
{
if (!_encrypted) {
return dcp::DecryptedKDM (
cpl->id(), keys, from, until, cpl->content_title_text(), cpl->content_title_text(), dcp::LocalTime().as_string()
- ).encrypt (signer, recipient, trusted_devices, formulation);
+ ).encrypt (signer, recipient, trusted_devices, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio);
}
/** @param screens Screens to make KDMs for.
* @param from KDM from time expressed as a local time in the time zone of the Screen's Cinema.
* @param until KDM to time expressed as a local time in the time zone of the Screen's Cinema.
* @param formulation KDM formulation to use.
+ * @param disable_forensic_marking_picture true to disable forensic marking of picture.
+ * @param disable_forensic_marking_audio if not set, don't disable forensic marking of audio. If set to 0,
+ * disable all forensic marking; if set above 0, disable forensic marking above that channel.
*/
list<ScreenKDM>
Film::make_kdms (
boost::filesystem::path cpl_file,
boost::posix_time::ptime from,
boost::posix_time::ptime until,
- dcp::Formulation formulation
+ dcp::Formulation formulation,
+ bool disable_forensic_marking_picture,
+ optional<int> disable_forensic_marking_audio
) const
{
list<ScreenKDM> kdms;
cpl_file,
dcp::LocalTime (from, i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()),
dcp::LocalTime (until, i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()),
- formulation
+ formulation,
+ disable_forensic_marking_picture,
+ disable_forensic_marking_audio
);
kdms.push_back (ScreenKDM (i, kdm));
{
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<CaptionContent> j, i->caption) {
+ languages.insert (j->language ());
}
}
_reel_type = _template_film->_reel_type;
_reel_length = _template_film->_reel_length;
_upload_after_make_dcp = _template_film->_upload_after_make_dcp;
+ _isdcf_metadata = _template_film->_isdcf_metadata;
}
pair<double, double>