Fix ID numbering.
[dcpomatic.git] / src / lib / video_content.cc
index 077972fabe685496edc9171f075ed97a954e2c43..bfbcef9bf9cea42a170244239d40827208521a43 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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
@@ -29,9 +29,9 @@
 #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"
@@ -59,7 +59,6 @@ using std::setprecision;
 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)
@@ -393,14 +392,16 @@ VideoContent::video_size_after_3d_split () const
 }
 
 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
@@ -443,17 +444,6 @@ VideoContent::video_size_after_crop () const
        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 ()
 {
@@ -525,7 +515,15 @@ VideoContent::processing_description () const
                        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)) {
@@ -570,3 +568,4 @@ VideoContent::processing_description () const
 
        return d.str ();
 }
+