From 2d5beb0d6794df13ad1df47e84fd7a57d1d1c64d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 14 Apr 2016 02:06:18 +0100 Subject: [PATCH] Rename video/audio/subtitle part methods. --- src/lib/analyse_audio_job.cc | 2 +- src/lib/audio_analysis.cc | 2 +- src/lib/audio_content.cc | 66 +++++----- src/lib/audio_content.h | 32 +++-- src/lib/audio_decoder_stream.cc | 12 +- src/lib/dcp_content.cc | 12 +- src/lib/dcp_decoder.cc | 8 +- src/lib/dcp_subtitle_content.cc | 10 +- src/lib/ffmpeg_content.cc | 14 +-- src/lib/ffmpeg_decoder.cc | 6 +- src/lib/film.cc | 14 +-- src/lib/image_content.cc | 8 +- src/lib/image_decoder.cc | 6 +- src/lib/image_examiner.cc | 4 +- src/lib/player.cc | 74 +++++------ src/lib/playlist.cc | 14 +-- src/lib/sndfile_content.cc | 2 +- src/lib/subtitle_content.cc | 152 +++++++++++----------- src/lib/subtitle_content.h | 82 ++++++------ src/lib/text_subtitle_content.cc | 4 +- src/lib/transcoder.cc | 4 +- src/lib/video_content.cc | 154 +++++++++++------------ src/lib/video_content.h | 71 +++++------ src/lib/video_content_scale.cc | 2 +- src/lib/video_decoder.cc | 10 +- src/lib/video_examiner.h | 2 +- src/tools/dcpomatic_cli.cc | 8 +- src/tools/dcpomatic_create.cc | 2 +- src/wx/audio_dialog.cc | 4 +- src/wx/audio_panel.cc | 24 ++-- src/wx/content_menu.cc | 4 +- src/wx/content_panel.cc | 2 +- src/wx/dcp_panel.cc | 8 +- src/wx/hints_dialog.cc | 2 +- src/wx/subtitle_panel.cc | 58 ++++----- src/wx/timeline.cc | 4 +- src/wx/timeline_subtitle_content_view.cc | 2 +- src/wx/timing_panel.cc | 38 +++--- src/wx/video_panel.cc | 44 +++---- test/audio_analysis_test.cc | 2 +- test/audio_decoder_test.cc | 8 +- test/audio_delay_test.cc | 2 +- test/black_fill_test.cc | 4 +- test/dcp_subtitle_test.cc | 4 +- test/ffmpeg_decoder_sequential_test.cc | 2 +- test/ffmpeg_pts_offset_test.cc | 2 +- test/frame_rate_test.cc | 72 +++++------ test/isdcf_name_test.cc | 2 +- test/recover_test.cc | 2 +- test/reels_test.cc | 8 +- test/scaling_test.cc | 2 +- test/seek_zero_test.cc | 2 +- test/srt_subtitle_test.cc | 12 +- test/threed_test.cc | 2 +- test/time_calculation_test.cc | 92 +++++++------- test/video_content_scale_test.cc | 2 +- test/xml_subtitle_test.cc | 8 +- 57 files changed, 601 insertions(+), 594 deletions(-) diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 9a24a9188..fefb8bc16 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -147,7 +147,7 @@ AnalyseAudioJob::run () */ shared_ptr ac = _playlist->content().front()->audio; DCPOMATIC_ASSERT (ac); - _analysis->set_analysis_gain (ac->audio_gain ()); + _analysis->set_analysis_gain (ac->gain ()); } _analysis->write (_film->audio_analysis_path (_playlist)); diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc index d99b01ce6..e04468ba2 100644 --- a/src/lib/audio_analysis.cc +++ b/src/lib/audio_analysis.cc @@ -154,7 +154,7 @@ AudioAnalysis::gain_correction (shared_ptr playlist) what correction is now needed to make it look `right'. */ DCPOMATIC_ASSERT (playlist->content().front()->audio); - return playlist->content().front()->audio->audio_gain() - analysis_gain().get (); + return playlist->content().front()->audio->gain() - analysis_gain().get (); } return 0.0f; diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 2832e2575..983d502b8 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -44,15 +44,21 @@ using boost::dynamic_pointer_cast; using boost::optional; /** Something stream-related has changed */ +<<<<<<< 17dbd967c18aff2f3007eb86b5eee5b43f23bc4b int const AudioContentProperty::AUDIO_STREAMS = 200; int const AudioContentProperty::AUDIO_GAIN = 201; int const AudioContentProperty::AUDIO_DELAY = 202; int const AudioContentProperty::AUDIO_VIDEO_FRAME_RATE = 203; +======= +int const AudioContentProperty::STREAMS = 200; +int const AudioContentProperty::GAIN = 201; +int const AudioContentProperty::DELAY = 202; +>>>>>>> Rename video/audio/subtitle part methods. AudioContent::AudioContent (Content* parent, shared_ptr film) : ContentPart (parent, film) - , _audio_gain (0) - , _audio_delay (Config::instance()->default_audio_delay ()) + , _gain (0) + , _delay (Config::instance()->default_audio_delay ()) { } @@ -60,9 +66,9 @@ AudioContent::AudioContent (Content* parent, shared_ptr film) AudioContent::AudioContent (Content* parent, shared_ptr film, cxml::ConstNodePtr node) : ContentPart (parent, film) { - _audio_gain = node->number_child ("AudioGain"); - _audio_delay = node->number_child ("AudioDelay"); - _audio_video_frame_rate = node->optional_number_child ("AudioVideoFrameRate"); + _gain = node->number_child ("AudioGain"); + _delay = node->number_child ("AudioDelay"); + _video_frame_rate = node->optional_number_child ("AudioVideoFrameRate"); } AudioContent::AudioContent (Content* parent, shared_ptr film, vector > c) @@ -72,11 +78,11 @@ AudioContent::AudioContent (Content* parent, shared_ptr film, vector DCPOMATIC_ASSERT (ref); for (size_t i = 1; i < c.size(); ++i) { - if (c[i]->audio->audio_gain() != ref->audio_gain()) { + if (c[i]->audio->gain() != ref->gain()) { throw JoinError (_("Content to be joined must have the same audio gain.")); } - if (c[i]->audio->audio_delay() != ref->audio_delay()) { + if (c[i]->audio->delay() != ref->delay()) { throw JoinError (_("Content to be joined must have the same audio delay.")); } @@ -85,10 +91,10 @@ AudioContent::AudioContent (Content* parent, shared_ptr film, vector } } - _audio_gain = ref->audio_gain (); - _audio_delay = ref->audio_delay (); + _gain = ref->audio_gain (); + _delay = ref->audio_delay (); /* Preserve the optional<> part of this */ - _audio_video_frame_rate = ref->_audio_video_frame_rate; + _video_frame_rate = ref->_audio_video_frame_rate; _streams = ref->streams (); } @@ -96,23 +102,23 @@ void AudioContent::as_xml (xmlpp::Node* node) const { boost::mutex::scoped_lock lm (_mutex); - node->add_child("AudioGain")->add_child_text (raw_convert (_audio_gain)); - node->add_child("AudioDelay")->add_child_text (raw_convert (_audio_delay)); + node->add_child("AudioGain")->add_child_text (raw_convert (_gain)); + node->add_child("AudioDelay")->add_child_text (raw_convert (_delay)); if (_audio_video_frame_rate) { node->add_child("AudioVideoFrameRate")->add_child_text (raw_convert (_audio_video_frame_rate.get())); } } void -AudioContent::set_audio_gain (double g) +AudioContent::set_gain (double g) { - maybe_set (_audio_gain, g, AudioContentProperty::AUDIO_GAIN); + maybe_set (_gain, g, AudioContentProperty::GAIN); } void -AudioContent::set_audio_delay (int d) +AudioContent::set_delay (int d) { - maybe_set (_audio_delay, d, AudioContentProperty::AUDIO_DELAY); + maybe_set (_delay, d, AudioContentProperty::DELAY); } string @@ -127,7 +133,7 @@ AudioContent::technical_summary () const } void -AudioContent::set_audio_mapping (AudioMapping mapping) +AudioContent::set_mapping (AudioMapping mapping) { int c = 0; BOOST_FOREACH (AudioStreamPtr i, streams ()) { @@ -141,11 +147,11 @@ AudioContent::set_audio_mapping (AudioMapping mapping) i->set_mapping (stream_mapping); } - _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS); + _parent->signal_changed (AudioContentProperty::STREAMS); } AudioMapping -AudioContent::audio_mapping () const +AudioContent::mapping () const { int channels = 0; BOOST_FOREACH (AudioStreamPtr i, streams ()) { @@ -177,7 +183,7 @@ AudioContent::audio_mapping () const * that it is in sync with the active video content at its start time. */ int -AudioContent::resampled_audio_frame_rate () const +AudioContent::resampled_frame_rate () const { /* Resample to a DCI-approved sample rate */ double t = has_rate_above_48k() ? 96000 : 48000; @@ -218,7 +224,7 @@ AudioContent::processing_description () const optional common_frame_rate; BOOST_FOREACH (AudioStreamPtr i, streams()) { - if (i->frame_rate() != resampled_audio_frame_rate()) { + if (i->frame_rate() != resampled_frame_rate()) { resampled = true; } else { not_resampled = true; @@ -235,14 +241,14 @@ AudioContent::processing_description () const } if (not_resampled && resampled) { - return String::compose (_("Some audio will be resampled to %1kHz"), resampled_audio_frame_rate ()); + return String::compose (_("Some audio will be resampled to %1kHz"), resampled_frame_rate ()); } if (!not_resampled && resampled) { if (same) { - return String::compose (_("Audio will be resampled from %1kHz to %2kHz"), common_frame_rate.get(), resampled_audio_frame_rate ()); + return String::compose (_("Audio will be resampled from %1kHz to %2kHz"), common_frame_rate.get(), resampled_frame_rate ()); } else { - return String::compose (_("Audio will be resampled to %1kHz"), resampled_audio_frame_rate ()); + return String::compose (_("Audio will be resampled to %1kHz"), resampled_frame_rate ()); } } @@ -264,7 +270,7 @@ AudioContent::has_rate_above_48k () const /** @return User-visible names of each of our audio channels */ vector -AudioContent::audio_channel_names () const +AudioContent::channel_names () const { vector n; @@ -312,7 +318,7 @@ AudioContent::add_properties (list& p) const ); } - p.push_back (UserProperty (_("Audio"), _("DCP frame rate"), resampled_audio_frame_rate (), _("Hz"))); + p.push_back (UserProperty (_("Audio"), _("DCP frame rate"), resampled_frame_rate (), _("Hz"))); p.push_back (UserProperty (_("Length"), _("Full length in video frames at DCP rate"), c.frames_round (frc.dcp))); if (stream) { @@ -320,7 +326,7 @@ AudioContent::add_properties (list& p) const UserProperty ( _("Length"), _("Full length in audio frames at DCP rate"), - c.frames_round (resampled_audio_frame_rate ()) + c.frames_round (resampled_frame_rate ()) ) ); } @@ -360,7 +366,7 @@ AudioContent::set_streams (vector streams) _streams = streams; } - _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS); + _parent->signal_changed (AudioContentProperty::STREAMS); } AudioStreamPtr @@ -379,7 +385,7 @@ AudioContent::add_stream (AudioStreamPtr stream) _streams.push_back (stream); } - _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS); + _parent->signal_changed (AudioContentProperty::STREAMS); } void @@ -391,5 +397,5 @@ AudioContent::set_stream (AudioStreamPtr stream) _streams.push_back (stream); } - _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS); + _parent->signal_changed (AudioContentProperty::STREAMS); } diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 3aa9678b0..09e7a0d12 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -34,10 +34,16 @@ class AudioContentProperty { public: +<<<<<<< 17dbd967c18aff2f3007eb86b5eee5b43f23bc4b static int const AUDIO_STREAMS; static int const AUDIO_GAIN; static int const AUDIO_DELAY; static int const AUDIO_VIDEO_FRAME_RATE; +======= + static int const STREAMS; + static int const GAIN; + static int const DELAY; +>>>>>>> Rename video/audio/subtitle part methods. }; class AudioContent : public ContentPart @@ -50,23 +56,23 @@ public: void as_xml (xmlpp::Node *) const; std::string technical_summary () const; - AudioMapping audio_mapping () const; - void set_audio_mapping (AudioMapping); - int resampled_audio_frame_rate () const; + AudioMapping mapping () const; + void set_mapping (AudioMapping); + int resampled_frame_rate () const; bool has_rate_above_48k () const; - std::vector audio_channel_names () const; + std::vector channel_names () const; - void set_audio_gain (double); - void set_audio_delay (int); + void set_gain (double); + void set_delay (int); - double audio_gain () const { + double gain () const { boost::mutex::scoped_lock lm (_mutex); - return _audio_gain; + return _gain; } - int audio_delay () const { + int delay () const { boost::mutex::scoped_lock lm (_mutex); - return _audio_delay; + return _delay; } double audio_video_frame_rate () const; @@ -89,10 +95,10 @@ public: private: /** Gain to apply to audio in dB */ - double _audio_gain; + double _gain; /** Delay to apply to audio (positive moves audio later) in milliseconds */ - int _audio_delay; - boost::optional _audio_video_frame_rate; + int _delay; + boost::optional _video_frame_rate; std::vector _streams; }; diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index 7037d9f47..cd2e3a388 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,8 +45,8 @@ AudioDecoderStream::AudioDecoderStream (shared_ptr content, , _decoder (decoder) , _log (log) { - if (content->resampled_audio_frame_rate() != _stream->frame_rate() && _stream->channels() > 0) { - _resampler.reset (new Resampler (_stream->frame_rate(), content->resampled_audio_frame_rate(), _stream->channels (), decoder->fast ())); + if (content->resampled_frame_rate() != _stream->frame_rate() && _stream->channels() > 0) { + _resampler.reset (new Resampler (_stream->frame_rate(), content->resampled_frame_rate(), _stream->channels (), decoder->fast ())); } reset_decoded (); @@ -69,7 +69,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate) if (frame < _decoded.frame || end > (_decoded.frame + length * 4)) { /* Either we have no decoded data, or what we do have is a long way from what we want: seek */ - seek (ContentTime::from_frames (frame, _content->resampled_audio_frame_rate()), accurate); + seek (ContentTime::from_frames (frame, _content->resampled_frame_rate()), accurate); } /* Offset of the data that we want from the start of _decoded.audio @@ -148,7 +148,7 @@ AudioDecoderStream::audio (shared_ptr data, ContentTime time data = _resampler->run (data); } - Frame const frame_rate = _content->resampled_audio_frame_rate (); + Frame const frame_rate = _content->resampled_frame_rate (); if (_seek_reference) { /* We've had an accurate seek and now we're seeing some data */ @@ -217,7 +217,7 @@ AudioDecoderStream::add (shared_ptr data) _position = _position.get() + data->frames (); /* Limit the amount of data we keep in case nobody is asking for it */ - int const max_frames = _content->resampled_audio_frame_rate () * 10; + int const max_frames = _content->resampled_frame_rate () * 10; if (_decoded.audio->frames() > max_frames) { int const to_remove = _decoded.audio->frames() - max_frames; _decoded.frame += to_remove; diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index cfd19fe31..d47c52273 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -116,7 +116,7 @@ DCPContent::examine (shared_ptr job) Content::examine (job); shared_ptr examiner (new DCPExaminer (shared_from_this ())); - video->take_from_video_examiner (examiner); + video->take_from_examiner (examiner); set_default_colour_conversion (); { @@ -129,7 +129,7 @@ DCPContent::examine (shared_ptr job) as->set_mapping (m); } - signal_changed (AudioContentProperty::AUDIO_STREAMS); + signal_changed (AudioContentProperty::STREAMS); { boost::mutex::scoped_lock lm (_mutex); @@ -187,8 +187,8 @@ DCPContent::as_xml (xmlpp::Node* node) const DCPTime DCPContent::full_length () const { - FrameRateChange const frc (video->video_frame_rate (), film()->video_frame_rate ()); - return DCPTime::from_frames (llrint (video->video_length () * frc.factor ()), film()->video_frame_rate ()); + FrameRateChange const frc (video->frame_rate (), film()->video_frame_rate ()); + return DCPTime::from_frames (llrint (video->length () * frc.factor ()), film()->video_frame_rate ()); } string @@ -358,7 +358,7 @@ DCPContent::can_reference_subtitle (list& why_not) const void DCPContent::changed (int property) { - if (property == VideoContentProperty::VIDEO_FRAME_RATE && subtitle) { - subtitle->set_subtitle_video_frame_rate (video->video_frame_rate ()); + if (property == VideoContentProperty::FRAME_RATE && subtitle) { + subtitle->set_video_frame_rate (video->frame_rate ()); } } diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 4e28dc758..1c25587e0 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -74,7 +74,7 @@ DCPDecoder::pass (PassReason reason, bool) ++i; } - double const vfr = _dcp_content->video->video_frame_rate (); + double const vfr = _dcp_content->video->frame_rate (); /* Frame within the (played part of the) reel that is coming up next */ int64_t const frame = _next.frames_round (vfr); @@ -157,8 +157,8 @@ DCPDecoder::seek (ContentTime t, bool accurate) SubtitleDecoder::seek (t, accurate); _reel = _reels.begin (); - while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video->video_frame_rate ())) { - t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video->video_frame_rate ()); + while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video->frame_rate ())) { + t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video->frame_rate ()); ++_reel; } @@ -178,7 +178,7 @@ DCPDecoder::text_subtitles_during (ContentTimePeriod period, bool starting) cons /* XXX: inefficient */ list ctp; - double const vfr = _dcp_content->video->video_frame_rate (); + double const vfr = _dcp_content->video->frame_rate (); BOOST_FOREACH (shared_ptr r, _reels) { if (!r->main_subtitle ()) { diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index 3feb8947a..eabcaaafe 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -56,18 +56,18 @@ DCPSubtitleContent::examine (shared_ptr job) shared_ptr sc = load (path (0)); /* Default to turning these subtitles on */ - subtitle->set_use_subtitles (true); + subtitle->set_use (true); boost::mutex::scoped_lock lm (_mutex); shared_ptr iop = dynamic_pointer_cast (sc); if (iop) { - subtitle->set_subtitle_language (iop->language ()); + subtitle->set_language (iop->language ()); } shared_ptr smpte = dynamic_pointer_cast (sc); if (smpte) { - subtitle->set_subtitle_language (smpte->language().get_value_or ("")); - subtitle->set_subtitle_video_frame_rate (smpte->edit_rate().numerator); + subtitle->set_language (smpte->language().get_value_or ("")); + subtitle->set_video_frame_rate (smpte->edit_rate().numerator); } _length = ContentTime::from_seconds (sc->latest_subtitle_out().as_seconds ()); @@ -80,7 +80,7 @@ DCPSubtitleContent::examine (shared_ptr job) DCPTime DCPSubtitleContent::full_length () const { - FrameRateChange const frc (subtitle->subtitle_video_frame_rate(), film()->video_frame_rate()); + FrameRateChange const frc (subtitle->video_frame_rate(), film()->video_frame_rate()); return DCPTime (_length, frc); } diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index c67d643a5..d9941685d 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -133,7 +133,7 @@ FFmpegContent::FFmpegContent (shared_ptr film, vector fc = dynamic_pointer_cast (c[i]); - if (fc->subtitle->use_subtitles() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) { + if (fc->subtitle->use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) { throw JoinError (_("Content to be joined must use the same subtitle stream.")); } } @@ -201,7 +201,7 @@ FFmpegContent::examine (shared_ptr job) Content::examine (job); shared_ptr examiner (new FFmpegExaminer (shared_from_this (), job)); - video->take_from_video_examiner (examiner); + video->take_from_examiner (examiner); set_default_colour_conversion (); { @@ -296,8 +296,8 @@ operator!= (FFmpegStream const & a, FFmpegStream const & b) DCPTime FFmpegContent::full_length () const { - FrameRateChange const frc (video->video_frame_rate (), film()->video_frame_rate ()); - return DCPTime::from_frames (llrint (video->video_length_after_3d_combine() * frc.factor()), film()->video_frame_rate()); + FrameRateChange const frc (video->frame_rate (), film()->video_frame_rate ()); + return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film()->video_frame_rate()); } void @@ -382,7 +382,7 @@ FFmpegContent::has_text_subtitles () const void FFmpegContent::set_default_colour_conversion () { - dcp::Size const s = video->video_size (); + dcp::Size const s = video->size (); boost::mutex::scoped_lock lm (_mutex); @@ -536,7 +536,7 @@ FFmpegContent::signal_subtitle_stream_changed () void FFmpegContent::changed (int property) { - if (property == VideoContentProperty::VIDEO_FRAME_RATE && subtitle) { - subtitle->set_subtitle_video_frame_rate (video->video_frame_rate ()); + if (property == VideoContentProperty::FRAME_RATE && subtitle) { + subtitle->set_video_frame_rate (video->frame_rate ()); } } diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 8e4a1cc23..57327b63d 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -77,7 +77,7 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr c, shared_ptr , SubtitleDecoder (c->subtitle) , FFmpeg (c) , _log (log) - , _pts_offset (pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->video->video_frame_rate())) + , _pts_offset (pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->video->frame_rate())) { } @@ -413,7 +413,7 @@ FFmpegDecoder::decode_video_packet () double const pts = i->second * av_q2d (_format_context->streams[_video_stream]->time_base) + _pts_offset.seconds (); video ( shared_ptr (new RawImageProxy (image)), - llrint (pts * _ffmpeg_content->video->video_frame_rate ()) + llrint (pts * _ffmpeg_content->video->frame_rate ()) ); } else { LOG_WARNING_NC ("Dropping frame without PTS"); @@ -547,7 +547,7 @@ FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTimeP out_p += image->stride()[0] / sizeof (uint32_t); } - dcp::Size const vs = _ffmpeg_content->video->video_size (); + dcp::Size const vs = _ffmpeg_content->video->size (); dcpomatic::Rect const scaled_rect ( static_cast (rect->x) / vs.width, static_cast (rect->y) / vs.height, diff --git a/src/lib/film.cc b/src/lib/film.cc index 49a0a9b13..3d5d625e1 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -250,7 +250,7 @@ Film::audio_analysis_path (shared_ptr playlist) const } digester.add (i->digest ()); - digester.add (i->audio->audio_mapping().digest ()); + digester.add (i->audio->mapping().digest ()); if (playlist->content().size() != 1) { /* Analyses should be considered equal regardless of gain if they were made from just one piece of content. This @@ -258,7 +258,7 @@ Film::audio_analysis_path (shared_ptr playlist) const analysis at the plotting stage rather than having to recompute it. */ - digester.add (i->audio->audio_gain ()); + digester.add (i->audio->gain ()); } } @@ -620,7 +620,7 @@ Film::isdcf_name (bool if_created_now) const if (i->video->scale().ratio ()) { content_ratio = i->video->scale().ratio (); } else { - content_ratio = Ratio::from_ratio (i->video->video_size().ratio ()); + content_ratio = Ratio::from_ratio (i->video->size().ratio ()); } break; } @@ -641,7 +641,7 @@ Film::isdcf_name (bool if_created_now) const continue; } - if (i->subtitle->use_subtitles() && !i->subtitle->burn_subtitles()) { + if (i->subtitle->use() && !i->subtitle->burn()) { burnt_in = false; } } @@ -1096,9 +1096,9 @@ Film::playlist_content_changed (weak_ptr c, int p, bool frequent) { _dirty = true; - if (p == VideoContentProperty::VIDEO_FRAME_RATE) { + if (p == VideoContentProperty::FRAME_RATE) { set_video_frame_rate (_playlist->best_dcp_frame_rate ()); - } else if (p == AudioContentProperty::AUDIO_STREAMS) { + } else if (p == AudioContentProperty::STREAMS) { signal_changed (NAME); } @@ -1268,7 +1268,7 @@ Film::subtitle_language () const ContentList cl = content (); BOOST_FOREACH (shared_ptr& c, cl) { if (c->subtitle) { - languages.insert (c->subtitle->subtitle_language ()); + languages.insert (c->subtitle->language ()); } } diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 231eb9f8c..29af451b7 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -115,7 +115,7 @@ ImageContent::examine (shared_ptr job) DCPOMATIC_ASSERT (film); shared_ptr examiner (new ImageExaminer (film, shared_from_this(), job)); - video->take_from_video_examiner (examiner); + video->take_from_examiner (examiner); set_default_colour_conversion (); } @@ -124,8 +124,8 @@ ImageContent::full_length () const { shared_ptr film = _film.lock (); DCPOMATIC_ASSERT (film); - FrameRateChange const frc (video->video_frame_rate(), film->video_frame_rate()); - return DCPTime::from_frames (llrint (video->video_length_after_3d_combine() * frc.factor ()), film->video_frame_rate ()); + FrameRateChange const frc (video->frame_rate(), film->video_frame_rate()); + return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor ()), film->video_frame_rate ()); } string @@ -134,7 +134,7 @@ ImageContent::identifier () const SafeStringStream s; s << Content::identifier(); s << "_" << video->identifier (); - s << "_" << video->video_length(); + s << "_" << video->length(); return s.str (); } diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index e26574f61..c3a11ce97 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -45,7 +45,7 @@ ImageDecoder::ImageDecoder (shared_ptr c, shared_ptr lo bool ImageDecoder::pass (PassReason, bool) { - if (_video_position >= _image_content->video->video_length()) { + if (_video_position >= _image_content->video->length()) { return true; } @@ -56,7 +56,7 @@ ImageDecoder::pass (PassReason, bool) /* We can't extract image size from a JPEG2000 codestream without decoding it, so pass in the image content's size here. */ - _image.reset (new J2KImageProxy (path, _image_content->video->video_size ())); + _image.reset (new J2KImageProxy (path, _image_content->video->size ())); } else { _image.reset (new MagickImageProxy (path)); } @@ -71,5 +71,5 @@ void ImageDecoder::seek (ContentTime time, bool accurate) { VideoDecoder::seek (time, accurate); - _video_position = time.frames_round (_image_content->video->video_frame_rate ()); + _video_position = time.frames_round (_image_content->video->frame_rate ()); } diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index 010275429..8e15a9d48 100644 --- a/src/lib/image_examiner.cc +++ b/src/lib/image_examiner.cc @@ -85,9 +85,9 @@ ImageExaminer::video_size () const optional ImageExaminer::video_frame_rate () const { - if (_image_content->video->has_own_video_frame_rate()) { + if (_image_content->video->has_own_frame_rate()) { /* The content already knows what frame rate it should be */ - return _image_content->video->video_frame_rate(); + return _image_content->video->frame_rate(); } /* Don't know */ diff --git a/src/lib/player.cc b/src/lib/player.cc index ce048ed79..d37910ad8 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -114,13 +114,13 @@ Player::setup_pieces () shared_ptr fc = dynamic_pointer_cast (i); if (fc) { decoder.reset (new FFmpegDecoder (fc, _film->log(), _fast)); - frc = FrameRateChange (fc->video->video_frame_rate(), _film->video_frame_rate()); + frc = FrameRateChange (fc->video->frame_rate(), _film->video_frame_rate()); } shared_ptr dc = dynamic_pointer_cast (i); if (dc) { decoder.reset (new DCPDecoder (dc, _film->log(), _fast)); - frc = FrameRateChange (dc->video->video_frame_rate(), _film->video_frame_rate()); + frc = FrameRateChange (dc->video->frame_rate(), _film->video_frame_rate()); } /* ImageContent */ @@ -138,7 +138,7 @@ Player::setup_pieces () decoder.reset (new ImageDecoder (ic, _film->log())); } - frc = FrameRateChange (ic->video->video_frame_rate(), _film->video_frame_rate()); + frc = FrameRateChange (ic->video->frame_rate(), _film->video_frame_rate()); } /* SndfileContent */ @@ -162,7 +162,7 @@ Player::setup_pieces () } if (best_overlap) { - frc = FrameRateChange (best_overlap->video->video_frame_rate(), _film->video_frame_rate ()); + frc = FrameRateChange (best_overlap->video->frame_rate(), _film->video_frame_rate ()); } else { /* No video overlap; e.g. if the DCP is just audio */ frc = FrameRateChange (_film->video_frame_rate(), _film->video_frame_rate ()); @@ -178,14 +178,14 @@ Player::setup_pieces () shared_ptr rc = dynamic_pointer_cast (i); if (rc) { decoder.reset (new TextSubtitleDecoder (rc)); - frc = FrameRateChange (rc->subtitle->subtitle_video_frame_rate(), _film->video_frame_rate()); + frc = FrameRateChange (rc->subtitle->video_frame_rate(), _film->video_frame_rate()); } /* DCPSubtitleContent */ shared_ptr dsc = dynamic_pointer_cast (i); if (dsc) { decoder.reset (new DCPSubtitleDecoder (dsc)); - frc = FrameRateChange (dsc->subtitle->subtitle_video_frame_rate(), _film->video_frame_rate()); + frc = FrameRateChange (dsc->subtitle->video_frame_rate(), _film->video_frame_rate()); } shared_ptr vd = dynamic_pointer_cast (decoder); @@ -218,11 +218,11 @@ Player::playlist_content_changed (weak_ptr w, int property, bool freque property == ContentProperty::TRIM_START || property == ContentProperty::TRIM_END || property == ContentProperty::PATH || - property == VideoContentProperty::VIDEO_FRAME_TYPE || + property == VideoContentProperty::FRAME_TYPE || property == DCPContentProperty::CAN_BE_PLAYED || - property == SubtitleContentProperty::SUBTITLE_COLOUR || - property == SubtitleContentProperty::SUBTITLE_OUTLINE || - property == SubtitleContentProperty::SUBTITLE_OUTLINE_COLOUR || + property == SubtitleContentProperty::COLOUR || + property == SubtitleContentProperty::OUTLINE || + property == SubtitleContentProperty::OUTLINE_COLOUR || property == FFmpegContentProperty::SUBTITLE_STREAM ) { @@ -230,17 +230,17 @@ Player::playlist_content_changed (weak_ptr w, int property, bool freque Changed (frequent); } else if ( - property == SubtitleContentProperty::USE_SUBTITLES || - property == SubtitleContentProperty::SUBTITLE_X_OFFSET || - property == SubtitleContentProperty::SUBTITLE_Y_OFFSET || - property == SubtitleContentProperty::SUBTITLE_X_SCALE || - property == SubtitleContentProperty::SUBTITLE_Y_SCALE || + property == SubtitleContentProperty::USE || + property == SubtitleContentProperty::X_OFFSET || + property == SubtitleContentProperty::Y_OFFSET || + property == SubtitleContentProperty::X_SCALE || + property == SubtitleContentProperty::Y_SCALE || property == SubtitleContentProperty::FONTS || - property == VideoContentProperty::VIDEO_CROP || - property == VideoContentProperty::VIDEO_SCALE || - property == VideoContentProperty::VIDEO_FRAME_RATE || - property == VideoContentProperty::VIDEO_FADE_IN || - property == VideoContentProperty::VIDEO_FADE_OUT || + property == VideoContentProperty::CROP || + property == VideoContentProperty::SCALE || + property == VideoContentProperty::FRAME_RATE || + property == VideoContentProperty::FADE_IN || + property == VideoContentProperty::FADE_OUT || property == VideoContentProperty::COLOUR_CONVERSION ) { @@ -397,7 +397,7 @@ Player::get_video (DCPTime time, bool accurate) } else { /* Some video content at this time */ shared_ptr last = *(ov.rbegin ()); - VideoFrameType const last_type = last->content->video->video_frame_type (); + VideoFrameType const last_type = last->content->video->frame_type (); /* Get video from appropriate piece(s) */ BOOST_FOREACH (shared_ptr piece, ov) { @@ -414,8 +414,8 @@ Player::get_video (DCPTime time, bool accurate) /* always use the last video */ piece == last || /* with a corresponding L/R eye if appropriate */ - (last_type == VIDEO_FRAME_TYPE_3D_LEFT && piece->content->video->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) || - (last_type == VIDEO_FRAME_TYPE_3D_RIGHT && piece->content->video->video_frame_type() == VIDEO_FRAME_TYPE_3D_LEFT); + (last_type == VIDEO_FRAME_TYPE_3D_LEFT && piece->content->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) || + (last_type == VIDEO_FRAME_TYPE_3D_RIGHT && piece->content->video->frame_type() == VIDEO_FRAME_TYPE_3D_LEFT); if (use) { /* We want to use this piece */ @@ -499,7 +499,7 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) DCPOMATIC_ASSERT (decoder); /* The time that we should request from the content */ - DCPTime request = time - DCPTime::from_seconds (i->content->audio->audio_delay() / 1000.0); + DCPTime request = time - DCPTime::from_seconds (i->content->audio->delay() / 1000.0); Frame request_frames = length_frames; DCPTime offset; if (request < DCPTime ()) { @@ -527,9 +527,9 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) ContentAudio all = decoder->get_audio (j, content_frame, request_frames, accurate); /* Gain */ - if (i->content->audio->audio_gain() != 0) { + if (i->content->audio->gain() != 0) { shared_ptr gain (new AudioBuffers (all.audio)); - gain->apply_gain (i->content->audio->audio_gain ()); + gain->apply_gain (i->content->audio->gain ()); all.audio = gain; } @@ -628,7 +628,7 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting, bool burnt, PlayerSubtitles ps (time, length); for (list >::const_iterator j = subs.begin(); j != subs.end(); ++j) { - if (!(*j)->content->subtitle->use_subtitles () || (!_always_burn_subtitles && (burnt != (*j)->content->subtitle->burn_subtitles ()))) { + if (!(*j)->content->subtitle->use () || (!_always_burn_subtitles && (burnt != (*j)->content->subtitle->burn ()))) { continue; } @@ -646,16 +646,16 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting, bool burnt, for (list::iterator i = image.begin(); i != image.end(); ++i) { /* Apply content's subtitle offsets */ - i->sub.rectangle.x += (*j)->content->subtitle->subtitle_x_offset (); - i->sub.rectangle.y += (*j)->content->subtitle->subtitle_y_offset (); + i->sub.rectangle.x += (*j)->content->subtitle->x_offset (); + i->sub.rectangle.y += (*j)->content->subtitle->y_offset (); /* Apply content's subtitle scale */ - i->sub.rectangle.width *= (*j)->content->subtitle->subtitle_x_scale (); - i->sub.rectangle.height *= (*j)->content->subtitle->subtitle_y_scale (); + i->sub.rectangle.width *= (*j)->content->subtitle->x_scale (); + i->sub.rectangle.height *= (*j)->content->subtitle->y_scale (); /* Apply a corrective translation to keep the subtitle centred after that scale */ - i->sub.rectangle.x -= i->sub.rectangle.width * ((*j)->content->subtitle->subtitle_x_scale() - 1); - i->sub.rectangle.y -= i->sub.rectangle.height * ((*j)->content->subtitle->subtitle_y_scale() - 1); + i->sub.rectangle.x -= i->sub.rectangle.width * ((*j)->content->subtitle->x_scale() - 1); + i->sub.rectangle.y -= i->sub.rectangle.height * ((*j)->content->subtitle->y_scale() - 1); ps.image.push_back (i->sub); } @@ -663,10 +663,10 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting, bool burnt, list text = subtitle_decoder->get_text_subtitles (ContentTimePeriod (from, to), starting, accurate); BOOST_FOREACH (ContentTextSubtitle& ts, text) { BOOST_FOREACH (dcp::SubtitleString s, ts.subs) { - s.set_h_position (s.h_position() + (*j)->content->subtitle->subtitle_x_offset ()); - s.set_v_position (s.v_position() + (*j)->content->subtitle->subtitle_y_offset ()); - float const xs = (*j)->content->subtitle->subtitle_x_scale(); - float const ys = (*j)->content->subtitle->subtitle_y_scale(); + s.set_h_position (s.h_position() + (*j)->content->subtitle->x_offset ()); + s.set_v_position (s.v_position() + (*j)->content->subtitle->y_offset ()); + float const xs = (*j)->content->subtitle->x_scale(); + float const ys = (*j)->content->subtitle->y_scale(); float size = s.size(); /* Adjust size to express the common part of the scaling; diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 092060fa0..24a38f2cd 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -67,7 +67,7 @@ Playlist::~Playlist () void Playlist::content_changed (weak_ptr content, int property, bool frequent) { - if (property == ContentProperty::LENGTH || property == VideoContentProperty::VIDEO_FRAME_TYPE) { + if (property == ContentProperty::LENGTH || property == VideoContentProperty::FRAME_TYPE) { /* Don't respond to position changes here, as: - sequencing after earlier/later changes is handled by move_earlier/move_later - any other position changes will be timeline drags which should not result in content @@ -115,7 +115,7 @@ Playlist::maybe_sequence () continue; } - if (i->video->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) { + if (i->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) { i->set_position (next_right); next_right = i->end(); } else { @@ -150,7 +150,7 @@ Playlist::video_identifier () const string t; BOOST_FOREACH (shared_ptr i, _content) { - if (i->video || (i->subtitle && i->subtitle->burn_subtitles())) { + if (i->video || (i->subtitle && i->subtitle->burn())) { t += i->identifier (); } } @@ -266,14 +266,14 @@ Playlist::best_dcp_frame_rate () const float this_error = 0; BOOST_FOREACH (shared_ptr j, _content) { - if (!j->video || !j->video->has_own_video_frame_rate()) { + if (!j->video || !j->video->has_own_frame_rate()) { continue; } /* Best error for this content; we could use the content as-is or double its rate */ float best_error = min ( - float (fabs (i->source - j->video->video_frame_rate ())), - float (fabs (i->source - j->video->video_frame_rate () * 2)) + float (fabs (i->source - j->video->frame_rate ())), + float (fabs (i->source - j->video->frame_rate () * 2)) ); /* Use the largest difference between DCP and source as the "error" */ @@ -375,7 +375,7 @@ Playlist::active_frame_rate_change (DCPTime t, int dcp_video_frame_rate) const /* This is the first piece of content (going backwards...) that starts before t, so it's the active one. */ - return FrameRateChange ((*i)->video->video_frame_rate(), dcp_video_frame_rate); + return FrameRateChange ((*i)->video->frame_rate(), dcp_video_frame_rate); } } diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index d023b27d6..ed7e67c3c 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -113,7 +113,7 @@ SndfileContent::take_from_audio_examiner (shared_ptr examiner) _audio_length = examiner->audio_length (); } - signal_changed (AudioContentProperty::AUDIO_STREAMS); + signal_changed (AudioContentProperty::STREAMS); } DCPTime diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 089e3a3fc..2066793fb 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -39,27 +39,27 @@ using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; -int const SubtitleContentProperty::SUBTITLE_X_OFFSET = 500; -int const SubtitleContentProperty::SUBTITLE_Y_OFFSET = 501; -int const SubtitleContentProperty::SUBTITLE_X_SCALE = 502; -int const SubtitleContentProperty::SUBTITLE_Y_SCALE = 503; -int const SubtitleContentProperty::USE_SUBTITLES = 504; -int const SubtitleContentProperty::BURN_SUBTITLES = 505; -int const SubtitleContentProperty::SUBTITLE_LANGUAGE = 506; +int const SubtitleContentProperty::X_OFFSET = 500; +int const SubtitleContentProperty::Y_OFFSET = 501; +int const SubtitleContentProperty::X_SCALE = 502; +int const SubtitleContentProperty::Y_SCALE = 503; +int const SubtitleContentProperty::USE = 504; +int const SubtitleContentProperty::BURN = 505; +int const SubtitleContentProperty::LANGUAGE = 506; int const SubtitleContentProperty::FONTS = 507; -int const SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE = 508; -int const SubtitleContentProperty::SUBTITLE_COLOUR = 509; -int const SubtitleContentProperty::SUBTITLE_OUTLINE = 510; -int const SubtitleContentProperty::SUBTITLE_OUTLINE_COLOUR = 511; +int const SubtitleContentProperty::VIDEO_FRAME_RATE = 508; +int const SubtitleContentProperty::COLOUR = 509; +int const SubtitleContentProperty::OUTLINE = 510; +int const SubtitleContentProperty::OUTLINE_COLOUR = 511; SubtitleContent::SubtitleContent (Content* parent, shared_ptr film) : ContentPart (parent, film) - , _use_subtitles (false) - , _burn_subtitles (false) - , _subtitle_x_offset (0) - , _subtitle_y_offset (0) - , _subtitle_x_scale (1) - , _subtitle_y_scale (1) + , _use (false) + , _burn (false) + , _x_offset (0) + , _y_offset (0) + , _x_scale (1) + , _y_scale (1) , _colour (255, 255, 255) , _outline (false) , _outline_colour (0, 0, 0) @@ -69,12 +69,12 @@ SubtitleContent::SubtitleContent (Content* parent, shared_ptr film) SubtitleContent::SubtitleContent (Content* parent, shared_ptr film, cxml::ConstNodePtr node, int version) : ContentPart (parent, film) - , _use_subtitles (false) - , _burn_subtitles (false) - , _subtitle_x_offset (0) - , _subtitle_y_offset (0) - , _subtitle_x_scale (1) - , _subtitle_y_scale (1) + , _use (false) + , _burn (false) + , _x_offset (0) + , _y_offset (0) + , _x_scale (1) + , _y_scale (1) , _colour ( node->optional_number_child("Red").get_value_or(255), node->optional_number_child("Green").get_value_or(255), @@ -89,25 +89,25 @@ SubtitleContent::SubtitleContent (Content* parent, shared_ptr film, , _frame_rate (node->optional_number_child("SubtitleFrameRate")) { if (version >= 32) { - _use_subtitles = node->bool_child ("UseSubtitles"); - _burn_subtitles = node->bool_child ("BurnSubtitles"); + _use = node->bool_child ("UseSubtitles"); + _burn = node->bool_child ("BurnSubtitles"); } if (version >= 7) { - _subtitle_x_offset = node->number_child ("SubtitleXOffset"); - _subtitle_y_offset = node->number_child ("SubtitleYOffset"); + _x_offset = node->number_child ("SubtitleXOffset"); + _y_offset = node->number_child ("SubtitleYOffset"); } else { - _subtitle_y_offset = node->number_child ("SubtitleOffset"); + _y_offset = node->number_child ("SubtitleOffset"); } if (version >= 10) { - _subtitle_x_scale = node->number_child ("SubtitleXScale"); - _subtitle_y_scale = node->number_child ("SubtitleYScale"); + _x_scale = node->number_child ("SubtitleXScale"); + _y_scale = node->number_child ("SubtitleYScale"); } else { - _subtitle_x_scale = _subtitle_y_scale = node->number_child ("SubtitleScale"); + _x_scale = _y_scale = node->number_child ("SubtitleScale"); } - _subtitle_language = node->optional_string_child ("SubtitleLanguage").get_value_or (""); + _language = node->optional_string_child ("SubtitleLanguage").get_value_or (""); list fonts = node->node_children ("Font"); for (list::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { @@ -126,27 +126,27 @@ SubtitleContent::SubtitleContent (Content* parent, shared_ptr film, for (size_t i = 1; i < c.size(); ++i) { - if (c[i]->subtitle->use_subtitles() != ref->use_subtitles()) { + if (c[i]->subtitle->use() != ref->use()) { throw JoinError (_("Content to be joined must have the same 'use subtitles' setting.")); } - if (c[i]->subtitle->burn_subtitles() != ref->burn_subtitles()) { + if (c[i]->subtitle->burn() != ref->burn()) { throw JoinError (_("Content to be joined must have the same 'burn subtitles' setting.")); } - if (c[i]->subtitle->subtitle_x_offset() != ref->subtitle_x_offset()) { + if (c[i]->subtitle->x_offset() != ref->x_offset()) { throw JoinError (_("Content to be joined must have the same subtitle X offset.")); } - if (c[i]->subtitle->subtitle_y_offset() != ref->subtitle_y_offset()) { + if (c[i]->subtitle->y_offset() != ref->y_offset()) { throw JoinError (_("Content to be joined must have the same subtitle Y offset.")); } - if (c[i]->subtitle->subtitle_x_scale() != ref->subtitle_x_scale()) { + if (c[i]->subtitle->x_scale() != ref->x_scale()) { throw JoinError (_("Content to be joined must have the same subtitle X scale.")); } - if (c[i]->subtitle->subtitle_y_scale() != ref->subtitle_y_scale()) { + if (c[i]->subtitle->y_scale() != ref->y_scale()) { throw JoinError (_("Content to be joined must have the same subtitle Y scale.")); } @@ -167,13 +167,13 @@ SubtitleContent::SubtitleContent (Content* parent, shared_ptr film, } } - _use_subtitles = ref->use_subtitles (); - _burn_subtitles = ref->burn_subtitles (); - _subtitle_x_offset = ref->subtitle_x_offset (); - _subtitle_y_offset = ref->subtitle_y_offset (); - _subtitle_x_scale = ref->subtitle_x_scale (); - _subtitle_y_scale = ref->subtitle_y_scale (); - _subtitle_language = ref->subtitle_language (); + _use = ref->use (); + _burn = ref->burn (); + _x_offset = ref->x_offset (); + _y_offset = ref->y_offset (); + _x_scale = ref->x_scale (); + _y_scale = ref->y_scale (); + _language = ref->language (); _fonts = ref_fonts; connect_to_fonts (); @@ -185,13 +185,13 @@ SubtitleContent::as_xml (xmlpp::Node* root) const { boost::mutex::scoped_lock lm (_mutex); - root->add_child("UseSubtitles")->add_child_text (raw_convert (_use_subtitles)); - root->add_child("BurnSubtitles")->add_child_text (raw_convert (_burn_subtitles)); - root->add_child("SubtitleXOffset")->add_child_text (raw_convert (_subtitle_x_offset)); - root->add_child("SubtitleYOffset")->add_child_text (raw_convert (_subtitle_y_offset)); - root->add_child("SubtitleXScale")->add_child_text (raw_convert (_subtitle_x_scale)); - root->add_child("SubtitleYScale")->add_child_text (raw_convert (_subtitle_y_scale)); - root->add_child("SubtitleLanguage")->add_child_text (_subtitle_language); + root->add_child("UseSubtitles")->add_child_text (raw_convert (_use)); + root->add_child("BurnSubtitles")->add_child_text (raw_convert (_burn)); + root->add_child("SubtitleXOffset")->add_child_text (raw_convert (_x_offset)); + root->add_child("SubtitleYOffset")->add_child_text (raw_convert (_y_offset)); + root->add_child("SubtitleXScale")->add_child_text (raw_convert (_x_scale)); + root->add_child("SubtitleYScale")->add_child_text (raw_convert (_y_scale)); + root->add_child("SubtitleLanguage")->add_child_text (_language); root->add_child("Red")->add_child_text (raw_convert (_colour.r)); root->add_child("Green")->add_child_text (raw_convert (_colour.g)); root->add_child("Blue")->add_child_text (raw_convert (_colour.b)); @@ -209,10 +209,10 @@ string SubtitleContent::identifier () const { SafeStringStream s; - s << raw_convert (subtitle_x_scale()) - << "_" << raw_convert (subtitle_y_scale()) - << "_" << raw_convert (subtitle_x_offset()) - << "_" << raw_convert (subtitle_y_offset()); + s << raw_convert (x_scale()) + << "_" << raw_convert (y_scale()) + << "_" << raw_convert (x_offset()) + << "_" << raw_convert (y_offset()); /* XXX: I suppose really _fonts shouldn't be in here, since not all types of subtitle content involve fonts. @@ -260,71 +260,71 @@ SubtitleContent::font_changed () void SubtitleContent::set_colour (dcp::Colour colour) { - maybe_set (_colour, colour, SubtitleContentProperty::SUBTITLE_COLOUR); + maybe_set (_colour, colour, SubtitleContentProperty::COLOUR); } void SubtitleContent::set_outline (bool o) { - maybe_set (_outline, o, SubtitleContentProperty::SUBTITLE_OUTLINE); + maybe_set (_outline, o, SubtitleContentProperty::OUTLINE); } void SubtitleContent::set_outline_colour (dcp::Colour colour) { - maybe_set (_outline_colour, colour, SubtitleContentProperty::SUBTITLE_OUTLINE_COLOUR); + maybe_set (_outline_colour, colour, SubtitleContentProperty::OUTLINE_COLOUR); } void -SubtitleContent::set_use_subtitles (bool u) +SubtitleContent::set_use (bool u) { - maybe_set (_use_subtitles, u, SubtitleContentProperty::USE_SUBTITLES); + maybe_set (_use, u, SubtitleContentProperty::USE); } void -SubtitleContent::set_burn_subtitles (bool b) +SubtitleContent::set_burn (bool b) { - maybe_set (_burn_subtitles, b, SubtitleContentProperty::BURN_SUBTITLES); + maybe_set (_burn, b, SubtitleContentProperty::BURN); } void -SubtitleContent::set_subtitle_x_offset (double o) +SubtitleContent::set_x_offset (double o) { - maybe_set (_subtitle_x_offset, o, SubtitleContentProperty::SUBTITLE_X_OFFSET); + maybe_set (_x_offset, o, SubtitleContentProperty::X_OFFSET); } void -SubtitleContent::set_subtitle_y_offset (double o) +SubtitleContent::set_y_offset (double o) { - maybe_set (_subtitle_y_offset, o, SubtitleContentProperty::SUBTITLE_Y_OFFSET); + maybe_set (_y_offset, o, SubtitleContentProperty::Y_OFFSET); } void -SubtitleContent::set_subtitle_x_scale (double s) +SubtitleContent::set_x_scale (double s) { - maybe_set (_subtitle_x_scale, s, SubtitleContentProperty::SUBTITLE_X_SCALE); + maybe_set (_x_scale, s, SubtitleContentProperty::X_SCALE); } void -SubtitleContent::set_subtitle_y_scale (double s) +SubtitleContent::set_y_scale (double s) { - maybe_set (_subtitle_y_scale, s, SubtitleContentProperty::SUBTITLE_Y_SCALE); + maybe_set (_y_scale, s, SubtitleContentProperty::Y_SCALE); } void -SubtitleContent::set_subtitle_language (string language) +SubtitleContent::set_language (string language) { - maybe_set (_subtitle_language, language, SubtitleContentProperty::SUBTITLE_LANGUAGE); + maybe_set (_language, language, SubtitleContentProperty::LANGUAGE); } void -SubtitleContent::set_subtitle_video_frame_rate (double r) +SubtitleContent::set_video_frame_rate (double r) { - maybe_set (_frame_rate, r, SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE); + maybe_set (_frame_rate, r, SubtitleContentProperty::VIDEO_FRAME_RATE); } double -SubtitleContent::subtitle_video_frame_rate () const +SubtitleContent::video_frame_rate () const { { boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/subtitle_content.h b/src/lib/subtitle_content.h index 0adb12c0d..cb61ad9a8 100644 --- a/src/lib/subtitle_content.h +++ b/src/lib/subtitle_content.h @@ -30,18 +30,18 @@ class Font; class SubtitleContentProperty { public: - static int const SUBTITLE_X_OFFSET; - static int const SUBTITLE_Y_OFFSET; - static int const SUBTITLE_X_SCALE; - static int const SUBTITLE_Y_SCALE; - static int const USE_SUBTITLES; - static int const BURN_SUBTITLES; - static int const SUBTITLE_LANGUAGE; + static int const X_OFFSET; + static int const Y_OFFSET; + static int const X_SCALE; + static int const Y_SCALE; + static int const USE; + static int const BURN; + static int const LANGUAGE; static int const FONTS; - static int const SUBTITLE_VIDEO_FRAME_RATE; - static int const SUBTITLE_COLOUR; - static int const SUBTITLE_OUTLINE; - static int const SUBTITLE_OUTLINE_COLOUR; + static int const VIDEO_FRAME_RATE; + static int const COLOUR; + static int const OUTLINE; + static int const OUTLINE_COLOUR; }; class SubtitleContent : public ContentPart @@ -61,42 +61,42 @@ public: void add_font (boost::shared_ptr font); - void set_use_subtitles (bool); - void set_burn_subtitles (bool); - void set_subtitle_x_offset (double); - void set_subtitle_y_offset (double); - void set_subtitle_x_scale (double); - void set_subtitle_y_scale (double); - void set_subtitle_language (std::string language); + void set_use (bool); + void set_burn (bool); + void set_x_offset (double); + void set_y_offset (double); + void set_x_scale (double); + void set_y_scale (double); + void set_language (std::string language); - bool use_subtitles () const { + bool use () const { boost::mutex::scoped_lock lm (_mutex); - return _use_subtitles; + return _use; } - bool burn_subtitles () const { + bool burn () const { boost::mutex::scoped_lock lm (_mutex); - return _burn_subtitles; + return _burn; } - double subtitle_x_offset () const { + double x_offset () const { boost::mutex::scoped_lock lm (_mutex); - return _subtitle_x_offset; + return _x_offset; } - double subtitle_y_offset () const { + double y_offset () const { boost::mutex::scoped_lock lm (_mutex); - return _subtitle_y_offset; + return _y_offset; } - double subtitle_x_scale () const { + double x_scale () const { boost::mutex::scoped_lock lm (_mutex); - return _subtitle_x_scale; + return _x_scale; } - double subtitle_y_scale () const { + double y_scale () const { boost::mutex::scoped_lock lm (_mutex); - return _subtitle_y_scale; + return _y_scale; } std::list > fonts () const { @@ -104,9 +104,9 @@ public: return _fonts; } - std::string subtitle_language () const { + std::string language () const { boost::mutex::scoped_lock lm (_mutex); - return _subtitle_language; + return _language; } void set_colour (dcp::Colour); @@ -130,32 +130,32 @@ public: return _outline_colour; } - double subtitle_video_frame_rate () const; - void set_subtitle_video_frame_rate (double r); + double video_frame_rate () const; + void set_video_frame_rate (double r); protected: /** subtitle language (e.g. "German") or empty if it is not known */ - std::string _subtitle_language; + std::string _language; private: friend struct ffmpeg_pts_offset_test; void font_changed (); void connect_to_fonts (); - bool _use_subtitles; - bool _burn_subtitles; + bool _use; + bool _burn; /** x offset for placing subtitles, as a proportion of the container width; * +ve is further right, -ve is further left. */ - double _subtitle_x_offset; + double _x_offset; /** y offset for placing subtitles, as a proportion of the container height; * +ve is further down the frame, -ve is further up. */ - double _subtitle_y_offset; + double _y_offset; /** x scale factor to apply to subtitles */ - double _subtitle_x_scale; + double _x_scale; /** y scale factor to apply to subtitles */ - double _subtitle_y_scale; + double _y_scale; std::list > _fonts; dcp::Colour _colour; bool _outline; diff --git a/src/lib/text_subtitle_content.cc b/src/lib/text_subtitle_content.cc index 79a225c47..0ad41114e 100644 --- a/src/lib/text_subtitle_content.cc +++ b/src/lib/text_subtitle_content.cc @@ -55,7 +55,7 @@ TextSubtitleContent::examine (boost::shared_ptr job) TextSubtitle s (shared_from_this ()); /* Default to turning these subtitles on */ - subtitle->set_use_subtitles (true); + subtitle->set_use (true); boost::mutex::scoped_lock lm (_mutex); _length = s.length (); @@ -86,6 +86,6 @@ TextSubtitleContent::as_xml (xmlpp::Node* node) const DCPTime TextSubtitleContent::full_length () const { - FrameRateChange const frc (subtitle->subtitle_video_frame_rate(), film()->video_frame_rate ()); + FrameRateChange const frc (subtitle->video_frame_rate(), film()->video_frame_rate ()); return DCPTime (_length, frc); } diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc index b7b056612..ba004d634 100644 --- a/src/lib/transcoder.cc +++ b/src/lib/transcoder.cc @@ -72,8 +72,8 @@ Transcoder::go () int burnt_subtitles = 0; int non_burnt_subtitles = 0; BOOST_FOREACH (shared_ptr c, _film->content ()) { - if (c->subtitle && c->subtitle->use_subtitles()) { - if (c->subtitle->burn_subtitles()) { + if (c->subtitle && c->subtitle->use()) { + if (c->subtitle->burn()) { ++burnt_subtitles; } else { ++non_burnt_subtitles; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 97d7d4343..0533a12e5 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -41,14 +41,14 @@ #define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL); -int const VideoContentProperty::VIDEO_SIZE = 0; -int const VideoContentProperty::VIDEO_FRAME_RATE = 1; -int const VideoContentProperty::VIDEO_FRAME_TYPE = 2; -int const VideoContentProperty::VIDEO_CROP = 3; -int const VideoContentProperty::VIDEO_SCALE = 4; +int const VideoContentProperty::SIZE = 0; +int const VideoContentProperty::FRAME_RATE = 1; +int const VideoContentProperty::FRAME_TYPE = 2; +int const VideoContentProperty::CROP = 3; +int const VideoContentProperty::SCALE = 4; int const VideoContentProperty::COLOUR_CONVERSION = 5; -int const VideoContentProperty::VIDEO_FADE_IN = 6; -int const VideoContentProperty::VIDEO_FADE_OUT = 7; +int const VideoContentProperty::FADE_IN = 6; +int const VideoContentProperty::FADE_OUT = 7; using std::string; using std::setprecision; @@ -66,8 +66,8 @@ using boost::dynamic_pointer_cast; VideoContent::VideoContent (Content* parent, shared_ptr film) : ContentPart (parent, film) - , _video_length (0) - , _video_frame_type (VIDEO_FRAME_TYPE_2D) + , _length (0) + , _frame_type (VIDEO_FRAME_TYPE_2D) , _scale (VideoContentScale (Ratio::from_id ("178"))) , _yuv (true) , _fade_in (0) @@ -79,11 +79,11 @@ VideoContent::VideoContent (Content* parent, shared_ptr film) VideoContent::VideoContent (Content* parent, shared_ptr film, cxml::ConstNodePtr node, int version) : ContentPart (parent, film) { - _video_size.width = node->number_child ("VideoWidth"); - _video_size.height = node->number_child ("VideoHeight"); - _video_frame_rate = node->optional_number_child ("VideoFrameRate"); - _video_length = node->number_child ("VideoLength"); - _video_frame_type = static_cast (node->number_child ("VideoFrameType")); + _size.width = node->number_child ("VideoWidth"); + _size.height = node->number_child ("VideoHeight"); + _frame_rate = node->optional_number_child ("VideoFrameRate"); + _length = node->number_child ("VideoLength"); + _frame_type = static_cast (node->number_child ("VideoFrameType")); _sample_aspect_ratio = node->optional_number_child ("SampleAspectRatio"); _crop.left = node->number_child ("LeftCrop"); _crop.right = node->number_child ("RightCrop"); @@ -116,7 +116,7 @@ VideoContent::VideoContent (Content* parent, shared_ptr film, cxml:: VideoContent::VideoContent (Content* parent, shared_ptr film, vector > c) : ContentPart (parent, film) - , _video_length (0) + , _length (0) , _yuv (false) { shared_ptr ref = c[0]->video; @@ -124,15 +124,15 @@ VideoContent::VideoContent (Content* parent, shared_ptr film, vector for (size_t i = 1; i < c.size(); ++i) { - if (c[i]->video->video_size() != ref->video_size()) { + if (c[i]->video->size() != ref->size()) { throw JoinError (_("Content to be joined must have the same picture size.")); } - if (c[i]->video->video_frame_rate() != ref->video_frame_rate()) { + if (c[i]->video->frame_rate() != ref->frame_rate()) { throw JoinError (_("Content to be joined must have the same video frame rate.")); } - if (c[i]->video->video_frame_type() != ref->video_frame_type()) { + if (c[i]->video->frame_type() != ref->frame_type()) { throw JoinError (_("Content to be joined must have the same video frame type.")); } @@ -152,16 +152,16 @@ VideoContent::VideoContent (Content* parent, shared_ptr film, vector throw JoinError (_("Content to be joined must have the same fades.")); } - _video_length += c[i]->video->video_length (); + _length += c[i]->video->length (); if (c[i]->video->yuv ()) { _yuv = true; } } - _video_size = ref->video_size (); - _video_frame_rate = ref->video_frame_rate (); - _video_frame_type = ref->video_frame_type (); + _size = ref->size (); + _frame_rate = ref->frame_rate (); + _frame_type = ref->frame_type (); _crop = ref->crop (); _scale = ref->scale (); _colour_conversion = ref->colour_conversion (); @@ -173,13 +173,13 @@ void VideoContent::as_xml (xmlpp::Node* node) const { boost::mutex::scoped_lock lm (_mutex); - node->add_child("VideoLength")->add_child_text (raw_convert (_video_length)); - node->add_child("VideoWidth")->add_child_text (raw_convert (_video_size.width)); - node->add_child("VideoHeight")->add_child_text (raw_convert (_video_size.height)); - if (_video_frame_rate) { - node->add_child("VideoFrameRate")->add_child_text (raw_convert (_video_frame_rate.get())); + node->add_child("VideoLength")->add_child_text (raw_convert (_length)); + node->add_child("VideoWidth")->add_child_text (raw_convert (_size.width)); + node->add_child("VideoHeight")->add_child_text (raw_convert (_size.height)); + if (_frame_rate) { + node->add_child("VideoFrameRate")->add_child_text (raw_convert (_frame_rate.get())); } - node->add_child("VideoFrameType")->add_child_text (raw_convert (static_cast (_video_frame_type))); + node->add_child("VideoFrameType")->add_child_text (raw_convert (static_cast (_frame_type))); if (_sample_aspect_ratio) { node->add_child("SampleAspectRatio")->add_child_text (raw_convert (_sample_aspect_ratio.get ())); } @@ -194,7 +194,7 @@ VideoContent::as_xml (xmlpp::Node* node) const } void -VideoContent::take_from_video_examiner (shared_ptr d) +VideoContent::take_from_examiner (shared_ptr d) { /* These examiner calls could call other content methods which take a lock on the mutex */ dcp::Size const vs = d->video_size (); @@ -205,25 +205,25 @@ VideoContent::take_from_video_examiner (shared_ptr d) { boost::mutex::scoped_lock lm (_mutex); - _video_size = vs; - _video_frame_rate = vfr; - _video_length = vl; + _size = vs; + _frame_rate = vfr; + _length = vl; _sample_aspect_ratio = ar; _yuv = yuv; /* Guess correct scale from size and sample aspect ratio */ _scale = VideoContentScale ( - Ratio::nearest_from_ratio (double (_video_size.width) * ar.get_value_or (1) / _video_size.height) + Ratio::nearest_from_ratio (double (_size.width) * ar.get_value_or (1) / _size.height) ); } shared_ptr film = _film.lock (); DCPOMATIC_ASSERT (film); - LOG_GENERAL ("Video length obtained from header as %1 frames", _video_length); + LOG_GENERAL ("Video length obtained from header as %1 frames", _length); - _parent->signal_changed (VideoContentProperty::VIDEO_SIZE); - _parent->signal_changed (VideoContentProperty::VIDEO_FRAME_RATE); - _parent->signal_changed (VideoContentProperty::VIDEO_SCALE); + _parent->signal_changed (VideoContentProperty::SIZE); + _parent->signal_changed (VideoContentProperty::FRAME_RATE); + _parent->signal_changed (VideoContentProperty::SCALE); _parent->signal_changed (ContentProperty::LENGTH); } @@ -252,10 +252,10 @@ VideoContent::technical_summary () const { string s = String::compose ( N_("video: length %1 frames, size %2x%3, rate %4"), - video_length_after_3d_combine(), - video_size().width, - video_size().height, - video_frame_rate() + length_after_3d_combine(), + size().width, + size().height, + frame_rate() ); if (sample_aspect_ratio ()) { @@ -266,10 +266,10 @@ VideoContent::technical_summary () const } dcp::Size -VideoContent::video_size_after_3d_split () const +VideoContent::size_after_3d_split () const { - dcp::Size const s = video_size (); - switch (video_frame_type ()) { + dcp::Size const s = size (); + switch (frame_type ()) { case VIDEO_FRAME_TYPE_2D: case VIDEO_FRAME_TYPE_3D_ALTERNATE: case VIDEO_FRAME_TYPE_3D_LEFT: @@ -286,9 +286,9 @@ VideoContent::video_size_after_3d_split () const /** @return Video size after 3D split and crop */ dcp::Size -VideoContent::video_size_after_crop () const +VideoContent::size_after_crop () const { - return crop().apply (video_size_after_3d_split ()); + return crop().apply (size_after_3d_split ()); } void @@ -298,7 +298,7 @@ VideoContent::scale_and_crop_to_fit_width () DCPOMATIC_ASSERT (film); set_scale (VideoContentScale (film->container ())); - int const crop = max (0, int (video_size().height - double (film->frame_size().height) * video_size().width / film->frame_size().width)); + int const crop = max (0, int (size().height - double (film->frame_size().height) * size().width / film->frame_size().width)); set_left_crop (0); set_right_crop (0); set_top_crop (crop / 2); @@ -312,7 +312,7 @@ VideoContent::scale_and_crop_to_fit_height () DCPOMATIC_ASSERT (film); set_scale (VideoContentScale (film->container ())); - int const crop = max (0, int (video_size().width - double (film->frame_size().width) * video_size().height / film->frame_size().height)); + int const crop = max (0, int (size().width - double (film->frame_size().width) * size().height / film->frame_size().height)); set_left_crop (crop / 2); set_right_crop (crop / 2); set_top_crop (0); @@ -325,12 +325,12 @@ VideoContent::fade (Frame f) const { DCPOMATIC_ASSERT (f >= 0); - Frame const ts = _parent->trim_start().frames_round(video_frame_rate()); + Frame const ts = _parent->trim_start().frames_round(frame_rate()); if ((f - ts) < fade_in()) { return double (f - ts) / fade_in(); } - Frame fade_out_start = video_length() - _parent->trim_end().frames_round(video_frame_rate()) - fade_out(); + Frame fade_out_start = length() - _parent->trim_end().frames_round(frame_rate()) - fade_out(); if (f >= fade_out_start) { return 1 - double (f - fade_out_start) / fade_out(); } @@ -344,15 +344,15 @@ VideoContent::processing_description () const /* stringstream is OK here as this string is just for presentation to the user */ SafeStringStream d; - if (video_size().width && video_size().height) { + if (size().width && size().height) { d << String::compose ( _("Content video is %1x%2"), - video_size_after_3d_split().width, - video_size_after_3d_split().height + size_after_3d_split().width, + size_after_3d_split().height ); - double ratio = video_size_after_3d_split().ratio (); + double ratio = size_after_3d_split().ratio (); if (sample_aspect_ratio ()) { d << ", " << _("pixel aspect ratio") << " " << fixed << setprecision(2) << sample_aspect_ratio().get () << ":1"; @@ -362,8 +362,8 @@ VideoContent::processing_description () const d << "\n" << _("Display aspect ratio") << " " << fixed << setprecision(2) << ratio << ":1\n"; } - if ((crop().left || crop().right || crop().top || crop().bottom) && video_size() != dcp::Size (0, 0)) { - dcp::Size cropped = video_size_after_crop (); + if ((crop().left || crop().right || crop().top || crop().bottom) && size() != dcp::Size (0, 0)) { + dcp::Size cropped = size_after_crop (); d << String::compose ( _("Cropped to %1x%2"), cropped.width, cropped.height @@ -377,7 +377,7 @@ VideoContent::processing_description () const dcp::Size const container_size = film->frame_size (); dcp::Size const scaled = scale().size (shared_from_this(), container_size, container_size); - if (scaled != video_size_after_crop ()) { + if (scaled != size_after_crop ()) { d << String::compose ( _("Scaled to %1x%2"), scaled.width, scaled.height @@ -397,9 +397,9 @@ VideoContent::processing_description () const } d << _("Content frame rate"); - d << " " << fixed << setprecision(4) << video_frame_rate() << "\n"; + d << " " << fixed << setprecision(4) << frame_rate() << "\n"; - FrameRateChange frc (video_frame_rate(), film->video_frame_rate ()); + FrameRateChange frc (frame_rate(), film->video_frame_rate ()); d << frc.description () << "\n"; return d.str (); @@ -408,66 +408,66 @@ VideoContent::processing_description () const void VideoContent::add_properties (list& p) const { - p.push_back (UserProperty (_("Video"), _("Length"), raw_convert (video_length ()), _("video frames"))); - p.push_back (UserProperty (_("Video"), _("Size"), raw_convert (video_size().width) + "x" + raw_convert (video_size().height))); - p.push_back (UserProperty (_("Video"), _("Frame rate"), raw_convert (video_frame_rate(), 5), _("frames per second"))); + p.push_back (UserProperty (_("Video"), _("Length"), raw_convert (length ()), _("video frames"))); + p.push_back (UserProperty (_("Video"), _("Size"), raw_convert (size().width) + "x" + raw_convert (size().height))); + p.push_back (UserProperty (_("Video"), _("Frame rate"), raw_convert (frame_rate(), 5), _("frames per second"))); } double -VideoContent::video_frame_rate () const +VideoContent::frame_rate () const { boost::mutex::scoped_lock lm (_mutex); shared_ptr film = _film.lock (); DCPOMATIC_ASSERT (film); - return _video_frame_rate.get_value_or (film->video_frame_rate ()); + return _frame_rate.get_value_or (film->video_frame_rate ()); } void -VideoContent::set_video_length (Frame len) +VideoContent::set_length (Frame len) { - maybe_set (_video_length, len, ContentProperty::LENGTH); + maybe_set (_length, len, ContentProperty::LENGTH); } void VideoContent::set_left_crop (int c) { - maybe_set (_crop.left, c, VideoContentProperty::VIDEO_CROP); + maybe_set (_crop.left, c, VideoContentProperty::CROP); } void VideoContent::set_right_crop (int c) { - maybe_set (_crop.right, c, VideoContentProperty::VIDEO_CROP); + maybe_set (_crop.right, c, VideoContentProperty::CROP); } void VideoContent::set_top_crop (int c) { - maybe_set (_crop.top, c, VideoContentProperty::VIDEO_CROP); + maybe_set (_crop.top, c, VideoContentProperty::CROP); } void VideoContent::set_bottom_crop (int c) { - maybe_set (_crop.bottom, c, VideoContentProperty::VIDEO_CROP); + maybe_set (_crop.bottom, c, VideoContentProperty::CROP); } void VideoContent::set_scale (VideoContentScale s) { - maybe_set (_scale, s, VideoContentProperty::VIDEO_SCALE); + maybe_set (_scale, s, VideoContentProperty::SCALE); } void -VideoContent::set_video_frame_rate (double r) +VideoContent::set_frame_rate (double r) { - maybe_set (_video_frame_rate, r, VideoContentProperty::VIDEO_FRAME_RATE); + maybe_set (_frame_rate, r, VideoContentProperty::FRAME_RATE); } void -VideoContent::set_video_frame_type (VideoFrameType t) +VideoContent::set_frame_type (VideoFrameType t) { - maybe_set (_video_frame_type, t, VideoContentProperty::VIDEO_FRAME_TYPE); + maybe_set (_frame_type, t, VideoContentProperty::FRAME_TYPE); } void @@ -485,11 +485,11 @@ VideoContent::set_colour_conversion (ColourConversion c) void VideoContent::set_fade_in (Frame t) { - maybe_set (_fade_in, t, VideoContentProperty::VIDEO_FADE_IN); + maybe_set (_fade_in, t, VideoContentProperty::FADE_IN); } void VideoContent::set_fade_out (Frame t) { - maybe_set (_fade_out, t, VideoContentProperty::VIDEO_FADE_OUT); + maybe_set (_fade_out, t, VideoContentProperty::FADE_OUT); } diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 0348969ae..432775651 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -38,14 +38,14 @@ class Content; class VideoContentProperty { public: - static int const VIDEO_SIZE; - static int const VIDEO_FRAME_RATE; - static int const VIDEO_FRAME_TYPE; - static int const VIDEO_CROP; - static int const VIDEO_SCALE; + static int const SIZE; + static int const FRAME_RATE; + static int const FRAME_TYPE; + static int const CROP; + static int const SCALE; static int const COLOUR_CONVERSION; - static int const VIDEO_FADE_IN; - static int const VIDEO_FADE_OUT; + static int const FADE_IN; + static int const FADE_OUT; }; class VideoContent : public ContentPart, public boost::enable_shared_from_this @@ -59,37 +59,37 @@ public: std::string technical_summary () const; std::string identifier () const; - Frame video_length () const { + Frame length () const { boost::mutex::scoped_lock lm (_mutex); - return _video_length; + return _length; } - Frame video_length_after_3d_combine () const { + Frame length_after_3d_combine () const { boost::mutex::scoped_lock lm (_mutex); - if (_video_frame_type == VIDEO_FRAME_TYPE_3D_ALTERNATE) { - return _video_length / 2; + if (_frame_type == VIDEO_FRAME_TYPE_3D_ALTERNATE) { + return _length / 2; } - return _video_length; + return _length; } - dcp::Size video_size () const { + dcp::Size size () const { boost::mutex::scoped_lock lm (_mutex); - return _video_size; + return _size; } - double video_frame_rate () const; + double frame_rate () const; /** @return true if this content has a specific video frame rate, false * if it should use the DCP's rate. */ - bool has_own_video_frame_rate () const { + bool has_own_frame_rate () const { boost::mutex::scoped_lock lm (_mutex); - return static_cast(_video_frame_rate); + return static_cast(_frame_rate); } - void set_video_frame_type (VideoFrameType); - void set_video_frame_rate (double); + void set_frame_type (VideoFrameType); + void set_frame_rate (double); void set_left_crop (int); void set_right_crop (int); @@ -103,9 +103,9 @@ public: void set_fade_in (Frame); void set_fade_out (Frame); - VideoFrameType video_frame_type () const { + VideoFrameType frame_type () const { boost::mutex::scoped_lock lm (_mutex); - return _video_frame_type; + return _frame_type; } Crop crop () const { @@ -164,10 +164,8 @@ public: return _fade_out; } - dcp::Size video_size_after_3d_split () const; - dcp::Size video_size_after_crop () const; - - ContentTime dcp_time_to_content_time (DCPTime) const; + dcp::Size size_after_3d_split () const; + dcp::Size size_after_crop () const; boost::optional fade (Frame) const; @@ -176,18 +174,13 @@ public: std::string processing_description () const; - void set_video_length (Frame); + void set_length (Frame); - void take_from_video_examiner (boost::shared_ptr); + void take_from_examiner (boost::shared_ptr); void add_properties (std::list &) const; private: - Frame _video_length; - /** Video frame rate, or not set if this content should use the DCP's frame rate */ - boost::optional _video_frame_rate; - boost::optional _colour_conversion; - friend struct ffmpeg_pts_offset_test; friend struct best_dcp_frame_rate_test_single; friend struct best_dcp_frame_rate_test_double; @@ -195,13 +188,15 @@ private: void setup_default_colour_conversion (); - dcp::Size _video_size; - VideoFrameType _video_frame_type; + Frame _length; + /** Video frame rate, or not set if this content should use the DCP's frame rate */ + boost::optional _frame_rate; + boost::optional _colour_conversion; + dcp::Size _size; + VideoFrameType _frame_type; Crop _crop; VideoContentScale _scale; - /** Sample aspect ratio obtained from the content file's header, - if there is one. - */ + /** Sample aspect ratio obtained from the content file's header, if there is one */ boost::optional _sample_aspect_ratio; bool _yuv; Frame _fade_in; diff --git a/src/lib/video_content_scale.cc b/src/lib/video_content_scale.cc index 775b3d9b7..3e67b82f6 100644 --- a/src/lib/video_content_scale.cc +++ b/src/lib/video_content_scale.cc @@ -132,7 +132,7 @@ VideoContentScale::size (shared_ptr c, dcp::Size display_con { /* Work out the size of the content if it were put inside film_container */ - dcp::Size const video_size_after_crop = c->video_size_after_crop (); + dcp::Size const video_size_after_crop = c->size_after_crop (); dcp::Size size; diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index f68f0815c..08f79c3d8 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -45,7 +45,7 @@ VideoDecoder::VideoDecoder (shared_ptr c, shared_ptr lo , _last_seek_accurate (true) , _ignore_video (false) { - _black_image.reset (new Image (AV_PIX_FMT_RGB24, _video_content->video_size(), true)); + _black_image.reset (new Image (AV_PIX_FMT_RGB24, _video_content->size(), true)); _black_image->make_black (); } @@ -83,7 +83,7 @@ VideoDecoder::get_video (Frame frame, bool accurate) _log->log (String::compose ("VD has request for %1", frame), LogEntry::TYPE_DEBUG_DECODE); if (_decoded_video.empty() || frame < _decoded_video.front().frame || frame > (_decoded_video.back().frame + 1)) { - seek (ContentTime::from_frames (frame, _video_content->video_frame_rate()), accurate); + seek (ContentTime::from_frames (frame, _video_content->frame_rate()), accurate); } list dec; @@ -257,7 +257,7 @@ VideoDecoder::video (shared_ptr image, Frame frame) /* Work out what we are going to push into _decoded_video next */ list to_push; - switch (_video_content->video_frame_type ()) { + switch (_video_content->frame_type ()) { case VIDEO_FRAME_TYPE_2D: to_push.push_back (ContentVideo (image, EYES_BOTH, PART_WHOLE, frame)); break; @@ -297,7 +297,7 @@ VideoDecoder::video (shared_ptr image, Frame frame) optional to; if (_decoded_video.empty() && _last_seek_time && _last_seek_accurate) { - from = _last_seek_time->frames_round (_video_content->video_frame_rate ()); + from = _last_seek_time->frames_round (_video_content->frame_rate ()); to = to_push.front().frame; } else if (!_decoded_video.empty ()) { from = _decoded_video.back().frame + 1; @@ -313,7 +313,7 @@ VideoDecoder::video (shared_ptr image, Frame frame) } if (from) { - switch (_video_content->video_frame_type ()) { + switch (_video_content->frame_type ()) { case VIDEO_FRAME_TYPE_2D: fill_one_eye (from.get(), to.get (), EYES_BOTH); break; diff --git a/src/lib/video_examiner.h b/src/lib/video_examiner.h index 3c8f71757..1a551a5c0 100644 --- a/src/lib/video_examiner.h +++ b/src/lib/video_examiner.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington + Copyright (C) 2013-2016 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index 63dd7f45e..8809a712f 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -85,8 +85,8 @@ print_dump (shared_ptr film) << " end trim " << c->trim_end().seconds () << "\n"; if (c->video) { - cout << "\t" << c->video->video_size().width << "x" << c->video->video_size().height << "\n" - << "\t" << c->video->video_frame_rate() << "fps\n" + cout << "\t" << c->video->size().width << "x" << c->video->size().height << "\n" + << "\t" << c->video->frame_rate() << "fps\n" << "\tcrop left " << c->video->left_crop() << " right " << c->video->right_crop() << " top " << c->video->top_crop() @@ -107,8 +107,8 @@ print_dump (shared_ptr film) } if (c->audio) { - cout << "\t" << c->audio->audio_delay() << " delay\n" - << "\t" << c->audio->audio_gain() << " gain\n"; + cout << "\t" << c->audio->delay() << " delay\n" + << "\t" << c->audio->gain() << " gain\n"; } } } diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 0e5bee70a..68ae377db 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -231,7 +231,7 @@ main (int argc, char* argv[]) for (ContentList::iterator i = content.begin(); i != content.end(); ++i) { shared_ptr ic = dynamic_pointer_cast (*i); if (ic) { - ic->video->set_video_length (still_length * 24); + ic->video->set_length (still_length * 24); } } diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index 2120c3a1f..a1354e9f8 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -239,9 +239,9 @@ AudioDialog::channel_clicked (wxCommandEvent& ev) void AudioDialog::content_changed (int p) { - if (p == AudioContentProperty::AUDIO_STREAMS) { + if (p == AudioContentProperty::STREAMS) { try_to_load_analysis (); - } else if (p == AudioContentProperty::AUDIO_GAIN) { + } else if (p == AudioContentProperty::GAIN) { if (_playlist->content().size() == 1 && _analysis) { /* We can use a short-cut to render the effect of this change, rather than recalculating everything. diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index a41e428ec..f6a29da2a 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -65,10 +65,10 @@ AudioPanel::AudioPanel (ContentPanel* p) _gain = new ContentSpinCtrlDouble ( this, new wxSpinCtrlDouble (this), - AudioContentProperty::AUDIO_GAIN, + AudioContentProperty::GAIN, &Content::audio, - boost::mem_fn (&AudioContent::audio_gain), - boost::mem_fn (&AudioContent::set_audio_gain) + boost::mem_fn (&AudioContent::gain), + boost::mem_fn (&AudioContent::set_gain) ); _gain->add (grid, wxGBPosition (r, 1)); @@ -81,10 +81,10 @@ AudioPanel::AudioPanel (ContentPanel* p) _delay = new ContentSpinCtrl ( this, new wxSpinCtrl (this), - AudioContentProperty::AUDIO_DELAY, + AudioContentProperty::DELAY, &Content::audio, - boost::mem_fn (&AudioContent::audio_delay), - boost::mem_fn (&AudioContent::set_audio_delay) + boost::mem_fn (&AudioContent::delay), + boost::mem_fn (&AudioContent::set_delay) ); _delay->add (grid, wxGBPosition (r, 1)); @@ -149,17 +149,17 @@ void AudioPanel::film_content_changed (int property) { ContentList ac = _parent->selected_audio (); - if (property == AudioContentProperty::AUDIO_STREAMS) { + if (property == AudioContentProperty::STREAMS) { if (ac.size() == 1) { - _mapping->set (ac.front()->audio->audio_mapping()); - _mapping->set_input_channels (ac.front()->audio->audio_channel_names ()); + _mapping->set (ac.front()->audio->mapping()); + _mapping->set_input_channels (ac.front()->audio->channel_names ()); } else { _mapping->set (AudioMapping ()); } setup_description (); setup_peak (); _sizer->Layout (); - } else if (property == AudioContentProperty::AUDIO_GAIN) { + } else if (property == AudioContentProperty::GAIN) { setup_peak (); } else if (property == DCPContentProperty::REFERENCE_AUDIO) { if (ac.size() == 1) { @@ -218,7 +218,7 @@ AudioPanel::mapping_changed (AudioMapping m) { ContentList c = _parent->selected_audio (); if (c.size() == 1) { - c.front()->audio->set_audio_mapping (m); + c.front()->audio->set_mapping (m); } } @@ -230,7 +230,7 @@ AudioPanel::content_selection_changed () _gain->set_content (sel); _delay->set_content (sel); - film_content_changed (AudioContentProperty::AUDIO_STREAMS); + film_content_changed (AudioContentProperty::STREAMS); film_content_changed (DCPContentProperty::REFERENCE_AUDIO); setup_sensitivity (); diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index f2e00ea42..21bbc0fb0 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -206,9 +206,9 @@ ContentMenu::remove () } if (!video && audio) { - AudioMapping m = fc->audio->audio_mapping (); + AudioMapping m = fc->audio->mapping (); m.unmap_all (); - fc->audio->set_audio_mapping (m); + fc->audio->set_mapping (m); handled = true; } } diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 36f0a6bb2..a591c72b3 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -334,7 +334,7 @@ ContentPanel::add_folder_clicked () return; } - ic->video->set_video_frame_rate (frame_rate); + ic->video->set_frame_rate (frame_rate); } _film->examine_and_add_content (content); diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 30657f841..ad6b6a9e0 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -427,10 +427,10 @@ DCPPanel::film_changed (int p) void DCPPanel::film_content_changed (int property) { - if (property == AudioContentProperty::AUDIO_STREAMS || - property == SubtitleContentProperty::USE_SUBTITLES || - property == SubtitleContentProperty::BURN_SUBTITLES || - property == VideoContentProperty::VIDEO_SCALE || + if (property == AudioContentProperty::STREAMS || + property == SubtitleContentProperty::USE || + property == SubtitleContentProperty::BURN || + property == VideoContentProperty::SCALE || property == DCPContentProperty::REFERENCE_VIDEO || property == DCPContentProperty::REFERENCE_AUDIO || property == DCPContentProperty::REFERENCE_SUBTITLE) { diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 1c49a2068..e328661c6 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -160,7 +160,7 @@ HintsDialog::film_changed () int three_d = 0; BOOST_FOREACH (shared_ptr i, content) { - if (i->video && i->video->video_frame_type() != VIDEO_FRAME_TYPE_2D) { + if (i->video && i->video->frame_type() != VIDEO_FRAME_TYPE_2D) { ++three_d; } } diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc index 6b910afae..3a0063c95 100644 --- a/src/wx/subtitle_panel.cc +++ b/src/wx/subtitle_panel.cc @@ -185,21 +185,21 @@ SubtitlePanel::film_content_changed (int property) } } setup_sensitivity (); - } else if (property == SubtitleContentProperty::USE_SUBTITLES) { - checked_set (_use, scs ? scs->subtitle->use_subtitles() : false); + } else if (property == SubtitleContentProperty::USE) { + checked_set (_use, scs ? scs->subtitle->use() : false); setup_sensitivity (); - } else if (property == SubtitleContentProperty::BURN_SUBTITLES) { - checked_set (_burn, scs ? scs->subtitle->burn_subtitles() : false); - } else if (property == SubtitleContentProperty::SUBTITLE_X_OFFSET) { - checked_set (_x_offset, scs ? lrint (scs->subtitle->subtitle_x_offset() * 100) : 0); - } else if (property == SubtitleContentProperty::SUBTITLE_Y_OFFSET) { - checked_set (_y_offset, scs ? lrint (scs->subtitle->subtitle_y_offset() * 100) : 0); - } else if (property == SubtitleContentProperty::SUBTITLE_X_SCALE) { - checked_set (_x_scale, scs ? lrint (scs->subtitle->subtitle_x_scale() * 100) : 100); - } else if (property == SubtitleContentProperty::SUBTITLE_Y_SCALE) { - checked_set (_y_scale, scs ? lrint (scs->subtitle->subtitle_y_scale() * 100) : 100); - } else if (property == SubtitleContentProperty::SUBTITLE_LANGUAGE) { - checked_set (_language, scs ? scs->subtitle->subtitle_language() : ""); + } else if (property == SubtitleContentProperty::BURN) { + checked_set (_burn, scs ? scs->subtitle->burn() : false); + } else if (property == SubtitleContentProperty::X_OFFSET) { + checked_set (_x_offset, scs ? lrint (scs->subtitle->x_offset() * 100) : 0); + } else if (property == SubtitleContentProperty::Y_OFFSET) { + checked_set (_y_offset, scs ? lrint (scs->subtitle->y_offset() * 100) : 0); + } else if (property == SubtitleContentProperty::X_SCALE) { + checked_set (_x_scale, scs ? lrint (scs->subtitle->x_scale() * 100) : 100); + } else if (property == SubtitleContentProperty::Y_SCALE) { + checked_set (_y_scale, scs ? lrint (scs->subtitle->y_scale() * 100) : 100); + } else if (property == SubtitleContentProperty::LANGUAGE) { + checked_set (_language, scs ? scs->subtitle->language() : ""); } else if (property == DCPContentProperty::REFERENCE_SUBTITLE) { if (scs) { shared_ptr dcp = dynamic_pointer_cast (scs); @@ -216,7 +216,7 @@ void SubtitlePanel::use_toggled () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_use_subtitles (_use->GetValue()); + i->subtitle->set_use (_use->GetValue()); } } @@ -224,7 +224,7 @@ void SubtitlePanel::burn_toggled () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_burn_subtitles (_burn->GetValue()); + i->subtitle->set_burn (_burn->GetValue()); } } @@ -259,7 +259,7 @@ SubtitlePanel::setup_sensitivity () if (i->subtitle->has_image_subtitles ()) { ++image_subs; /* We must burn image subtitles at the moment */ - i->subtitle->set_burn_subtitles (true); + i->subtitle->set_burn (true); } } @@ -314,7 +314,7 @@ void SubtitlePanel::x_offset_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_subtitle_x_offset (_x_offset->GetValue() / 100.0); + i->subtitle->set_x_offset (_x_offset->GetValue() / 100.0); } } @@ -322,7 +322,7 @@ void SubtitlePanel::y_offset_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_subtitle_y_offset (_y_offset->GetValue() / 100.0); + i->subtitle->set_y_offset (_y_offset->GetValue() / 100.0); } } @@ -331,7 +331,7 @@ SubtitlePanel::x_scale_changed () { ContentList c = _parent->selected_subtitle (); if (c.size() == 1) { - c.front()->subtitle->set_subtitle_x_scale (_x_scale->GetValue() / 100.0); + c.front()->subtitle->set_x_scale (_x_scale->GetValue() / 100.0); } } @@ -339,7 +339,7 @@ void SubtitlePanel::y_scale_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_subtitle_y_scale (_y_scale->GetValue() / 100.0); + i->subtitle->set_y_scale (_y_scale->GetValue() / 100.0); } } @@ -347,7 +347,7 @@ void SubtitlePanel::language_changed () { BOOST_FOREACH (shared_ptr i, _parent->selected_subtitle ()) { - i->subtitle->set_subtitle_language (wx_to_std (_language->GetValue())); + i->subtitle->set_language (wx_to_std (_language->GetValue())); } } @@ -355,13 +355,13 @@ void SubtitlePanel::content_selection_changed () { film_content_changed (FFmpegContentProperty::SUBTITLE_STREAMS); - film_content_changed (SubtitleContentProperty::USE_SUBTITLES); - film_content_changed (SubtitleContentProperty::BURN_SUBTITLES); - film_content_changed (SubtitleContentProperty::SUBTITLE_X_OFFSET); - film_content_changed (SubtitleContentProperty::SUBTITLE_Y_OFFSET); - film_content_changed (SubtitleContentProperty::SUBTITLE_X_SCALE); - film_content_changed (SubtitleContentProperty::SUBTITLE_Y_SCALE); - film_content_changed (SubtitleContentProperty::SUBTITLE_LANGUAGE); + film_content_changed (SubtitleContentProperty::USE); + film_content_changed (SubtitleContentProperty::BURN); + film_content_changed (SubtitleContentProperty::X_OFFSET); + film_content_changed (SubtitleContentProperty::Y_OFFSET); + film_content_changed (SubtitleContentProperty::X_SCALE); + film_content_changed (SubtitleContentProperty::Y_SCALE); + film_content_changed (SubtitleContentProperty::LANGUAGE); film_content_changed (SubtitleContentProperty::FONTS); film_content_changed (DCPContentProperty::REFERENCE_SUBTITLE); } diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index f9fd16578..08029068f 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -149,7 +149,7 @@ Timeline::recreate_views () _views.push_back (shared_ptr (new TimelineVideoContentView (*this, i))); } - if (i->audio && !i->audio->audio_mapping().mapped_output_channels().empty ()) { + if (i->audio && !i->audio->mapping().mapped_output_channels().empty ()) { _views.push_back (shared_ptr (new TimelineAudioContentView (*this, i))); } @@ -168,7 +168,7 @@ Timeline::film_content_changed (int property, bool frequent) { ensure_ui_thread (); - if (property == AudioContentProperty::AUDIO_STREAMS) { + if (property == AudioContentProperty::STREAMS) { recreate_views (); } else if (!frequent) { setup_pixels_per_second (); diff --git a/src/wx/timeline_subtitle_content_view.cc b/src/wx/timeline_subtitle_content_view.cc index 83360ac42..c28ac93ef 100644 --- a/src/wx/timeline_subtitle_content_view.cc +++ b/src/wx/timeline_subtitle_content_view.cc @@ -54,5 +54,5 @@ TimelineSubtitleContentView::active () const { shared_ptr c = _content.lock (); DCPOMATIC_ASSERT (c); - return c->subtitle && c->subtitle->use_subtitles(); + return c->subtitle && c->subtitle->use(); } diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 573d76f48..191106471 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -210,10 +210,10 @@ TimingPanel::film_content_changed (int property) } else if ( property == ContentProperty::LENGTH || - property == VideoContentProperty::VIDEO_FRAME_RATE || - property == VideoContentProperty::VIDEO_FRAME_TYPE || - property == AudioContentProperty::AUDIO_VIDEO_FRAME_RATE || - property == SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE + property == VideoContentProperty::FRAME_RATE || + property == VideoContentProperty::FRAME_TYPE || + property == AudioContentProperty::VIDEO_FRAME_RATE || + property == SubtitleContentProperty::VIDEO_FRAME_RATE ) { update_full_length (); @@ -249,16 +249,16 @@ TimingPanel::film_content_changed (int property) property == ContentProperty::LENGTH || property == ContentProperty::TRIM_START || property == ContentProperty::TRIM_END || - property == VideoContentProperty::VIDEO_FRAME_RATE || - property == VideoContentProperty::VIDEO_FRAME_TYPE || - property == AudioContentProperty::AUDIO_VIDEO_FRAME_RATE || - property == SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE + property == VideoContentProperty::FRAME_RATE || + property == VideoContentProperty::FRAME_TYPE || + property == AudioContentProperty::VIDEO_FRAME_RATE || + property == SubtitleContentProperty::VIDEO_FRAME_RATE ) { update_play_length (); } - if (property == VideoContentProperty::VIDEO_FRAME_RATE || property == SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE) { + if (property == VideoContentProperty::FRAME_RATE || property == SubtitleContentProperty::VIDEO_FRAME_RATE) { set check_vc; shared_ptr vc; int count_ac = 0; @@ -267,7 +267,7 @@ TimingPanel::film_content_changed (int property) shared_ptr sc; BOOST_FOREACH (shared_ptr i, _parent->selected ()) { if (i->video) { - check_vc.insert (i->video->video_frame_rate ()); + check_vc.insert (i->video->frame_rate ()); vc = i; } shared_ptr at = dynamic_pointer_cast (i); @@ -288,9 +288,9 @@ TimingPanel::film_content_changed (int property) if (vc) { checked_set (_video_frame_rate, raw_convert (vc->video->video_frame_rate (), 5)); } else if (ac) { - checked_set (_video_frame_rate, raw_convert (ac->audio->audio_video_frame_rate (), 5)); + checked_set (_video_frame_rate, raw_convert (ac->audio->video_frame_rate (), 5)); } else if (sc) { - checked_set (_video_frame_rate, raw_convert (sc->subtitle->subtitle_video_frame_rate (), 5)); + checked_set (_video_frame_rate, raw_convert (sc->subtitle->video_frame_rate (), 5)); } _video_frame_rate->Enable (true); } else { @@ -328,7 +328,7 @@ TimingPanel::full_length_changed () shared_ptr ic = dynamic_pointer_cast (i); if (ic && ic->still ()) { int const vfr = _parent->film()->video_frame_rate (); - ic->video->set_video_length (_full_length->get (vfr).frames_round (vfr)); + ic->video->set_length (_full_length->get (vfr).frames_round (vfr)); } } } @@ -407,14 +407,14 @@ TimingPanel::set_video_frame_rate () shared_ptr tsc = dynamic_pointer_cast (i); double const fr = raw_convert (wx_to_std (_video_frame_rate->GetValue ())); if (i->video) { - i->video->set_video_frame_rate (fr); + i->video->set_frame_rate (fr); } else if (i->audio) { /* Audio but not video, i.e. SndfileContent */ i->audio->set_audio_video_frame_rate (fr); } else if (dsc) { - dsc->set_subtitle_video_frame_rate (fr); + dsc->subtitle->set_video_frame_rate (fr); } else if (tsc) { - tsc->set_subtitle_video_frame_rate (fr); + tsc->subtitle->set_video_frame_rate (fr); } _set_video_frame_rate->Enable (false); } @@ -429,9 +429,9 @@ TimingPanel::content_selection_changed () film_content_changed (ContentProperty::LENGTH); film_content_changed (ContentProperty::TRIM_START); film_content_changed (ContentProperty::TRIM_END); - film_content_changed (VideoContentProperty::VIDEO_FRAME_RATE); - film_content_changed (SubtitleContentProperty::SUBTITLE_VIDEO_FRAME_RATE); - film_content_changed (AudioContentProperty::AUDIO_VIDEO_FRAME_RATE); + film_content_changed (VideoContentProperty::FRAME_RATE); + film_content_changed (SubtitleContentProperty::VIDEO_FRAME_RATE); + film_content_changed (AudioContentProperty::VIDEO_FRAME_RATE); } void diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 8bdac0076..28a26ce08 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -86,10 +86,10 @@ VideoPanel::VideoPanel (ContentPanel* p) _frame_type = new ContentChoice ( this, new wxChoice (this, wxID_ANY), - VideoContentProperty::VIDEO_FRAME_TYPE, + VideoContentProperty::FRAME_TYPE, &Content::video, - boost::mem_fn (&VideoContent::video_frame_type), - boost::mem_fn (&VideoContent::set_video_frame_type), + boost::mem_fn (&VideoContent::frame_type), + boost::mem_fn (&VideoContent::set_frame_type), &caster, &caster ); @@ -105,7 +105,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _left_crop = new ContentSpinCtrl ( this, new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)), - VideoContentProperty::VIDEO_CROP, + VideoContentProperty::CROP, &Content::video, boost::mem_fn (&VideoContent::left_crop), boost::mem_fn (&VideoContent::set_left_crop) @@ -116,7 +116,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _right_crop = new ContentSpinCtrl ( this, new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)), - VideoContentProperty::VIDEO_CROP, + VideoContentProperty::CROP, &Content::video, boost::mem_fn (&VideoContent::right_crop), boost::mem_fn (&VideoContent::set_right_crop) @@ -129,7 +129,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _top_crop = new ContentSpinCtrl ( this, new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)), - VideoContentProperty::VIDEO_CROP, + VideoContentProperty::CROP, &Content::video, boost::mem_fn (&VideoContent::top_crop), boost::mem_fn (&VideoContent::set_top_crop) @@ -140,7 +140,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _bottom_crop = new ContentSpinCtrl ( this, new wxSpinCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (64, -1)), - VideoContentProperty::VIDEO_CROP, + VideoContentProperty::CROP, &Content::video, boost::mem_fn (&VideoContent::bottom_crop), boost::mem_fn (&VideoContent::set_bottom_crop) @@ -164,7 +164,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _scale = new ContentChoice ( this, new wxChoice (this, wxID_ANY), - VideoContentProperty::VIDEO_SCALE, + VideoContentProperty::SCALE, &Content::video, boost::mem_fn (&VideoContent::scale), boost::mem_fn (&VideoContent::set_scale), @@ -273,13 +273,13 @@ VideoPanel::film_content_changed (int property) fcs = dynamic_pointer_cast (vcs); } - if (property == VideoContentProperty::VIDEO_FRAME_TYPE) { + if (property == VideoContentProperty::FRAME_TYPE) { setup_description (); - } else if (property == VideoContentProperty::VIDEO_CROP) { + } else if (property == VideoContentProperty::CROP) { setup_description (); - } else if (property == VideoContentProperty::VIDEO_SCALE) { + } else if (property == VideoContentProperty::SCALE) { setup_description (); - } else if (property == VideoContentProperty::VIDEO_FRAME_RATE) { + } else if (property == VideoContentProperty::FRAME_RATE) { setup_description (); } else if (property == VideoContentProperty::COLOUR_CONVERSION) { if (vcs && vcs->video->colour_conversion ()) { @@ -308,7 +308,7 @@ VideoPanel::film_content_changed (int property) checked_set (_filters, p); } } - } else if (property == VideoContentProperty::VIDEO_FADE_IN) { + } else if (property == VideoContentProperty::FADE_IN) { set check; BOOST_FOREACH (shared_ptr i, vc) { check.insert (i->video->fade_in ()); @@ -316,13 +316,13 @@ VideoPanel::film_content_changed (int property) if (check.size() == 1) { _fade_in->set ( - ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->video->video_frame_rate ()), - vc.front()->video->video_frame_rate () + ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->video->frame_rate ()), + vc.front()->video->frame_rate () ); } else { _fade_in->clear (); } - } else if (property == VideoContentProperty::VIDEO_FADE_OUT) { + } else if (property == VideoContentProperty::FADE_OUT) { set check; BOOST_FOREACH (shared_ptr i, vc) { check.insert (i->video->fade_out ()); @@ -330,8 +330,8 @@ VideoPanel::film_content_changed (int property) if (check.size() == 1) { _fade_out->set ( - ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->video->video_frame_rate ()), - vc.front()->video->video_frame_rate () + ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->video->frame_rate ()), + vc.front()->video->frame_rate () ); } else { _fade_out->clear (); @@ -433,11 +433,11 @@ VideoPanel::content_selection_changed () _bottom_crop->set_content (video_sel); _scale->set_content (video_sel); - film_content_changed (VideoContentProperty::VIDEO_CROP); - film_content_changed (VideoContentProperty::VIDEO_FRAME_RATE); + film_content_changed (VideoContentProperty::CROP); + film_content_changed (VideoContentProperty::FRAME_RATE); film_content_changed (VideoContentProperty::COLOUR_CONVERSION); - film_content_changed (VideoContentProperty::VIDEO_FADE_IN); - film_content_changed (VideoContentProperty::VIDEO_FADE_OUT); + film_content_changed (VideoContentProperty::FADE_IN); + film_content_changed (VideoContentProperty::FADE_OUT); film_content_changed (FFmpegContentProperty::FILTERS); film_content_changed (DCPContentProperty::REFERENCE_VIDEO); diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index 75306d8b7..517e7f640 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -112,7 +112,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test) shared_ptr film = new_test_film ("audio_analysis_negative_delay_test"); film->set_name ("audio_analysis_negative_delay_test"); shared_ptr c (new FFmpegContent (film, private_data / "boon_telly.mkv")); - c->audio->set_audio_delay (-250); + c->audio->set_delay (-250); film->examine_and_add_content (c); wait_for_jobs (); diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc index f714e0682..21480a5c3 100644 --- a/test/audio_decoder_test.cc +++ b/test/audio_decoder_test.cc @@ -90,7 +90,7 @@ public: void seek (ContentTime t, bool accurate) { AudioDecoder::seek (t, accurate); - _position = t.frames_round (_test_audio_content->audio->resampled_audio_frame_rate ()); + _position = t.frames_round (_test_audio_content->audio->resampled_frame_rate ()); } private: @@ -104,7 +104,7 @@ shared_ptr decoder; static ContentAudio get (Frame from, Frame length) { - decoder->seek (ContentTime::from_frames (from, content->audio->resampled_audio_frame_rate ()), true); + decoder->seek (ContentTime::from_frames (from, content->audio->resampled_frame_rate ()), true); ContentAudio ca = decoder->get_audio (content->audio->stream(), from, length, true); BOOST_CHECK_EQUAL (ca.frame, from); return ca; @@ -137,8 +137,8 @@ BOOST_AUTO_TEST_CASE (audio_decoder_get_audio_test) /* Read off the end */ - Frame const from = content->audio->resampled_audio_frame_rate() * 61; - Frame const length = content->audio->resampled_audio_frame_rate() * 4; + Frame const from = content->audio->resampled_frame_rate() * 61; + Frame const length = content->audio->resampled_frame_rate() * 4; ContentAudio ca = get (from, length); for (int i = 0; i < content->audio->stream()->channels(); ++i) { diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc index f12e8717e..f1b804830 100644 --- a/test/audio_delay_test.cc +++ b/test/audio_delay_test.cc @@ -54,7 +54,7 @@ void test_audio_delay (int delay_in_ms) film->set_name (film_name); shared_ptr content (new SndfileContent (film, "test/data/staircase.wav")); - content->audio->set_audio_delay (delay_in_ms); + content->audio->set_delay (delay_in_ms); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc index 173c256e2..02f10a31b 100644 --- a/test/black_fill_test.cc +++ b/test/black_fill_test.cc @@ -46,10 +46,10 @@ BOOST_AUTO_TEST_CASE (black_fill_test) wait_for_jobs (); contentA->video->set_scale (VideoContentScale (Ratio::from_id ("185"))); - contentA->video->set_video_length (3); + contentA->video->set_length (3); contentA->set_position (DCPTime::from_frames (2, film->video_frame_rate ())); contentB->video->set_scale (VideoContentScale (Ratio::from_id ("185"))); - contentB->video->set_video_length (1); + contentB->video->set_length (1); contentB->set_position (DCPTime::from_frames (7, film->video_frame_rate ())); film->make_dcp (); diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 84ec322f8..8a4677162 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -49,8 +49,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test) BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (2)); - content->subtitle->set_use_subtitles (true); - content->subtitle->set_burn_subtitles (false); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); film->make_dcp (); wait_for_jobs (); diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc index 03bf9e2ce..9cd123890 100644 --- a/test/ffmpeg_decoder_sequential_test.cc +++ b/test/ffmpeg_decoder_sequential_test.cc @@ -53,7 +53,7 @@ test (boost::filesystem::path file, float fps, int gaps, int video_length) shared_ptr log (new NullLog); shared_ptr decoder (new FFmpegDecoder (content, log, false)); - BOOST_CHECK_CLOSE (decoder->video_content()->video_frame_rate(), fps, 0.01); + BOOST_CHECK_CLOSE (decoder->video_content()->frame_rate(), fps, 0.01); #ifdef DCPOMATIC_DEBUG decoder->test_gaps = 0; diff --git a/test/ffmpeg_pts_offset_test.cc b/test/ffmpeg_pts_offset_test.cc index 0148487ed..7e3cd9cfd 100644 --- a/test/ffmpeg_pts_offset_test.cc +++ b/test/ffmpeg_pts_offset_test.cc @@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test) shared_ptr film = new_test_film ("ffmpeg_pts_offset_test"); shared_ptr content (new FFmpegContent (film, "test/data/test.mp4")); content->_audio_streams.push_back (shared_ptr (new FFmpegAudioStream)); - content->video->_video_frame_rate = 24; + content->video->_frame_rate = 24; { /* Sound == video so no offset required */ diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc index 4d865de7b..68a6ffa2d 100644 --- a/test/frame_rate_test.cc +++ b/test/frame_rate_test.cc @@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) afr.push_back (30); Config::instance()->set_allowed_dcp_frame_rates (afr); - content->video->_video_frame_rate = 60; + content->video->_frame_rate = 60; int best = film->best_video_frame_rate (); FrameRateChange frc = FrameRateChange (60, best); BOOST_CHECK_EQUAL (best, 30); @@ -63,7 +63,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 50; + content->video->_frame_rate = 50; best = film->best_video_frame_rate (); frc = FrameRateChange (50, best); BOOST_CHECK_EQUAL (best, 25); @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 48; + content->video->_frame_rate = 48; best = film->best_video_frame_rate (); frc = FrameRateChange (48, best); BOOST_CHECK_EQUAL (best, 24); @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 30; + content->video->_frame_rate = 30; best = film->best_video_frame_rate (); frc = FrameRateChange (30, best); BOOST_CHECK_EQUAL (best, 30); @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 29.97; + content->video->_frame_rate = 29.97; best = film->best_video_frame_rate (); frc = FrameRateChange (29.97, best); BOOST_CHECK_EQUAL (best, 30); @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, true); BOOST_CHECK_CLOSE (frc.speed_up, 30 / 29.97, 0.1); - content->video->_video_frame_rate = 25; + content->video->_frame_rate = 25; best = film->best_video_frame_rate (); frc = FrameRateChange (25, best); BOOST_CHECK_EQUAL (best, 25); @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 24; + content->video->_frame_rate = 24; best = film->best_video_frame_rate (); frc = FrameRateChange (24, best); BOOST_CHECK_EQUAL (best, 24); @@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 14.5; + content->video->_frame_rate = 14.5; best = film->best_video_frame_rate (); frc = FrameRateChange (14.5, best); BOOST_CHECK_EQUAL (best, 30); @@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, true); BOOST_CHECK_CLOSE (frc.speed_up, 15 / 14.5, 0.1); - content->video->_video_frame_rate = 12.6; + content->video->_frame_rate = 12.6; best = film->best_video_frame_rate (); frc = FrameRateChange (12.6, best); BOOST_CHECK_EQUAL (best, 25); @@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, true); BOOST_CHECK_CLOSE (frc.speed_up, 25 / 25.2, 0.1); - content->video->_video_frame_rate = 12.4; + content->video->_frame_rate = 12.4; best = film->best_video_frame_rate (); frc = FrameRateChange (12.4, best); BOOST_CHECK_EQUAL (best, 25); @@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, true); BOOST_CHECK_CLOSE (frc.speed_up, 25 / 24.8, 0.1); - content->video->_video_frame_rate = 12; + content->video->_frame_rate = 12; best = film->best_video_frame_rate (); frc = FrameRateChange (12, best); BOOST_CHECK_EQUAL (best, 24); @@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) afr.push_back (60); Config::instance()->set_allowed_dcp_frame_rates (afr); - content->video->_video_frame_rate = 60; + content->video->_frame_rate = 60; best = film->best_video_frame_rate (); frc = FrameRateChange (60, best); BOOST_CHECK_EQUAL (best, 60); @@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 50; + content->video->_frame_rate = 50; best = film->best_video_frame_rate (); frc = FrameRateChange (50, best); BOOST_CHECK_EQUAL (best, 50); @@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) BOOST_CHECK_EQUAL (frc.change_speed, false); BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1); - content->video->_video_frame_rate = 48; + content->video->_frame_rate = 48; best = film->best_video_frame_rate (); frc = FrameRateChange (48, best); BOOST_CHECK_EQUAL (best, 48); @@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) afr.push_back (24); Config::instance()->set_allowed_dcp_frame_rates (afr); - content->video->_video_frame_rate = 25; + content->video->_frame_rate = 25; best = film->best_video_frame_rate (); frc = FrameRateChange (25, best); BOOST_CHECK_EQUAL (best, 24); @@ -234,16 +234,16 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double) afr.push_back (30); Config::instance()->set_allowed_dcp_frame_rates (afr); - A->video->_video_frame_rate = 30; - B->video->_video_frame_rate = 24; + A->video->_frame_rate = 30; + B->video->_frame_rate = 24; BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 25); - A->video->_video_frame_rate = 24; - B->video->_video_frame_rate = 24; + A->video->_frame_rate = 24; + B->video->_frame_rate = 24; BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 24); - A->video->_video_frame_rate = 24; - B->video->_video_frame_rate = 48; + A->video->_frame_rate = 24; + B->video->_frame_rate = 48; BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 24); } @@ -263,45 +263,45 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test) shared_ptr stream (new FFmpegAudioStream ("foo", 0, 0, 0)); content->_audio_streams.push_back (stream); - content->video->_video_frame_rate = 24; + content->video->_frame_rate = 24; film->set_video_frame_rate (24); stream->_frame_rate = 48000; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 48000); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 48000); stream->_frame_rate = 44100; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 48000); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 48000); stream->_frame_rate = 80000; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 96000); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 96000); - content->video->_video_frame_rate = 23.976; + content->video->_frame_rate = 23.976; film->set_video_frame_rate (24); stream->_frame_rate = 48000; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 47952); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 47952); - content->video->_video_frame_rate = 29.97; + content->video->_frame_rate = 29.97; film->set_video_frame_rate (30); BOOST_CHECK_EQUAL (film->video_frame_rate (), 30); stream->_frame_rate = 48000; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 47952); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 47952); - content->video->_video_frame_rate = 25; + content->video->_frame_rate = 25; film->set_video_frame_rate (24); stream->_frame_rate = 48000; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 50000); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 50000); - content->video->_video_frame_rate = 25; + content->video->_frame_rate = 25; film->set_video_frame_rate (24); stream->_frame_rate = 44100; - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 50000); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 50000); /* Check some out-there conversions (not the best) */ - content->video->_video_frame_rate = 14.99; + content->video->_frame_rate = 14.99; film->set_video_frame_rate (25); stream->_frame_rate = 16000; - /* The FrameRateChange within resampled_audio_frame_rate should choose to double-up + /* The FrameRateChange within resampled_frame_rate should choose to double-up the 14.99 fps video to 30 and then run it slow at 25. */ - BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), lrint (48000 * 2 * 14.99 / 25)); + BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), lrint (48000 * 2 * 14.99 / 25)); } diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index de56d476e..bdd9c0313 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) wait_for_jobs (); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV"); - AudioMapping mapping = sound->audio->audio_mapping (); + AudioMapping mapping = sound->audio->mapping (); mapping.set (0, dcp::LEFT, 1.0); sound->audio->set_mapping (mapping); diff --git a/test/recover_test.cc b/test/recover_test.cc index 006a21646..5d86fb927 100644 --- a/test/recover_test.cc +++ b/test/recover_test.cc @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE (recover_test_3d) film->set_three_d (true); shared_ptr content (new ImageContent (film, "test/data/3d_test")); - content->video->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT); + content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/reels_test.cc b/test/reels_test.cc index ac4fcdd99..c30ae6c60 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -89,21 +89,21 @@ BOOST_AUTO_TEST_CASE (reels_test2) shared_ptr c (new ImageContent (film, "test/data/flat_red.png")); film->examine_and_add_content (c); wait_for_jobs (); - c->video->set_video_length (24); + c->video->set_length (24); } { shared_ptr c (new ImageContent (film, "test/data/flat_green.png")); film->examine_and_add_content (c); wait_for_jobs (); - c->video->set_video_length (24); + c->video->set_length (24); } { shared_ptr c (new ImageContent (film, "test/data/flat_blue.png")); film->examine_and_add_content (c); wait_for_jobs (); - c->video->set_video_length (24); + c->video->set_length (24); } film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); @@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) content[i].reset (new ImageContent (film, "test/data/flat_green.png")); film->examine_and_add_content (content[i]); wait_for_jobs (); - content[i]->video->set_video_length (24); + content[i]->video->set_length (24); } shared_ptr subs (new TextSubtitleContent (film, "test/data/subrip3.srt")); diff --git a/test/scaling_test.cc b/test/scaling_test.cc index 25359c605..43f5ed7e7 100644 --- a/test/scaling_test.cc +++ b/test/scaling_test.cc @@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE (scaling_test) wait_for_jobs (); - imc->video->set_video_length (1); + imc->video->set_length (1); /* F-133: 133 image in a flat container */ scaling_test_for (film, imc, "133", "185"); diff --git a/test/seek_zero_test.cc b/test/seek_zero_test.cc index 612a5f548..f05920c26 100644 --- a/test/seek_zero_test.cc +++ b/test/seek_zero_test.cc @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test) video_delay = ContentTime (); } - Frame const first_frame = video_delay.round_up (content->video->video_frame_rate ()).frames_round (content->video->video_frame_rate ()); + Frame const first_frame = video_delay.round_up (content->video->frame_rate ()).frames_round (content->video->frame_rate ()); FFmpegDecoder decoder (content, film->log(), false); list a = decoder.get_video (first_frame, true); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index b6dce58f4..721e0ac5d 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -47,8 +47,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test) film->examine_and_add_content (content); wait_for_jobs (); - content->subtitle->set_use_subtitles (true); - content->subtitle->set_burn_subtitles (false); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); film->make_dcp (); wait_for_jobs (); @@ -67,8 +67,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2) film->examine_and_add_content (content); wait_for_jobs (); - content->subtitle->set_use_subtitles (true); - content->subtitle->set_burn_subtitles (false); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); /* Use test/data/subrip2.srt as if it were a font file */ content->subtitle->fonts().front()->set_file (FontFiles::NORMAL, "test/data/subrip2.srt"); @@ -92,8 +92,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3) film->examine_and_add_content (content); wait_for_jobs (); - content->subtitle->set_use_subtitles (true); - content->subtitle->set_burn_subtitles (false); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); film->make_dcp (); wait_for_jobs (); diff --git a/test/threed_test.cc b/test/threed_test.cc index 05fd77a8a..1e728bc9b 100644 --- a/test/threed_test.cc +++ b/test/threed_test.cc @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE (threed_test) shared_ptr film = new_test_film ("threed_test"); film->set_name ("test_film2"); shared_ptr c (new FFmpegContent (film, "test/data/test.mp4")); - c->video->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT); + c->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT); film->examine_and_add_content (c); wait_for_jobs (); diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc index 7c8259f97..353a97dd0 100644 --- a/test/time_calculation_test.cc +++ b/test/time_calculation_test.cc @@ -128,19 +128,19 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test) /* 25fps content, 25fps DCP */ film->set_video_frame_rate (25); - BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 25.0)); + BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 25.0)); /* 25fps content, 24fps DCP; length should be increased */ film->set_video_frame_rate (24); - BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 24.0)); + BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 24.0)); /* 25fps content, 30fps DCP; length should be decreased */ film->set_video_frame_rate (30); - BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 30.0)); + BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 30.0)); /* 25fps content, 50fps DCP; length should be the same */ film->set_video_frame_rate (50); - BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 25.0)); + BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() / 25.0)); /* 25fps content, 60fps DCP; length should be decreased */ film->set_video_frame_rate (60); - BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() * (50.0 / 60) / 25.0)); + BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->length() * (50.0 / 60) / 25.0)); } /** Test Player::dcp_to_content_video */ @@ -161,7 +161,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 0, no trim, content rate = DCP rate */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, no trim, content rate = DCP rate */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, 1.5s trim, content rate = DCP rate */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -204,7 +204,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, no trim, content rate 24, DCP rate 25 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -232,7 +232,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.6)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -251,7 +251,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -263,7 +263,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, no trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -277,7 +277,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (48); + content->video->set_frame_rate (48); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -307,7 +307,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, no trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (48); + content->video->set_frame_rate (48); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (48); + content->video->set_frame_rate (48); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -335,7 +335,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) /* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */ content->set_position (DCPTime::from_seconds (0)); content->set_trim_start (ContentTime::from_seconds (0)); - content->video->set_video_frame_rate (29.9978733); + content->video->set_frame_rate (29.9978733); film->set_video_frame_rate (30); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 0, no trim, content rate = DCP rate */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -378,7 +378,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, no trim, content rate = DCP rate */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -390,7 +390,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, 1.5s trim, content rate = DCP rate */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -406,7 +406,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -418,7 +418,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, no trim, content rate 24, DCP rate 25 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -430,7 +430,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.6)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -448,7 +448,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -460,7 +460,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, no trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -472,7 +472,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -489,7 +489,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (48); + content->video->set_frame_rate (48); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -501,7 +501,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, no trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (48); + content->video->set_frame_rate (48); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -513,7 +513,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (48); + content->video->set_frame_rate (48); film->set_video_frame_rate (24); player->setup_pieces (); BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1); @@ -543,7 +543,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 0, no trim, video/audio content rate = video/audio DCP rate */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -556,7 +556,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, no trim, video/audio content rate = video/audio DCP rate */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -571,7 +571,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -586,7 +586,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); stream->_frame_rate = 48000; player->setup_pieces (); @@ -599,7 +599,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); stream->_frame_rate = 48000; player->setup_pieces (); @@ -616,7 +616,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.6)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (25); stream->_frame_rate = 48000; player->setup_pieces (); @@ -635,7 +635,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); stream->_frame_rate = 48000; player->setup_pieces (); @@ -648,7 +648,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, no trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -663,7 +663,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -681,7 +681,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (48); stream->_frame_rate = 48000; player->setup_pieces (); @@ -694,7 +694,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, no trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -709,7 +709,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); @@ -724,7 +724,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */ content->set_position (DCPTime ()); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 44100; player->setup_pieces (); @@ -737,7 +737,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime ()); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 44100; player->setup_pieces (); @@ -752,7 +752,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */ content->set_position (DCPTime::from_seconds (3)); content->set_trim_start (ContentTime::from_seconds (1.5)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 44100; player->setup_pieces (); @@ -767,7 +767,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) /* Check with a large start trim */ content->set_position (DCPTime::from_seconds (0)); content->set_trim_start (ContentTime::from_seconds (54143)); - content->video->set_video_frame_rate (24); + content->video->set_frame_rate (24); film->set_video_frame_rate (24); stream->_frame_rate = 48000; player->setup_pieces (); diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index 78f3bf9b0..9b50fa8c7 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -100,7 +100,7 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop dcp::Size answer = sc.get().size (vc->video, display_size, film_size); if (answer != correct) { - cerr << "Testing " << vc->video->video_size().width << "x" << vc->video->video_size().height << "\n"; + cerr << "Testing " << vc->video->size().width << "x" << vc->video->size().height << "\n"; cerr << "Testing " << display_size.width << "x" << display_size.height << "\n"; cerr << answer.width << "x" << answer.height << " instead of " << correct.width << "x" << correct.height << "\n"; } diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc index 8b051d0d1..dc464429f 100644 --- a/test/xml_subtitle_test.cc +++ b/test/xml_subtitle_test.cc @@ -41,8 +41,8 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); - content->subtitle->set_use_subtitles (true); - content->subtitle->set_burn_subtitles (false); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); film->examine_and_add_content (content); wait_for_jobs (); film->make_dcp (); @@ -62,8 +62,8 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test2) film->set_interop (true); film->set_sequence (false); shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); - content->subtitle->set_use_subtitles (true); - content->subtitle->set_burn_subtitles (false); + content->subtitle->set_use (true); + content->subtitle->set_burn (false); film->examine_and_add_content (content); film->examine_and_add_content (content); wait_for_jobs (); -- 2.30.2