+2014-03-07 Carl Hetherington <cth@carlh.net>
+
+ * Add subtitle view.
+
2014-06-12 Carl Hetherington <cth@carlh.net>
+ * Version 1.69.27 released.
+
+ 2014-06-12 Carl Hetherington <cth@carlh.net>
+
+ * Add Content menu with "scale to fit width" and "scale
+ to fit height" options.
+
* Version 1.69.26 released.
2014-06-12 Carl Hetherington <cth@carlh.net>
{
shared_ptr<const Film> film = _film.lock ();
assert (film);
-
- FrameRateChange frc (video_frame_rate(), film->video_frame_rate());
-
- /* Here we are converting from time (in the DCP) to a frame number in the content.
- Hence we need to use the DCP's frame rate and the double/skip correction, not
- the source's rate.
- */
- return t * film->video_frame_rate() / (frc.factor() * TIME_HZ);
+ return ContentTime (t, FrameRateChange (video_frame_rate(), film->video_frame_rate()));
}
+ void
+ VideoContent::scale_and_crop_to_fit_width ()
+ {
+ shared_ptr<const Film> film = _film.lock ();
+ 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));
+ set_top_crop (crop / 2);
+ set_bottom_crop (crop / 2);
+ }
+
+ void
+ VideoContent::scale_and_crop_to_fit_height ()
+ {
+ shared_ptr<const Film> film = _film.lock ();
+ 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));
+ set_left_crop (crop / 2);
+ set_right_crop (crop / 2);
+ }
+
VideoContentScale::VideoContentScale (Ratio const * r)
: _ratio (r)
, _scale (true)
return _colour_conversion;
}
- libdcp::Size video_size_after_3d_split () const;
- libdcp::Size video_size_after_crop () const;
+ dcp::Size video_size_after_3d_split () const;
+ dcp::Size video_size_after_crop () const;
- VideoContent::Frame time_to_content_video_frames (Time) const;
+ ContentTime dcp_time_to_content_time (DCPTime) const;
+ void scale_and_crop_to_fit_width ();
+ void scale_and_crop_to_fit_height ();
+
protected:
void take_from_video_examiner (boost::shared_ptr<VideoExaminer>);