/*
- 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)
if (node->optional_node_child ("ColourConversion")) {
- _colour_conversion = ColourConversion (node->node_child ("ColourConversion"));
+ _colour_conversion = ColourConversion (node->node_child ("ColourConversion"), version);
}
if (version >= 32) {
_fade_in = ContentTime (node->number_child<int64_t> ("FadeIn"));
{
{
boost::mutex::scoped_lock lm (_mutex);
- _colour_conversion = PresetColourConversion (_("sRGB"), 2.4, true, dcp::colour_matrix::srgb_to_xyz, 2.6).conversion;
+ _colour_conversion = ColourConversion (dcp::ColourConversion::srgb_to_xyz ());
}
if (signal) {
signal_changed (ContentProperty::LENGTH);
}
-
-string
-VideoContent::information () const
-{
- if (video_size().width == 0 || video_size().height == 0) {
- return "";
- }
-
- SafeStringStream s;
-
- s << String::compose (
- _("%1x%2 pixels (%3:1)"),
- video_size().width,
- video_size().height,
- setprecision (3), video_size().ratio ()
- );
-
- if (sample_aspect_ratio ()) {
- s << String::compose (_(" sample aspect ratio %1:1"), sample_aspect_ratio().get ());
- }
-
- return s.str ();
-}
-
void
VideoContent::set_left_crop (int c)
{
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)) {
return d.str ();
}
+