*/
shared_ptr<const AudioContent> 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));
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;
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<const Film> film)
: ContentPart (parent, film)
- , _audio_gain (0)
- , _audio_delay (Config::instance()->default_audio_delay ())
+ , _gain (0)
+ , _delay (Config::instance()->default_audio_delay ())
{
}
AudioContent::AudioContent (Content* parent, shared_ptr<const Film> film, cxml::ConstNodePtr node)
: ContentPart (parent, film)
{
- _audio_gain = node->number_child<double> ("AudioGain");
- _audio_delay = node->number_child<int> ("AudioDelay");
- _audio_video_frame_rate = node->optional_number_child<double> ("AudioVideoFrameRate");
+ _gain = node->number_child<double> ("AudioGain");
+ _delay = node->number_child<int> ("AudioDelay");
+ _video_frame_rate = node->optional_number_child<double> ("AudioVideoFrameRate");
}
AudioContent::AudioContent (Content* parent, shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
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."));
}
}
}
- _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 ();
}
AudioContent::as_xml (xmlpp::Node* node) const
{
boost::mutex::scoped_lock lm (_mutex);
- node->add_child("AudioGain")->add_child_text (raw_convert<string> (_audio_gain));
- node->add_child("AudioDelay")->add_child_text (raw_convert<string> (_audio_delay));
+ node->add_child("AudioGain")->add_child_text (raw_convert<string> (_gain));
+ node->add_child("AudioDelay")->add_child_text (raw_convert<string> (_delay));
if (_audio_video_frame_rate) {
node->add_child("AudioVideoFrameRate")->add_child_text (raw_convert<string> (_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
}
void
-AudioContent::set_audio_mapping (AudioMapping mapping)
+AudioContent::set_mapping (AudioMapping mapping)
{
int c = 0;
BOOST_FOREACH (AudioStreamPtr i, streams ()) {
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 ()) {
* 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;
optional<int> 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;
}
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 ());
}
}
/** @return User-visible names of each of our audio channels */
vector<string>
-AudioContent::audio_channel_names () const
+AudioContent::channel_names () const
{
vector<string> n;
);
}
- 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) {
UserProperty (
_("Length"),
_("Full length in audio frames at DCP rate"),
- c.frames_round (resampled_audio_frame_rate ())
+ c.frames_round (resampled_frame_rate ())
)
);
}
_streams = streams;
}
- _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS);
+ _parent->signal_changed (AudioContentProperty::STREAMS);
}
AudioStreamPtr
_streams.push_back (stream);
}
- _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS);
+ _parent->signal_changed (AudioContentProperty::STREAMS);
}
void
_streams.push_back (stream);
}
- _parent->signal_changed (AudioContentProperty::AUDIO_STREAMS);
+ _parent->signal_changed (AudioContentProperty::STREAMS);
}
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
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<std::string> audio_channel_names () const;
+ std::vector<std::string> 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;
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<double> _audio_video_frame_rate;
+ int _delay;
+ boost::optional<double> _video_frame_rate;
std::vector<AudioStreamPtr> _streams;
};
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
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
, _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 ();
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
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 */
_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;
Content::examine (job);
shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ()));
- video->take_from_video_examiner (examiner);
+ video->take_from_examiner (examiner);
set_default_colour_conversion ();
{
as->set_mapping (m);
}
- signal_changed (AudioContentProperty::AUDIO_STREAMS);
+ signal_changed (AudioContentProperty::STREAMS);
{
boost::mutex::scoped_lock lm (_mutex);
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
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 ());
}
}
++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);
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;
}
/* XXX: inefficient */
list<ContentTimePeriod> ctp;
- double const vfr = _dcp_content->video->video_frame_rate ();
+ double const vfr = _dcp_content->video->frame_rate ();
BOOST_FOREACH (shared_ptr<dcp::Reel> r, _reels) {
if (!r->main_subtitle ()) {
shared_ptr<dcp::SubtitleAsset> 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<dcp::InteropSubtitleAsset> iop = dynamic_pointer_cast<dcp::InteropSubtitleAsset> (sc);
if (iop) {
- subtitle->set_subtitle_language (iop->language ());
+ subtitle->set_language (iop->language ());
}
shared_ptr<dcp::SMPTESubtitleAsset> smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset> (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 ());
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);
}
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (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."));
}
}
Content::examine (job);
shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this (), job));
- video->take_from_video_examiner (examiner);
+ video->take_from_examiner (examiner);
set_default_colour_conversion ();
{
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
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);
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 ());
}
}
, 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()))
{
}
double const pts = i->second * av_q2d (_format_context->streams[_video_stream]->time_base) + _pts_offset.seconds ();
video (
shared_ptr<ImageProxy> (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");
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<double> const scaled_rect (
static_cast<double> (rect->x) / vs.width,
static_cast<double> (rect->y) / vs.height,
}
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
analysis at the plotting stage rather than having to
recompute it.
*/
- digester.add (i->audio->audio_gain ());
+ digester.add (i->audio->gain ());
}
}
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;
}
continue;
}
- if (i->subtitle->use_subtitles() && !i->subtitle->burn_subtitles()) {
+ if (i->subtitle->use() && !i->subtitle->burn()) {
burnt_in = false;
}
}
{
_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);
}
ContentList cl = content ();
BOOST_FOREACH (shared_ptr<Content>& c, cl) {
if (c->subtitle) {
- languages.insert (c->subtitle->subtitle_language ());
+ languages.insert (c->subtitle->language ());
}
}
DCPOMATIC_ASSERT (film);
shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
- video->take_from_video_examiner (examiner);
+ video->take_from_examiner (examiner);
set_default_colour_conversion ();
}
{
shared_ptr<const Film> 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
SafeStringStream s;
s << Content::identifier();
s << "_" << video->identifier ();
- s << "_" << video->video_length();
+ s << "_" << video->length();
return s.str ();
}
bool
ImageDecoder::pass (PassReason, bool)
{
- if (_video_position >= _image_content->video->video_length()) {
+ if (_video_position >= _image_content->video->length()) {
return true;
}
/* 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));
}
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 ());
}
optional<double>
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 */
shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (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<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (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 */
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 */
}
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 ());
shared_ptr<const TextSubtitleContent> rc = dynamic_pointer_cast<const TextSubtitleContent> (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<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (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<VideoDecoder> vd = dynamic_pointer_cast<VideoDecoder> (decoder);
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
) {
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
) {
} else {
/* Some video content at this time */
shared_ptr<Piece> 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> piece, ov) {
/* 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 */
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 ()) {
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<AudioBuffers> gain (new AudioBuffers (all.audio));
- gain->apply_gain (i->content->audio->audio_gain ());
+ gain->apply_gain (i->content->audio->gain ());
all.audio = gain;
}
PlayerSubtitles ps (time, length);
for (list<shared_ptr<Piece> >::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;
}
for (list<ContentImageSubtitle>::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);
}
list<ContentTextSubtitle> 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;
void
Playlist::content_changed (weak_ptr<Content> 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
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 {
string t;
BOOST_FOREACH (shared_ptr<const Content> i, _content) {
- if (i->video || (i->subtitle && i->subtitle->burn_subtitles())) {
+ if (i->video || (i->subtitle && i->subtitle->burn())) {
t += i->identifier ();
}
}
float this_error = 0;
BOOST_FOREACH (shared_ptr<Content> 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" */
/* 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);
}
}
_audio_length = examiner->audio_length ();
}
- signal_changed (AudioContentProperty::AUDIO_STREAMS);
+ signal_changed (AudioContentProperty::STREAMS);
}
DCPTime
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<const Film> 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)
SubtitleContent::SubtitleContent (Content* parent, shared_ptr<const Film> 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<int>("Red").get_value_or(255),
node->optional_number_child<int>("Green").get_value_or(255),
, _frame_rate (node->optional_number_child<double>("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<double> ("SubtitleXOffset");
- _subtitle_y_offset = node->number_child<double> ("SubtitleYOffset");
+ _x_offset = node->number_child<double> ("SubtitleXOffset");
+ _y_offset = node->number_child<double> ("SubtitleYOffset");
} else {
- _subtitle_y_offset = node->number_child<double> ("SubtitleOffset");
+ _y_offset = node->number_child<double> ("SubtitleOffset");
}
if (version >= 10) {
- _subtitle_x_scale = node->number_child<double> ("SubtitleXScale");
- _subtitle_y_scale = node->number_child<double> ("SubtitleYScale");
+ _x_scale = node->number_child<double> ("SubtitleXScale");
+ _y_scale = node->number_child<double> ("SubtitleYScale");
} else {
- _subtitle_x_scale = _subtitle_y_scale = node->number_child<double> ("SubtitleScale");
+ _x_scale = _y_scale = node->number_child<double> ("SubtitleScale");
}
- _subtitle_language = node->optional_string_child ("SubtitleLanguage").get_value_or ("");
+ _language = node->optional_string_child ("SubtitleLanguage").get_value_or ("");
list<cxml::NodePtr> fonts = node->node_children ("Font");
for (list<cxml::NodePtr>::const_iterator i = fonts.begin(); i != fonts.end(); ++i) {
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."));
}
}
}
- _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 ();
{
boost::mutex::scoped_lock lm (_mutex);
- root->add_child("UseSubtitles")->add_child_text (raw_convert<string> (_use_subtitles));
- root->add_child("BurnSubtitles")->add_child_text (raw_convert<string> (_burn_subtitles));
- root->add_child("SubtitleXOffset")->add_child_text (raw_convert<string> (_subtitle_x_offset));
- root->add_child("SubtitleYOffset")->add_child_text (raw_convert<string> (_subtitle_y_offset));
- root->add_child("SubtitleXScale")->add_child_text (raw_convert<string> (_subtitle_x_scale));
- root->add_child("SubtitleYScale")->add_child_text (raw_convert<string> (_subtitle_y_scale));
- root->add_child("SubtitleLanguage")->add_child_text (_subtitle_language);
+ root->add_child("UseSubtitles")->add_child_text (raw_convert<string> (_use));
+ root->add_child("BurnSubtitles")->add_child_text (raw_convert<string> (_burn));
+ root->add_child("SubtitleXOffset")->add_child_text (raw_convert<string> (_x_offset));
+ root->add_child("SubtitleYOffset")->add_child_text (raw_convert<string> (_y_offset));
+ root->add_child("SubtitleXScale")->add_child_text (raw_convert<string> (_x_scale));
+ root->add_child("SubtitleYScale")->add_child_text (raw_convert<string> (_y_scale));
+ root->add_child("SubtitleLanguage")->add_child_text (_language);
root->add_child("Red")->add_child_text (raw_convert<string> (_colour.r));
root->add_child("Green")->add_child_text (raw_convert<string> (_colour.g));
root->add_child("Blue")->add_child_text (raw_convert<string> (_colour.b));
SubtitleContent::identifier () const
{
SafeStringStream s;
- s << raw_convert<string> (subtitle_x_scale())
- << "_" << raw_convert<string> (subtitle_y_scale())
- << "_" << raw_convert<string> (subtitle_x_offset())
- << "_" << raw_convert<string> (subtitle_y_offset());
+ s << raw_convert<string> (x_scale())
+ << "_" << raw_convert<string> (y_scale())
+ << "_" << raw_convert<string> (x_offset())
+ << "_" << raw_convert<string> (y_offset());
/* XXX: I suppose really _fonts shouldn't be in here, since not all
types of subtitle content involve fonts.
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);
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
void add_font (boost::shared_ptr<Font> 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<boost::shared_ptr<Font> > fonts () const {
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);
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<boost::shared_ptr<Font> > _fonts;
dcp::Colour _colour;
bool _outline;
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 ();
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);
}
int burnt_subtitles = 0;
int non_burnt_subtitles = 0;
BOOST_FOREACH (shared_ptr<const Content> 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;
#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;
VideoContent::VideoContent (Content* parent, shared_ptr<const Film> 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)
VideoContent::VideoContent (Content* parent, shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
: ContentPart (parent, film)
{
- _video_size.width = node->number_child<int> ("VideoWidth");
- _video_size.height = node->number_child<int> ("VideoHeight");
- _video_frame_rate = node->optional_number_child<double> ("VideoFrameRate");
- _video_length = node->number_child<Frame> ("VideoLength");
- _video_frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType"));
+ _size.width = node->number_child<int> ("VideoWidth");
+ _size.height = node->number_child<int> ("VideoHeight");
+ _frame_rate = node->optional_number_child<double> ("VideoFrameRate");
+ _length = node->number_child<Frame> ("VideoLength");
+ _frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType"));
_sample_aspect_ratio = node->optional_number_child<double> ("SampleAspectRatio");
_crop.left = node->number_child<int> ("LeftCrop");
_crop.right = node->number_child<int> ("RightCrop");
VideoContent::VideoContent (Content* parent, shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
: ContentPart (parent, film)
- , _video_length (0)
+ , _length (0)
, _yuv (false)
{
shared_ptr<VideoContent> ref = c[0]->video;
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."));
}
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 ();
VideoContent::as_xml (xmlpp::Node* node) const
{
boost::mutex::scoped_lock lm (_mutex);
- node->add_child("VideoLength")->add_child_text (raw_convert<string> (_video_length));
- node->add_child("VideoWidth")->add_child_text (raw_convert<string> (_video_size.width));
- node->add_child("VideoHeight")->add_child_text (raw_convert<string> (_video_size.height));
- if (_video_frame_rate) {
- node->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate.get()));
+ node->add_child("VideoLength")->add_child_text (raw_convert<string> (_length));
+ node->add_child("VideoWidth")->add_child_text (raw_convert<string> (_size.width));
+ node->add_child("VideoHeight")->add_child_text (raw_convert<string> (_size.height));
+ if (_frame_rate) {
+ node->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_frame_rate.get()));
}
- node->add_child("VideoFrameType")->add_child_text (raw_convert<string> (static_cast<int> (_video_frame_type)));
+ node->add_child("VideoFrameType")->add_child_text (raw_convert<string> (static_cast<int> (_frame_type)));
if (_sample_aspect_ratio) {
node->add_child("SampleAspectRatio")->add_child_text (raw_convert<string> (_sample_aspect_ratio.get ()));
}
}
void
-VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
+VideoContent::take_from_examiner (shared_ptr<VideoExaminer> d)
{
/* These examiner calls could call other content methods which take a lock on the mutex */
dcp::Size const vs = d->video_size ();
{
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<const Film> 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);
}
{
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 ()) {
}
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:
/** @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
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);
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);
{
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();
}
/* 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";
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
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
}
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 ();
void
VideoContent::add_properties (list<UserProperty>& p) const
{
- p.push_back (UserProperty (_("Video"), _("Length"), raw_convert<string> (video_length ()), _("video frames")));
- p.push_back (UserProperty (_("Video"), _("Size"), raw_convert<string> (video_size().width) + "x" + raw_convert<string> (video_size().height)));
- p.push_back (UserProperty (_("Video"), _("Frame rate"), raw_convert<string> (video_frame_rate(), 5), _("frames per second")));
+ p.push_back (UserProperty (_("Video"), _("Length"), raw_convert<string> (length ()), _("video frames")));
+ p.push_back (UserProperty (_("Video"), _("Size"), raw_convert<string> (size().width) + "x" + raw_convert<string> (size().height)));
+ p.push_back (UserProperty (_("Video"), _("Frame rate"), raw_convert<string> (frame_rate(), 5), _("frames per second")));
}
double
-VideoContent::video_frame_rate () const
+VideoContent::frame_rate () const
{
boost::mutex::scoped_lock lm (_mutex);
shared_ptr<const Film> 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
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);
}
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<VideoContent>
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<bool>(_video_frame_rate);
+ return static_cast<bool>(_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);
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 {
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<double> fade (Frame) const;
std::string processing_description () const;
- void set_video_length (Frame);
+ void set_length (Frame);
- void take_from_video_examiner (boost::shared_ptr<VideoExaminer>);
+ void take_from_examiner (boost::shared_ptr<VideoExaminer>);
void add_properties (std::list<UserProperty> &) const;
private:
- Frame _video_length;
- /** Video frame rate, or not set if this content should use the DCP's frame rate */
- boost::optional<double> _video_frame_rate;
- boost::optional<ColourConversion> _colour_conversion;
-
friend struct ffmpeg_pts_offset_test;
friend struct best_dcp_frame_rate_test_single;
friend struct best_dcp_frame_rate_test_double;
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<double> _frame_rate;
+ boost::optional<ColourConversion> _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<double> _sample_aspect_ratio;
bool _yuv;
Frame _fade_in;
{
/* 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;
, _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 ();
}
_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<ContentVideo> dec;
/* Work out what we are going to push into _decoded_video next */
list<ContentVideo> 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;
optional<Frame> 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;
}
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;
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
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
<< " 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()
}
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";
}
}
}
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i);
if (ic) {
- ic->video->set_video_length (still_length * 24);
+ ic->video->set_length (still_length * 24);
}
}
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.
_gain = new ContentSpinCtrlDouble<AudioContent> (
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));
_delay = new ContentSpinCtrl<AudioContent> (
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));
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) {
{
ContentList c = _parent->selected_audio ();
if (c.size() == 1) {
- c.front()->audio->set_audio_mapping (m);
+ c.front()->audio->set_mapping (m);
}
}
_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 ();
}
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;
}
}
return;
}
- ic->video->set_video_frame_rate (frame_rate);
+ ic->video->set_frame_rate (frame_rate);
}
_film->examine_and_add_content (content);
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) {
int three_d = 0;
BOOST_FOREACH (shared_ptr<const Content> 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;
}
}
}
}
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<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (scs);
SubtitlePanel::use_toggled ()
{
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) {
- i->subtitle->set_use_subtitles (_use->GetValue());
+ i->subtitle->set_use (_use->GetValue());
}
}
SubtitlePanel::burn_toggled ()
{
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) {
- i->subtitle->set_burn_subtitles (_burn->GetValue());
+ i->subtitle->set_burn (_burn->GetValue());
}
}
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);
}
}
SubtitlePanel::x_offset_changed ()
{
BOOST_FOREACH (shared_ptr<Content> 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);
}
}
SubtitlePanel::y_offset_changed ()
{
BOOST_FOREACH (shared_ptr<Content> 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);
}
}
{
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);
}
}
SubtitlePanel::y_scale_changed ()
{
BOOST_FOREACH (shared_ptr<Content> 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);
}
}
SubtitlePanel::language_changed ()
{
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_subtitle ()) {
- i->subtitle->set_subtitle_language (wx_to_std (_language->GetValue()));
+ i->subtitle->set_language (wx_to_std (_language->GetValue()));
}
}
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);
}
_views.push_back (shared_ptr<TimelineView> (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<TimelineView> (new TimelineAudioContentView (*this, i)));
}
{
ensure_ui_thread ();
- if (property == AudioContentProperty::AUDIO_STREAMS) {
+ if (property == AudioContentProperty::STREAMS) {
recreate_views ();
} else if (!frequent) {
setup_pixels_per_second ();
{
shared_ptr<Content> c = _content.lock ();
DCPOMATIC_ASSERT (c);
- return c->subtitle && c->subtitle->use_subtitles();
+ return c->subtitle && c->subtitle->use();
}
} 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 ();
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<double> check_vc;
shared_ptr<const Content> vc;
int count_ac = 0;
shared_ptr<const Content> sc;
BOOST_FOREACH (shared_ptr<const Content> 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<const AudioContent> at = dynamic_pointer_cast<const AudioContent> (i);
if (vc) {
checked_set (_video_frame_rate, raw_convert<string> (vc->video->video_frame_rate (), 5));
} else if (ac) {
- checked_set (_video_frame_rate, raw_convert<string> (ac->audio->audio_video_frame_rate (), 5));
+ checked_set (_video_frame_rate, raw_convert<string> (ac->audio->video_frame_rate (), 5));
} else if (sc) {
- checked_set (_video_frame_rate, raw_convert<string> (sc->subtitle->subtitle_video_frame_rate (), 5));
+ checked_set (_video_frame_rate, raw_convert<string> (sc->subtitle->video_frame_rate (), 5));
}
_video_frame_rate->Enable (true);
} else {
shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (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));
}
}
}
shared_ptr<TextSubtitleContent> tsc = dynamic_pointer_cast<TextSubtitleContent> (i);
double const fr = raw_convert<double> (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);
}
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
_frame_type = new ContentChoice<VideoContent, VideoFrameType> (
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<int, VideoFrameType>,
&caster<VideoFrameType, int>
);
_left_crop = new ContentSpinCtrl<VideoContent> (
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)
_right_crop = new ContentSpinCtrl<VideoContent> (
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)
_top_crop = new ContentSpinCtrl<VideoContent> (
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)
_bottom_crop = new ContentSpinCtrl<VideoContent> (
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)
_scale = new ContentChoice<VideoContent, VideoContentScale> (
this,
new wxChoice (this, wxID_ANY),
- VideoContentProperty::VIDEO_SCALE,
+ VideoContentProperty::SCALE,
&Content::video,
boost::mem_fn (&VideoContent::scale),
boost::mem_fn (&VideoContent::set_scale),
fcs = dynamic_pointer_cast<FFmpegContent> (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 ()) {
checked_set (_filters, p);
}
}
- } else if (property == VideoContentProperty::VIDEO_FADE_IN) {
+ } else if (property == VideoContentProperty::FADE_IN) {
set<Frame> check;
BOOST_FOREACH (shared_ptr<const Content> i, vc) {
check.insert (i->video->fade_in ());
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<Frame> check;
BOOST_FOREACH (shared_ptr<const Content> i, vc) {
check.insert (i->video->fade_out ());
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 ();
_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);
shared_ptr<Film> film = new_test_film ("audio_analysis_negative_delay_test");
film->set_name ("audio_analysis_negative_delay_test");
shared_ptr<FFmpegContent> 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 ();
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:
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;
/* 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) {
film->set_name (film_name);
shared_ptr<SndfileContent> 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 ();
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 ();
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 ();
shared_ptr<Log> log (new NullLog);
shared_ptr<FFmpegDecoder> 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;
shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test");
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
content->_audio_streams.push_back (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream));
- content->video->_video_frame_rate = 24;
+ content->video->_frame_rate = 24;
{
/* Sound == video so no offset required */
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
shared_ptr<FFmpegAudioStream> 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));
}
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);
film->set_three_d (true);
shared_ptr<ImageContent> 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 ();
shared_ptr<ImageContent> 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<ImageContent> 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<ImageContent> 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);
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<TextSubtitleContent> subs (new TextSubtitleContent (film, "test/data/subrip3.srt"));
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");
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<ContentVideo> a = decoder.get_video (first_frame, true);
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 ();
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");
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 ();
shared_ptr<Film> film = new_test_film ("threed_test");
film->set_name ("test_film2");
shared_ptr<FFmpegContent> 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 ();
/* 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 */
/* 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);
/* 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);
/* 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);
*/
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);
/* 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);
*/
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);
*/
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);
/* 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);
/* 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);
*/
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);
/* 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);
/* 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);
/* 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);
/* 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);
/* 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);
/* 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);
*/
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);
/* 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);
/* 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);
*/
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);
/* 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);
/* 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);
*/
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);
/* 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);
/* 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);
/* 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 ();
/* 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 ();
/* 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 ();
/* 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 ();
/* 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 ();
*/
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 ();
*/
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 ();
/* 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 ();
/* 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 ();
*/
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 ();
/* 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 ();
/* 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 ();
/* 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 ();
/* 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 ();
/* 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 ();
/* 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 ();
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";
}
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
shared_ptr<TextSubtitleContent> 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 ();
film->set_interop (true);
film->set_sequence (false);
shared_ptr<TextSubtitleContent> 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 ();