_samples_per_point = max (int64_t (1), _film->time_to_audio_frames (_film->length()) / _num_points);
- _current.resize (_film->dcp_audio_channels ());
- _analysis.reset (new AudioAnalysis (_film->dcp_audio_channels ()));
+ _current.resize (_film->audio_channels ());
+ _analysis.reset (new AudioAnalysis (_film->audio_channels ()));
_done = 0;
while (!player->pass ()) {
return film->audio_analysis_path (dynamic_pointer_cast<const AudioContent> (shared_from_this ()));
}
+
+string
+AudioContent::technical_summary () const
+{
+ return String::compose ("audio: channels %1, length %2, raw rate %3, out rate %4", audio_channels(), audio_length(), content_audio_frame_rate(), output_audio_frame_rate());
+}
AudioContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
void as_xml (xmlpp::Node *) const;
+ std::string technical_summary () const;
virtual int audio_channels () const = 0;
virtual AudioContent::Frame audio_length () const = 0;
as_xml (node);
return content_factory (film, shared_ptr<cxml::Node> (new cxml::Node (node)));
}
+
+string
+Content::technical_summary () const
+{
+ return String::compose ("%1 %2 %3", file(), digest(), start());
+}
virtual void examine (boost::shared_ptr<Job>);
virtual std::string summary () const = 0;
+ virtual std::string technical_summary () const;
virtual std::string information () const = 0;
virtual void as_xml (xmlpp::Node *) const;
virtual Time length () const = 0;
TIMING ("adding to queue of %1", _queue.size ());
_queue.push_back (shared_ptr<DCPVideoFrame> (
new DCPVideoFrame (
- image, _video_frames_out, eyes, _film->dcp_video_frame_rate(),
+ image, _video_frames_out, eyes, _film->video_frame_rate(),
_film->j2k_bandwidth(), _film->log()
)
));
using std::vector;
using std::list;
using std::cout;
+using std::pair;
using boost::shared_ptr;
using boost::lexical_cast;
return String::compose (_("%1 [movie]"), file().filename().string());
}
+string
+FFmpegContent::technical_summary () const
+{
+ string as = "none";
+ if (_audio_stream) {
+ as = String::compose ("id %1", _audio_stream->id);
+ }
+
+ string ss = "none";
+ if (_subtitle_stream) {
+ ss = String::compose ("id %1", _subtitle_stream->id);
+ }
+
+ pair<string, string> filt = Filter::ffmpeg_strings (_filters);
+
+ return Content::technical_summary() + " - "
+ + VideoContent::technical_summary() + " - "
+ + String::compose (
+ "ffmpeg: audio %1, subtitle %2, filters %3 %4", as, ss, filt.first, filt.second
+ );
+}
+
string
FFmpegContent::information () const
{
/* Resample to a DCI-approved sample rate */
double t = dcp_audio_frame_rate (content_audio_frame_rate ());
- FrameRateConversion frc (video_frame_rate(), film->dcp_video_frame_rate());
+ FrameRateConversion frc (video_frame_rate(), film->video_frame_rate());
/* Compensate if the DCP is being run at a different frame rate
to the source; that is, if the video is run such that it will
*/
if (frc.change_speed) {
- t *= video_frame_rate() * frc.factor() / film->dcp_video_frame_rate();
+ t *= video_frame_rate() * frc.factor() / film->video_frame_rate();
}
return rint (t);
shared_ptr<const Film> film = _film.lock ();
assert (film);
- FrameRateConversion frc (video_frame_rate (), film->dcp_video_frame_rate ());
- return video_length() * frc.factor() * TIME_HZ / film->dcp_video_frame_rate ();
+ FrameRateConversion frc (video_frame_rate (), film->video_frame_rate ());
+ return video_length() * frc.factor() * TIME_HZ / film->video_frame_rate ();
}
AudioMapping
return s.str ();
}
+
void examine (boost::shared_ptr<Job>);
std::string summary () const;
+ std::string technical_summary () const;
std::string information () const;
void as_xml (xmlpp::Node *) const;
Time length () const;
, _with_subtitles (false)
, _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ())
, _dci_metadata (Config::instance()->default_dci_metadata ())
- , _dcp_video_frame_rate (24)
- , _dcp_audio_channels (MAX_AUDIO_CHANNELS)
- , _dcp_3d (false)
+ , _video_frame_rate (24)
+ , _audio_channels (MAX_AUDIO_CHANNELS)
+ , _three_d (false)
, _sequence_video (true)
, _dirty (false)
{
s << container()->id()
<< "_" << resolution_to_string (_resolution)
<< "_" << _playlist->video_identifier()
- << "_" << _dcp_video_frame_rate
+ << "_" << _video_frame_rate
<< "_" << scaler()->id()
<< "_" << j2k_bandwidth();
- if (_dcp_3d) {
+ if (_three_d) {
s << "_3D";
}
}
string
-Film::dcp_video_mxf_filename () const
+Film::video_mxf_filename () const
{
return filename_safe_name() + "_video.mxf";
}
string
-Film::dcp_audio_mxf_filename () const
+Film::audio_mxf_filename () const
{
return filename_safe_name() + "_audio.mxf";
}
gethostname (buffer, sizeof (buffer));
log()->log (String::compose ("Starting to make DCP on %1", buffer));
}
-
-// log()->log (String::compose ("Content is %1; type %2", content_path(), (content_type() == STILL ? _("still") : _("video"))));
-// if (length()) {
-// log()->log (String::compose ("Content length %1", length().get()));
-// }
-// log()->log (String::compose ("Content digest %1", content_digest()));
-// log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate()));
+
+ ContentList cl = content ();
+ for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) {
+ log()->log (String::compose ("Content: %1", (*i)->technical_summary()));
+ }
+ log()->log (String::compose ("DCP video rate %2 fps", video_frame_rate()));
log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads()));
log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth()));
#ifdef DCPOMATIC_DEBUG
root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0");
root->add_child("J2KBandwidth")->add_child_text (lexical_cast<string> (_j2k_bandwidth));
_dci_metadata.as_xml (root->add_child ("DCIMetadata"));
- root->add_child("DCPVideoFrameRate")->add_child_text (lexical_cast<string> (_dcp_video_frame_rate));
+ root->add_child("VideoFrameRate")->add_child_text (lexical_cast<string> (_video_frame_rate));
root->add_child("DCIDate")->add_child_text (boost::gregorian::to_iso_string (_dci_date));
- root->add_child("DCPAudioChannels")->add_child_text (lexical_cast<string> (_dcp_audio_channels));
- root->add_child("DCP3D")->add_child_text (_dcp_3d ? "1" : "0");
+ root->add_child("AudioChannels")->add_child_text (lexical_cast<string> (_audio_channels));
+ root->add_child("3D")->add_child_text (_three_d ? "1" : "0");
root->add_child("SequenceVideo")->add_child_text (_sequence_video ? "1" : "0");
_playlist->as_xml (root->add_child ("Playlist"));
_with_subtitles = f.bool_child ("WithSubtitles");
_j2k_bandwidth = f.number_child<int> ("J2KBandwidth");
_dci_metadata = DCIMetadata (f.node_child ("DCIMetadata"));
- _dcp_video_frame_rate = f.number_child<int> ("DCPVideoFrameRate");
+ _video_frame_rate = f.number_child<int> ("VideoFrameRate");
_dci_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
- _dcp_audio_channels = f.number_child<int> ("DCPAudioChannels");
+ _audio_channels = f.number_child<int> ("AudioChannels");
_sequence_video = f.bool_child ("SequenceVideo");
- _dcp_3d = f.bool_child ("DCP3D");
+ _three_d = f.bool_child ("3D");
_playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"));
d << "_" << dcp_content_type()->dci_name();
}
- if (dcp_3d ()) {
+ if (three_d ()) {
d << "-3D";
}
- if (dcp_video_frame_rate() != 24) {
- d << "-" << dcp_video_frame_rate();
+ if (video_frame_rate() != 24) {
+ d << "-" << video_frame_rate();
}
if (container()) {
}
}
- switch (dcp_audio_channels ()) {
+ switch (audio_channels ()) {
case 1:
d << "_10";
break;
}
void
-Film::set_dcp_video_frame_rate (int f)
+Film::set_video_frame_rate (int f)
{
{
boost::mutex::scoped_lock lm (_state_mutex);
- _dcp_video_frame_rate = f;
+ _video_frame_rate = f;
}
- signal_changed (DCP_VIDEO_FRAME_RATE);
+ signal_changed (VIDEO_FRAME_RATE);
}
void
-Film::set_dcp_audio_channels (int c)
+Film::set_audio_channels (int c)
{
{
boost::mutex::scoped_lock lm (_state_mutex);
- _dcp_audio_channels = c;
+ _audio_channels = c;
}
- signal_changed (DCP_AUDIO_CHANNELS);
+ signal_changed (AUDIO_CHANNELS);
}
void
-Film::set_dcp_3d (bool t)
+Film::set_three_d (bool t)
{
{
boost::mutex::scoped_lock lm (_state_mutex);
- _dcp_3d = t;
+ _three_d = t;
}
- signal_changed (DCP_3D);
+ signal_changed (THREE_D);
}
void
switch (p) {
case Film::CONTENT:
- set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
+ set_video_frame_rate (_playlist->best_dcp_frame_rate ());
break;
- case Film::DCP_VIDEO_FRAME_RATE:
+ case Film::VIDEO_FRAME_RATE:
case Film::SEQUENCE_VIDEO:
_playlist->maybe_sequence_video ();
break;
}
OutputVideoFrame
-Film::best_dcp_video_frame_rate () const
+Film::best_video_frame_rate () const
{
return _playlist->best_dcp_frame_rate ();
}
Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
{
if (p == VideoContentProperty::VIDEO_FRAME_RATE) {
- set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ());
+ set_video_frame_rate (_playlist->best_dcp_frame_rate ());
}
if (ui_signaller) {
OutputAudioFrame
Film::time_to_audio_frames (Time t) const
{
- return t * dcp_audio_frame_rate () / TIME_HZ;
+ return t * audio_frame_rate () / TIME_HZ;
}
OutputVideoFrame
Film::time_to_video_frames (Time t) const
{
- return t * dcp_video_frame_rate () / TIME_HZ;
+ return t * video_frame_rate () / TIME_HZ;
}
Time
Film::audio_frames_to_time (OutputAudioFrame f) const
{
- return f * TIME_HZ / dcp_audio_frame_rate ();
+ return f * TIME_HZ / audio_frame_rate ();
}
Time
Film::video_frames_to_time (OutputVideoFrame f) const
{
- return f * TIME_HZ / dcp_video_frame_rate ();
+ return f * TIME_HZ / video_frame_rate ();
}
OutputAudioFrame
-Film::dcp_audio_frame_rate () const
+Film::audio_frame_rate () const
{
/* XXX */
return 48000;
std::string internal_video_mxf_filename () const;
boost::filesystem::path audio_analysis_path (boost::shared_ptr<const AudioContent>) const;
- std::string dcp_video_mxf_filename () const;
- std::string dcp_audio_mxf_filename () const;
+ std::string video_mxf_filename () const;
+ std::string audio_mxf_filename () const;
void send_dcp_to_tms ();
void make_dcp ();
boost::shared_ptr<Player> make_player () const;
boost::shared_ptr<Playlist> playlist () const;
- OutputAudioFrame dcp_audio_frame_rate () const;
+ OutputAudioFrame audio_frame_rate () const;
OutputAudioFrame time_to_audio_frames (Time) const;
OutputVideoFrame time_to_video_frames (Time) const;
Time length () const;
bool has_subtitles () const;
- OutputVideoFrame best_dcp_video_frame_rate () const;
+ OutputVideoFrame best_video_frame_rate () const;
/** Identifiers for the parts of our state;
used for signalling changes.
WITH_SUBTITLES,
J2K_BANDWIDTH,
DCI_METADATA,
- DCP_VIDEO_FRAME_RATE,
- DCP_AUDIO_CHANNELS,
- /** The setting of _dcp_3d has been changed */
- DCP_3D,
+ VIDEO_FRAME_RATE,
+ AUDIO_CHANNELS,
+ /** The setting of _three_d has been changed */
+ THREE_D,
SEQUENCE_VIDEO,
};
return _dci_metadata;
}
- /* XXX: -> "video_frame_rate" */
- int dcp_video_frame_rate () const {
+ /** @return The frame rate of the DCP */
+ int video_frame_rate () const {
boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_video_frame_rate;
+ return _video_frame_rate;
}
- int dcp_audio_channels () const {
+ int audio_channels () const {
boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_audio_channels;
+ return _audio_channels;
}
- bool dcp_3d () const {
+ bool three_d () const {
boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_3d;
+ return _three_d;
}
bool sequence_video () const {
void set_with_subtitles (bool);
void set_j2k_bandwidth (int);
void set_dci_metadata (DCIMetadata);
- void set_dcp_video_frame_rate (int);
- void set_dcp_audio_channels (int);
- void set_dcp_3d (bool);
+ void set_video_frame_rate (int);
+ void set_audio_channels (int);
+ void set_three_d (bool);
void set_dci_date_today ();
void set_sequence_video (bool);
/** DCI naming stuff */
DCIMetadata _dci_metadata;
/** Frames per second to run our DCP at */
- int _dcp_video_frame_rate;
+ int _video_frame_rate;
/** The date that we should use in a DCI name */
boost::gregorian::date _dci_date;
- int _dcp_audio_channels;
+ /** Number of audio channels to put in the DCP */
+ int _audio_channels;
/** If true, the DCP will be written in 3D mode; otherwise in 2D.
This will be regardless of what content is on the playlist.
*/
- bool _dcp_3d;
+ bool _three_d;
bool _sequence_video;
/** true if our state has changed since we last saved it */
, _have_valid_pieces (false)
, _video_position (0)
, _audio_position (0)
- , _audio_buffers (f->dcp_audio_channels(), 0)
+ , _audio_buffers (f->audio_channels(), 0)
{
_playlist->Changed.connect (bind (&Player::playlist_changed, this));
_playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
shared_ptr<VideoContent> content = dynamic_pointer_cast<VideoContent> (piece->content);
assert (content);
- FrameRateConversion frc (content->video_frame_rate(), _film->dcp_video_frame_rate());
+ FrameRateConversion frc (content->video_frame_rate(), _film->video_frame_rate());
if (frc.skip && (frame % 2) == 1) {
return;
}
work_image = work_image->scale_and_convert_to_rgb (image_size, _film->scaler(), true);
- Time time = content->start() + (frame * frc.factor() * TIME_HZ / _film->dcp_video_frame_rate());
+ Time time = content->start() + (frame * frc.factor() * TIME_HZ / _film->video_frame_rate());
if (_film->with_subtitles () && _out_subtitle.image && time >= _out_subtitle.from && time <= _out_subtitle.to) {
work_image->alpha_blend (_out_subtitle.image, _out_subtitle.position);
#endif
Video (work_image, eyes, same, time);
- time += TIME_HZ / _film->dcp_video_frame_rate();
+ time += TIME_HZ / _film->video_frame_rate();
if (frc.repeat) {
Video (work_image, eyes, true, time);
- time += TIME_HZ / _film->dcp_video_frame_rate();
+ time += TIME_HZ / _film->video_frame_rate();
}
_video_position = piece->video_position = time;
}
/* Remap channels */
- shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->dcp_audio_channels(), audio->frames()));
+ shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->audio_channels(), audio->frames()));
dcp_mapped->make_silent ();
list<pair<int, libdcp::Channel> > map = content->audio_mapping().content_to_dcp ();
for (list<pair<int, libdcp::Channel> >::iterator i = map.begin(); i != map.end(); ++i) {
audio = dcp_mapped;
- Time time = content->start() + (frame * TIME_HZ / _film->dcp_audio_frame_rate()) + (content->audio_delay() * TIME_HZ / 1000);
+ Time time = content->start() + (frame * TIME_HZ / _film->audio_frame_rate()) + (content->audio_delay() * TIME_HZ / 1000);
/* We must cut off anything that comes before the start of all time */
if (time < 0) {
- int const frames = - time * _film->dcp_audio_frame_rate() / TIME_HZ;
+ int const frames = - time * _film->audio_frame_rate() / TIME_HZ;
if (frames >= audio->frames ()) {
return;
}
(*i)->video_position = (*i)->audio_position = vc->start() + s;
- FrameRateConversion frc (vc->video_frame_rate(), _film->dcp_video_frame_rate());
+ FrameRateConversion frc (vc->video_frame_rate(), _film->video_frame_rate());
/* Here we are converting from time (in the DCP) to a frame number in the content.
Hence we need to use the DCP's frame rate and the double/skip correction, not
the source's rate.
*/
- VideoContent::Frame f = s * _film->dcp_video_frame_rate() / (frc.factor() * TIME_HZ);
+ VideoContent::Frame f = s * _film->video_frame_rate() / (frc.factor() * TIME_HZ);
dynamic_pointer_cast<VideoDecoder>((*i)->decoder)->seek (f, accurate);
}
void
Player::emit_silence (OutputAudioFrame most)
{
- OutputAudioFrame N = min (most, _film->dcp_audio_frame_rate() / 2);
- shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->dcp_audio_channels(), N));
+ OutputAudioFrame N = min (most, _film->audio_frame_rate() / 2);
+ shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->audio_channels(), N));
silence->make_silent ();
Audio (silence, _audio_position);
_audio_position += _film->audio_frames_to_time (N);
return String::compose (_("%1 [audio]"), file().filename().string());
}
+string
+SndfileContent::technical_summary () const
+{
+ return Content::technical_summary() + " - "
+ + AudioContent::technical_summary ()
+ + "sndfile";
+}
+
string
SndfileContent::information () const
{
shared_ptr<const Film> film = _film.lock ();
assert (film);
- return film->dcp_audio_frame_rate ();
+ return film->audio_frame_rate ();
}
void
void examine (boost::shared_ptr<Job>);
std::string summary () const;
+ std::string technical_summary () const;
std::string information () const;
void as_xml (xmlpp::Node *) const;
Time length () const;
return String::compose (_("%1 [still]"), file().filename().string());
}
+string
+StillImageContent::technical_summary () const
+{
+ return Content::technical_summary() + " - "
+ + VideoContent::technical_summary() + " - "
+ + "still";
+}
+
bool
StillImageContent::valid_file (boost::filesystem::path f)
{
shared_ptr<const Film> film = _film.lock ();
assert (film);
- FrameRateConversion frc (video_frame_rate(), film->dcp_video_frame_rate ());
+ FrameRateConversion frc (video_frame_rate(), film->video_frame_rate ());
return video_length() * frc.factor() * TIME_HZ / video_frame_rate();
}
void examine (boost::shared_ptr<Job>);
std::string summary () const;
+ std::string technical_summary () const;
void as_xml (xmlpp::Node *) const;
Time length () const;
return 24;
}
- return f->dcp_video_frame_rate ();
+ return f->video_frame_rate ();
}
signal_changed (VideoContentProperty::VIDEO_FRAME_TYPE);
}
+
+string
+VideoContent::technical_summary () const
+{
+ return String::compose ("video: length %1, size %2x%3, rate %4", video_length(), video_size().width, video_size().height, video_frame_rate());
+}
VideoContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
void as_xml (xmlpp::Node *) const;
+ std::string technical_summary () const;
virtual std::string information () const;
virtual std::string identifier () const;
it into the DCP later.
*/
- if (f->dcp_3d ()) {
+ if (f->three_d ()) {
_picture_asset.reset (
new libdcp::StereoPictureAsset (
_film->internal_video_mxf_dir (),
_film->internal_video_mxf_filename (),
- _film->dcp_video_frame_rate (),
+ _film->video_frame_rate (),
_film->container()->size (_film->full_frame ())
)
);
new libdcp::MonoPictureAsset (
_film->internal_video_mxf_dir (),
_film->internal_video_mxf_filename (),
- _film->dcp_video_frame_rate (),
+ _film->video_frame_rate (),
_film->container()->size (_film->full_frame ())
)
);
_sound_asset.reset (
new libdcp::SoundAsset (
_film->dir (_film->dcp_name()),
- _film->dcp_audio_mxf_filename (),
- _film->dcp_video_frame_rate (),
- _film->dcp_audio_channels (),
- _film->dcp_audio_frame_rate ()
+ _film->audio_mxf_filename (),
+ _film->video_frame_rate (),
+ _film->audio_channels (),
+ _film->audio_frame_rate ()
)
);
qi.encoded = encoded;
qi.frame = frame;
- if (_film->dcp_3d() && eyes == EYES_BOTH) {
+ if (_film->three_d() && eyes == EYES_BOTH) {
/* 2D material in a 3D DCP; fake the 3D */
qi.eyes = EYES_LEFT;
_queue.push_back (qi);
boost::filesystem::path to;
to /= _film->dir (_film->dcp_name());
- to /= _film->dcp_video_mxf_filename ();
+ to /= _film->video_mxf_filename ();
boost::system::error_code ec;
boost::filesystem::create_hard_link (from, to, ec);
/* And update the asset */
_picture_asset->set_directory (_film->dir (_film->dcp_name ()));
- _picture_asset->set_file_name (_film->dcp_video_mxf_filename ());
+ _picture_asset->set_file_name (_film->video_mxf_filename ());
_sound_asset->set_duration (frames);
libdcp::DCP dcp (_film->dir (_film->dcp_name()));
_film->dcp_name(),
_film->dcp_content_type()->libdcp_kind (),
frames,
- _film->dcp_video_frame_rate ()
+ _film->video_frame_rate ()
)
);
while (1) {
- if (_film->dcp_3d ()) {
+ if (_film->three_d ()) {
if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_LEFT)) {
break;
}
AudioPanel::film_changed (Film::Property property)
{
switch (property) {
- case Film::DCP_AUDIO_CHANNELS:
- _mapping->set_channels (_editor->film()->dcp_audio_channels ());
+ case Film::AUDIO_CHANNELS:
+ _mapping->set_channels (_editor->film()->audio_channels ());
_sizer->Layout ();
break;
default:
{
add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Frame Rate"), true, wxGBPosition (r, 0));
wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
- _dcp_frame_rate = new wxChoice (_dcp_panel, wxID_ANY);
- s->Add (_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
- _best_dcp_frame_rate = new wxButton (_dcp_panel, wxID_ANY, _("Use best"));
- s->Add (_best_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND);
+ _frame_rate = new wxChoice (_dcp_panel, wxID_ANY);
+ s->Add (_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
+ _best_frame_rate = new wxButton (_dcp_panel, wxID_ANY, _("Use best"));
+ s->Add (_best_frame_rate, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND);
grid->Add (s, wxGBPosition (r, 1));
}
++r;
add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Audio channels"), true, wxGBPosition (r, 0));
- _dcp_audio_channels = new wxSpinCtrl (_dcp_panel, wxID_ANY);
- grid->Add (_dcp_audio_channels, wxGBPosition (r, 1));
+ _audio_channels = new wxSpinCtrl (_dcp_panel, wxID_ANY);
+ grid->Add (_audio_channels, wxGBPosition (r, 1));
++r;
- _dcp_3d = new wxCheckBox (_dcp_panel, wxID_ANY, _("3D"));
- grid->Add (_dcp_3d, wxGBPosition (r, 0), wxGBSpan (1, 2));
+ _three_d = new wxCheckBox (_dcp_panel, wxID_ANY, _("3D"));
+ grid->Add (_three_d, wxGBPosition (r, 0), wxGBSpan (1, 2));
++r;
add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Resolution"), true, wxGBPosition (r, 0));
- _dcp_resolution = new wxChoice (_dcp_panel, wxID_ANY);
- grid->Add (_dcp_resolution, wxGBPosition (r, 1));
+ _resolution = new wxChoice (_dcp_panel, wxID_ANY);
+ grid->Add (_resolution, wxGBPosition (r, 1));
++r;
{
list<int> const dfr = Config::instance()->allowed_dcp_frame_rates ();
for (list<int>::const_iterator i = dfr.begin(); i != dfr.end(); ++i) {
- _dcp_frame_rate->Append (std_to_wx (boost::lexical_cast<string> (*i)));
+ _frame_rate->Append (std_to_wx (boost::lexical_cast<string> (*i)));
}
- _dcp_audio_channels->SetRange (0, MAX_AUDIO_CHANNELS);
+ _audio_channels->SetRange (0, MAX_AUDIO_CHANNELS);
_j2k_bandwidth->SetRange (50, 250);
- _dcp_resolution->Append (_("2K"));
- _dcp_resolution->Append (_("4K"));
+ _resolution->Append (_("2K"));
+ _resolution->Append (_("4K"));
}
void
_content_timeline->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_timeline_clicked), 0, this);
_scaler->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::scaler_changed), 0, this);
_dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this);
- _dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_frame_rate_changed), 0, this);
- _best_dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::best_dcp_frame_rate_clicked), 0, this);
- _dcp_audio_channels->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::dcp_audio_channels_changed), 0, this);
+ _frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::frame_rate_changed), 0, this);
+ _best_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::best_frame_rate_clicked), 0, this);
+ _audio_channels->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_channels_changed), 0, this);
_j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this);
- _dcp_resolution->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_resolution_changed), 0, this);
+ _resolution->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::resolution_changed), 0, this);
_sequence_video->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::sequence_video_changed), 0, this);
- _dcp_3d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::dcp_3d_changed, this));
+ _three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::three_d_changed, this));
}
void
}
void
-FilmEditor::dcp_frame_rate_changed (wxCommandEvent &)
+FilmEditor::frame_rate_changed (wxCommandEvent &)
{
if (!_film) {
return;
}
- _film->set_dcp_video_frame_rate (
+ _film->set_video_frame_rate (
boost::lexical_cast<int> (
- wx_to_std (_dcp_frame_rate->GetString (_dcp_frame_rate->GetSelection ()))
+ wx_to_std (_frame_rate->GetString (_frame_rate->GetSelection ()))
)
);
}
void
-FilmEditor::dcp_audio_channels_changed (wxCommandEvent &)
+FilmEditor::audio_channels_changed (wxCommandEvent &)
{
if (!_film) {
return;
}
- _film->set_dcp_audio_channels (_dcp_audio_channels->GetValue ());
+ _film->set_audio_channels (_audio_channels->GetValue ());
}
void
-FilmEditor::dcp_resolution_changed (wxCommandEvent &)
+FilmEditor::resolution_changed (wxCommandEvent &)
{
if (!_film) {
return;
}
- _film->set_resolution (_dcp_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K);
+ _film->set_resolution (_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K);
}
checked_set (_scaler, Scaler::as_index (_film->scaler ()));
break;
case Film::RESOLUTION:
- checked_set (_dcp_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1);
+ checked_set (_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1);
setup_dcp_name ();
break;
case Film::J2K_BANDWIDTH:
case Film::DCI_METADATA:
setup_dcp_name ();
break;
- case Film::DCP_VIDEO_FRAME_RATE:
+ case Film::VIDEO_FRAME_RATE:
{
bool done = false;
- for (unsigned int i = 0; i < _dcp_frame_rate->GetCount(); ++i) {
- if (wx_to_std (_dcp_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->dcp_video_frame_rate())) {
- checked_set (_dcp_frame_rate, i);
+ for (unsigned int i = 0; i < _frame_rate->GetCount(); ++i) {
+ if (wx_to_std (_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->video_frame_rate())) {
+ checked_set (_frame_rate, i);
done = true;
break;
}
}
if (!done) {
- checked_set (_dcp_frame_rate, -1);
+ checked_set (_frame_rate, -1);
}
- _best_dcp_frame_rate->Enable (_film->best_dcp_video_frame_rate () != _film->dcp_video_frame_rate ());
+ _best_frame_rate->Enable (_film->best_video_frame_rate () != _film->video_frame_rate ());
break;
}
- case Film::DCP_AUDIO_CHANNELS:
- _dcp_audio_channels->SetValue (_film->dcp_audio_channels ());
+ case Film::AUDIO_CHANNELS:
+ _audio_channels->SetValue (_film->audio_channels ());
setup_dcp_name ();
break;
case Film::SEQUENCE_VIDEO:
checked_set (_sequence_video, _film->sequence_video ());
break;
- case Film::DCP_3D:
- checked_set (_dcp_3d, _film->dcp_3d ());
+ case Film::THREE_D:
+ checked_set (_three_d, _film->three_d ());
break;
}
}
film_changed (Film::WITH_SUBTITLES);
film_changed (Film::J2K_BANDWIDTH);
film_changed (Film::DCI_METADATA);
- film_changed (Film::DCP_VIDEO_FRAME_RATE);
- film_changed (Film::DCP_AUDIO_CHANNELS);
+ film_changed (Film::VIDEO_FRAME_RATE);
+ film_changed (Film::AUDIO_CHANNELS);
film_changed (Film::SEQUENCE_VIDEO);
- film_changed (Film::DCP_3D);
+ film_changed (Film::THREE_D);
if (!_film->content().empty ()) {
set_selection (_film->content().front ());
_content_remove->Enable (s);
_content_timeline->Enable (s);
_dcp_content_type->Enable (s);
- _dcp_frame_rate->Enable (s);
- _dcp_audio_channels->Enable (s);
+ _frame_rate->Enable (s);
+ _audio_channels->Enable (s);
_j2k_bandwidth->Enable (s);
_container->Enable (s);
- _best_dcp_frame_rate->Enable (s && _film && _film->best_dcp_video_frame_rate () != _film->dcp_video_frame_rate ());
+ _best_frame_rate->Enable (s && _film && _film->best_video_frame_rate () != _film->video_frame_rate ());
_sequence_video->Enable (s);
- _dcp_resolution->Enable (s);
+ _resolution->Enable (s);
_scaler->Enable (s);
- _dcp_3d->Enable (s);
+ _three_d->Enable (s);
/* Set the panels in the content notebook */
for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
}
void
-FilmEditor::best_dcp_frame_rate_clicked (wxCommandEvent &)
+FilmEditor::best_frame_rate_clicked (wxCommandEvent &)
{
if (!_film) {
return;
}
- _film->set_dcp_video_frame_rate (_film->best_dcp_video_frame_rate ());
+ _film->set_video_frame_rate (_film->best_video_frame_rate ());
}
void
}
void
-FilmEditor::dcp_3d_changed ()
+FilmEditor::three_d_changed ()
{
if (!_film) {
return;
}
- _film->set_dcp_3d (_dcp_3d->GetValue ());
+ _film->set_three_d (_three_d->GetValue ());
}
void dcp_content_type_changed (wxCommandEvent &);
void scaler_changed (wxCommandEvent &);
void j2k_bandwidth_changed (wxCommandEvent &);
- void dcp_frame_rate_changed (wxCommandEvent &);
- void best_dcp_frame_rate_clicked (wxCommandEvent &);
+ void frame_rate_changed (wxCommandEvent &);
+ void best_frame_rate_clicked (wxCommandEvent &);
void content_timeline_clicked (wxCommandEvent &);
- void dcp_audio_channels_changed (wxCommandEvent &);
- void dcp_resolution_changed (wxCommandEvent &);
+ void audio_channels_changed (wxCommandEvent &);
+ void resolution_changed (wxCommandEvent &);
void sequence_video_changed (wxCommandEvent &);
void content_right_click (wxListEvent &);
- void dcp_3d_changed ();
+ void three_d_changed ();
/* Handle changes to the model */
void film_changed (Film::Property);
wxChoice* _scaler;
wxSpinCtrl* _j2k_bandwidth;
wxChoice* _dcp_content_type;
- wxChoice* _dcp_frame_rate;
- wxSpinCtrl* _dcp_audio_channels;
- wxButton* _best_dcp_frame_rate;
- wxCheckBox* _dcp_3d;
- wxChoice* _dcp_resolution;
+ wxChoice* _frame_rate;
+ wxSpinCtrl* _audio_channels;
+ wxButton* _best_frame_rate;
+ wxCheckBox* _three_d;
+ wxChoice* _resolution;
ContentMenu _menu;
void
FilmViewer::check_play_state ()
{
- if (!_film || _film->dcp_video_frame_rate() == 0) {
+ if (!_film || _film->video_frame_rate() == 0) {
return;
}
if (_play_button->GetValue()) {
- _timer.Start (1000 / _film->dcp_video_frame_rate());
+ _timer.Start (1000 / _film->video_frame_rate());
} else {
_timer.Stop ();
}
return;
}
- double const fps = _film->dcp_video_frame_rate ();
+ double const fps = _film->video_frame_rate ();
/* Count frame number from 1 ... not sure if this is the best idea */
_frame_number->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps / TIME_HZ)) + 1));
{
if (property == ContentProperty::START) {
if (content) {
- _start->set (content->start (), _editor->film()->dcp_video_frame_rate ());
+ _start->set (content->start (), _editor->film()->video_frame_rate ());
} else {
_start->set (0, 24);
}
} else if (property == ContentProperty::LENGTH) {
if (content) {
- _length->set (content->length (), _editor->film()->dcp_video_frame_rate ());
+ _length->set (content->length (), _editor->film()->video_frame_rate ());
} else {
_length->set (0, 24);
}
return;
}
- c->set_start (_start->get (_editor->film()->dcp_video_frame_rate ()));
+ c->set_start (_start->get (_editor->film()->video_frame_rate ()));
}
void
shared_ptr<StillImageContent> ic = dynamic_pointer_cast<StillImageContent> (c);
if (ic) {
- ic->set_video_length (_length->get (_editor->film()->dcp_video_frame_rate()) * ic->video_frame_rate() / TIME_HZ);
+ ic->set_video_length (_length->get (_editor->film()->video_frame_rate()) * ic->video_frame_rate() / TIME_HZ);
}
}
BOOST_CHECK (f->have_dcp());
p /= f->dcp_name();
- p /= f->dcp_video_mxf_filename();
+ p /= f->video_mxf_filename();
boost::filesystem::remove (p);
BOOST_CHECK (!f->have_dcp ());
}
Config::instance()->set_allowed_dcp_frame_rates (afr);
content->_video_frame_rate = 24;
- film->set_dcp_video_frame_rate (24);
+ film->set_video_frame_rate (24);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 48000, 0)));
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), 48000);
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), 96000);
content->_video_frame_rate = 23.976;
- film->set_dcp_video_frame_rate (24);
+ film->set_video_frame_rate (24);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 48000, 0)));
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), 47952);
content->_video_frame_rate = 29.97;
- film->set_dcp_video_frame_rate (30);
- BOOST_CHECK_EQUAL (film->dcp_video_frame_rate (), 30);
+ film->set_video_frame_rate (30);
+ BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 48000, 0)));
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), 47952);
content->_video_frame_rate = 25;
- film->set_dcp_video_frame_rate (24);
+ film->set_video_frame_rate (24);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 48000, 0)));
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), 50000);
content->_video_frame_rate = 25;
- film->set_dcp_video_frame_rate (24);
+ film->set_video_frame_rate (24);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 44100, 0)));
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), 50000);
/* Check some out-there conversions (not the best) */
content->_video_frame_rate = 14.99;
- film->set_dcp_video_frame_rate (25);
+ film->set_video_frame_rate (25);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 16000, 0)));
/* The FrameRateConversion within output_audio_frame_rate should choose to double-up
the 14.99 fps video to 30 and then run it slow at 25.
BOOST_CHECK_EQUAL (B->video_length(), 16);
/* Film should have been set to 25fps */
- BOOST_CHECK_EQUAL (film->dcp_video_frame_rate(), 25);
+ BOOST_CHECK_EQUAL (film->video_frame_rate(), 25);
BOOST_CHECK_EQUAL (A->start(), 0);
/* A is 16 frames long at 25 fps */
film->examine_and_add_content (content);
wait_for_jobs ();
- film->set_dcp_audio_channels (channels);
+ film->set_audio_channels (channels);
film->make_dcp ();
wait_for_jobs ();
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
- film->set_dcp_3d (true);
+ film->set_three_d (true);
film->make_dcp ();
film->write_metadata ();