*/
+
+#include "film.h"
#include "piece.h"
return content->video->crop ();
}
+
+DCPTime
+Piece::resampled_audio_to_dcp (shared_ptr<const Film> film, Frame f) const
+{
+ /* See notes in content_video_to_dcp */
+ return DCPTime::from_frames(f, film->audio_frame_rate())
+ - DCPTime(content->trim_start(), frc)
+ + position();
+}
+
+
+ContentTime
+Piece::dcp_to_content_time (shared_ptr<const Film> film, DCPTime t) const
+{
+ DCPTime s = t - position();
+ s = min(content->length_after_trim(film), s);
+ return max(ContentTime(), ContentTime(s, frc) + content->trim_start());
+}
+
dcpomatic::DCPTime end (boost::shared_ptr<const Film> film) const;
dcpomatic::DCPTime content_video_to_dcp (Frame f) const;
dcpomatic::DCPTime content_time_to_dcp (dcpomatic::ContentTime t) const;
+ dcpomatic::DCPTime resampled_audio_to_dcp (boost::shared_ptr<const Film> film, Frame f) const;
+ dcpomatic::ContentTime dcp_to_content_time (boost::shared_ptr<const Film> film, dcpomatic::DCPTime t) const;
+
Crop video_crop () const;
boost::shared_ptr<Content> content;
}
-DCPTime
-Player::resampled_audio_to_dcp (shared_ptr<const Piece> piece, Frame f) const
-{
- /* See notes in content_video_to_dcp */
- return DCPTime::from_frames (f, _film->audio_frame_rate())
- - DCPTime (piece->content->trim_start(), piece->frc)
- + piece->position();
-}
-
-ContentTime
-Player::dcp_to_content_time (shared_ptr<const Piece> piece, DCPTime t) const
-{
- DCPTime s = t - piece->position ();
- s = min (piece->content->length_after_trim(_film), s);
- return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start());
-}
-
list<shared_ptr<Font> >
Player::get_subtitle_fonts ()
{
int const rfr = content->resampled_frame_rate (_film);
/* Compute time in the DCP */
- DCPTime time = resampled_audio_to_dcp (piece, content_audio.frame);
+ DCPTime time = piece->resampled_audio_to_dcp (_film, content_audio.frame);
/* And the end of this block in the DCP */
DCPTime end = time + DCPTime::from_frames(content_audio.audio->frames(), rfr);
content we may not start right at the beginning of the next, causing a gap (if the next content has
been trimmed to a point between keyframes, or something).
*/
- i->decoder->seek (dcp_to_content_time (i, i->content->position()), true);
+ i->decoder->seek (i->dcp_to_content_time(_film, i->content->position()), true);
i->done = false;
} else if (i->content->position() <= time && time < i->end(_film)) {
/* During; seek to position */
- i->decoder->seek (dcp_to_content_time (i, time), accurate);
+ i->decoder->seek (i->dcp_to_content_time(_film, time), accurate);
i->done = false;
} else {
/* After; this piece is done */
void film_change (ChangeType, Film::Property);
void playlist_change (ChangeType);
void playlist_content_change (ChangeType, int, bool);
- dcpomatic::DCPTime resampled_audio_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const;
- dcpomatic::ContentTime dcp_to_content_time (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const;
boost::shared_ptr<PlayerVideo> black_player_video_frame (Eyes eyes) const;
void video (boost::weak_ptr<Piece>, ContentVideo);