/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 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
#include "frame_rate_change.h"
#include "log.h"
#include "safe_stringstream.h"
+#include "raw_convert.h"
#include <libcxml/cxml.h>
#include <dcp/colour_matrix.h>
-#include <dcp/raw_convert.h>
#include <iomanip>
#include "i18n.h"
using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
-using dcp::raw_convert;
VideoContent::VideoContent (shared_ptr<const Film> f)
: Content (f)
VideoContent::technical_summary () const
{
string s = String::compose (
- "video: length %1, size %2x%3, rate %4",
+ N_("video: length %1, size %2x%3, rate %4"),
video_length_after_3d_combine().seconds(),
video_size().width,
video_size().height,
);
if (sample_aspect_ratio ()) {
- s += String::compose (_(", sample aspect ratio %1"), (sample_aspect_ratio().get ()));
+ s += String::compose (N_(", sample aspect ratio %1"), (sample_aspect_ratio().get ()));
}
return s;
}
void
-VideoContent::unset_colour_conversion ()
+VideoContent::unset_colour_conversion (bool signal)
{
{
boost::mutex::scoped_lock lm (_mutex);
_colour_conversion = boost::optional<ColourConversion> ();
}
- signal_changed (VideoContentProperty::COLOUR_CONVERSION);
+ if (signal) {
+ signal_changed (VideoContentProperty::COLOUR_CONVERSION);
+ }
}
void
return crop().apply (video_size_after_3d_split ());
}
-/** @param t A time offset from the start of this piece of content.
- * @return Corresponding time with respect to the content.
- */
-ContentTime
-VideoContent::dcp_time_to_content_time (DCPTime t) const
-{
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
- return ContentTime (t, FrameRateChange (video_frame_rate(), film->video_frame_rate()));
-}
-
void
VideoContent::scale_and_crop_to_fit_width ()
{
video_size_after_3d_split().height
);
- d << " (" << fixed << setprecision(2) << video_size_after_3d_split().ratio() << ":1)\n";
+
+ float ratio = video_size_after_3d_split().ratio ();
+
+ if (sample_aspect_ratio ()) {
+ d << ", " << _("pixel aspect ratio") << " " << fixed << setprecision(2) << sample_aspect_ratio().get () << ":1";
+ ratio *= sample_aspect_ratio().get ();
+ }
+
+ 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)) {
DCPOMATIC_ASSERT (film);
dcp::Size const container_size = film->frame_size ();
- dcp::Size const scaled = scale().size (dynamic_pointer_cast<const VideoContent> (shared_from_this ()), container_size, container_size, 1);
+ dcp::Size const scaled = scale().size (dynamic_pointer_cast<const VideoContent> (shared_from_this ()), container_size, container_size);
if (scaled != video_size_after_crop ()) {
d << String::compose (
return d.str ();
}
+