, _with_subtitles (false)
, _subtitle_offset (0)
, _subtitle_scale (1)
+ , _encrypted (false)
+ , _colour_lut (0)
+ , _j2k_bandwidth (200000000)
, _frames_per_second (0)
, _dirty (false)
{
, _with_subtitles (o._with_subtitles)
, _subtitle_offset (o._subtitle_offset)
, _subtitle_scale (o._subtitle_scale)
+ , _encrypted (o._encrypted)
+ , _colour_lut (o._colour_lut)
+ , _j2k_bandwidth (o._j2k_bandwidth)
, _audio_language (o._audio_language)
, _subtitle_language (o._subtitle_language)
, _territory (o._territory)
f << "with_subtitles " << _with_subtitles << "\n";
f << "subtitle_offset " << _subtitle_offset << "\n";
f << "subtitle_scale " << _subtitle_scale << "\n";
+ f << "encrypted " << _encrypted << "\n";
+ f << "colour_lut " << _colour_lut << "\n";
+ f << "j2k_bandwidth " << _j2k_bandwidth << "\n";
f << "audio_language " << _audio_language << "\n";
f << "subtitle_language " << _subtitle_language << "\n";
f << "territory " << _territory << "\n";
_subtitle_offset = atoi (v.c_str ());
} else if (k == "subtitle_scale") {
_subtitle_scale = atof (v.c_str ());
+ } else if (k == "encrypted") {
+ _encrypted = (v == "1");
+ } else if (k == "colour_lut") {
+ _colour_lut = atoi (v.c_str ());
+ } else if (k == "j2k_bandwidth") {
+ _j2k_bandwidth = atoi (v.c_str ());
} else if (k == "audio_language") {
_audio_language = v;
} else if (k == "subtitle_language") {
signal_changed (SUBTITLE_SCALE);
}
+void
+Film::set_encrypted (bool e)
+{
+ {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ _encrypted = e;
+ }
+ signal_changed (ENCRYPTED);
+}
+
+ void
+ Film::set_colour_lut (int i)
+ {
+ {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ _colour_lut = i;
+ }
+ signal_changed (COLOUR_LUT);
+ }
+
+ void
+ Film::set_j2k_bandwidth (int b)
+ {
+ {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ _j2k_bandwidth = b;
+ }
+ signal_changed (J2K_BANDWIDTH);
+ }
+
void
Film::set_audio_language (string l)
{
class Log;
class ExamineContentJob;
class ExternalAudioStream;
+class Screen;
/** @class Film
- * @brief A representation of a video with sound.
+ * @brief A representation of a video, maybe with sound.
*
- * A representation of a piece of video (with sound), including naming,
+ * A representation of a piece of video (maybe with sound), including naming,
* the source content file, and how it should be presented in a DCP.
*/
class Film : public boost::enable_shared_from_this<Film>
void set_dci_date_today ();
+ void make_kdms (
+ std::list<boost::shared_ptr<Screen> >,
+ boost::posix_time::ptime from,
+ boost::posix_time::ptime until,
+ std::string directory
+ ) const;
+
+ /** Identifiers for the parts of our state;
+ used for signalling changes.
+ */
enum Property {
NONE,
NAME,
WITH_SUBTITLES,
SUBTITLE_OFFSET,
SUBTITLE_SCALE,
+ ENCRYPTED,
+ COLOUR_LUT,
+ J2K_BANDWIDTH,
DCI_METADATA,
SIZE,
LENGTH,
return _subtitle_scale;
}
+ bool encrypted () const {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _encrypted;
+ }
+
+ int colour_lut () const {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _colour_lut;
+ }
+
+ int j2k_bandwidth () const {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _j2k_bandwidth;
+ }
+
std::string audio_language () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _audio_language;
void set_with_subtitles (bool);
void set_subtitle_offset (int);
void set_subtitle_scale (float);
+ void set_encrypted (bool);
+ void set_colour_lut (int);
+ void set_j2k_bandwidth (int);
void set_audio_language (std::string);
void set_subtitle_language (std::string);
void set_territory (std::string);
int _subtitle_offset;
/** scale factor to apply to subtitles */
float _subtitle_scale;
+ bool _encrypted;
+
+ /** index of colour LUT to use when converting RGB to XYZ.
+ * 0: sRGB
+ * 1: Rec 709
+ */
+ int _colour_lut;
+ /** bandwidth for J2K files in bits per second */
+ int _j2k_bandwidth;
+
/* DCI naming stuff */
std::string _audio_language;
std::string _subtitle_language;
dcp.add_cpl (cpl);
- descend (0.8);
- shared_ptr<libdcp::MonoPictureAsset> pa (
- new libdcp::MonoPictureAsset (
- boost::bind (&MakeDCPJob::j2c_path, this, _1),
- _film->dir (_film->dcp_name()),
- "video.mxf",
- &dcp.Progress,
- dfr.frames_per_second,
- frames,
- _opt->out_size.width,
- _opt->out_size.height,
- _film->encrypted ()
- )
- );
-
- ascend ();
+ int frames_per_reel = 0;
+ if (_film->reel_size()) {
+ frames_per_reel = (_film->reel_size().get() / (_film->j2k_bandwidth() / 8)) * dfr.frames_per_second;
+ } else {
+ frames_per_reel = frames;
+ }
- shared_ptr<libdcp::SoundAsset> sa;
+ int frames_done = 0;
+ int reel = 0;
- if (_film->audio_channels() > 0) {
- descend (0.1);
- sa.reset (
- new libdcp::SoundAsset (
- boost::bind (&MakeDCPJob::wav_path, this, _1),
+ while (frames_done < frames) {
+
+ descend (float (frames_per_reel) / frames);
+
+ int this_time = std::min (frames_per_reel, (frames - frames_done));
+
+ descend (0.8);
+
+ shared_ptr<libdcp::MonoPictureAsset> pa (
+ new libdcp::MonoPictureAsset (
+ boost::bind (&MakeDCPJob::j2c_path, this, _1, frames_done),
_film->dir (_film->dcp_name()),
- "audio.mxf",
+ String::compose ("video_%1.mxf", reel),
&dcp.Progress,
dfr.frames_per_second,
- frames,
- dcp_audio_channels (_film->audio_channels()),
+ this_time,
+ _opt->out_size.width,
- _opt->out_size.height
++ _opt->out_size.height,
+ _film->encrypted()
)
);
- dcp_audio_channels (_film->audio_channels())
+
+ ascend ();
+
+ shared_ptr<libdcp::SoundAsset> sa;
+
+ if (_film->audio_channels() > 0) {
+ descend (0.1);
+ sa.reset (
+ new libdcp::SoundAsset (
+ boost::bind (&MakeDCPJob::wav_path, this, _1),
+ _film->dir (_film->dcp_name()),
+ String::compose ("audio_%1.mxf", reel),
+ &dcp.Progress,
+ dfr.frames_per_second,
+ this_time,
+ frames_done,
++ dcp_audio_channels (_film->audio_channels()),
++ _film->encrypted()
+ )
+ );
+ ascend ();
+ }
+
+ descend (0.1);
+ cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (pa, sa, shared_ptr<libdcp::SubtitleAsset> ())));
+ ascend ();
+
+ frames_done += frames_per_reel;
+ ++reel;
+
ascend ();
}
_film_sizer->Add (s);
}
+ _encrypted = new wxCheckBox (_film_panel, wxID_ANY, wxT ("Encrypted"));
+ _film_sizer->Add (_encrypted, 1);
+ _film_sizer->AddSpacer (0);
+
+ _multiple_reels = new wxCheckBox (_film_panel, wxID_ANY, wxT ("Make multiple reels"));
+ _film_sizer->Add (_multiple_reels);
+
+ {
+ wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+ _reel_size = new wxSpinCtrl (_film_panel, wxID_ANY);
+ s->Add (_reel_size);
+ add_label_to_sizer (s, _film_panel, "Gb each");
+ _film_sizer->Add (s);
+ }
+
_dcp_ab = new wxCheckBox (_film_panel, wxID_ANY, wxT ("A/B"));
video_control (_dcp_ab);
_film_sizer->Add (_dcp_ab, 1);
case Film::SUBTITLE_SCALE:
checked_set (_subtitle_scale, _film->subtitle_scale() * 100);
break;
+ case Film::ENCRYPTED:
+ checked_set (_encrypted, _film->encrypted ());
+ break;
+ case Film::COLOUR_LUT:
+ checked_set (_colour_lut, _film->colour_lut ());
+ break;
+ case Film::J2K_BANDWIDTH:
+ checked_set (_j2k_bandwidth, double (_film->j2k_bandwidth()) / 1e6);
+ break;
case Film::USE_DCI_NAME:
checked_set (_use_dci_name, _film->use_dci_name ());
_dcp_name->SetLabel (std_to_wx (_film->dcp_name ()));
film_changed (Film::WITH_SUBTITLES);
film_changed (Film::SUBTITLE_OFFSET);
film_changed (Film::SUBTITLE_SCALE);
+ film_changed (Film::ENCRYPTED);
+ film_changed (Film::COLOUR_LUT);
+ film_changed (Film::J2K_BANDWIDTH);
film_changed (Film::DCI_METADATA);
film_changed (Film::SIZE);
film_changed (Film::LENGTH);
_dcp_content_type->Enable (s);
_dcp_trim_start->Enable (s);
_dcp_trim_end->Enable (s);
+ _multiple_reels->Enable (s);
+ _reel_size->Enable (s);
_dcp_ab->Enable (s);
+ _encrypted->Enable (s);
+ _colour_lut->Enable (s);
+ _j2k_bandwidth->Enable (s);
_audio_gain->Enable (s);
_audio_gain_calculate_button->Enable (s);
_audio_delay->Enable (s);
void format_changed (wxCommandEvent &);
void dcp_trim_start_changed (wxCommandEvent &);
void dcp_trim_end_changed (wxCommandEvent &);
+ void multiple_reels_toggled (wxCommandEvent &);
+ void reel_size_changed (wxCommandEvent &);
void dcp_content_type_changed (wxCommandEvent &);
+ void encrypted_toggled (wxCommandEvent &);
void dcp_ab_toggled (wxCommandEvent &);
void scaler_changed (wxCommandEvent &);
void audio_gain_changed (wxCommandEvent &);
wxSpinCtrl* _dcp_trim_start;
wxSpinCtrl* _dcp_trim_end;
+ wxCheckBox* _encrypted;
+ wxCheckBox* _multiple_reels;
+ wxSpinCtrl* _reel_size;
/** Selector to generate an A/B comparison DCP */
wxCheckBox* _dcp_ab;