using std::vector;
using boost::shared_ptr;
-ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path p)
- : Content (film)
+ImageContent::ImageContent (boost::filesystem::path p)
{
video.reset (new VideoContent (this));
}
-ImageContent::ImageContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
- : Content (film, node)
+ImageContent::ImageContent (cxml::ConstNodePtr node, int version)
+ : Content (node)
{
video = VideoContent::from_xml (this, node, version);
}
}
void
-ImageContent::examine (shared_ptr<Job> job)
+ImageContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
{
if (_path_to_scan) {
job->sub (_("Scanning image files"));
set_paths (paths);
}
- Content::examine (job);
-
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
+ Content::examine (film, job);
shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
video->take_from_examiner (examiner);
}
DCPTime
-ImageContent::full_length () const
+ImageContent::full_length (shared_ptr<const Film> film) const
+{
+ FrameRateChange const frc (film, shared_from_this());
+ return DCPTime::from_frames (llrint(video->length_after_3d_combine() * frc.factor()), film->video_frame_rate());
+}
+
+DCPTime
+ImageContent::approximate_length () const
{
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
- FrameRateChange const frc (active_video_frame_rate(), film->video_frame_rate());
- return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor ()), film->video_frame_rate ());
+ return DCPTime::from_frames (video->length_after_3d_combine(), 24);
}
string
}
void
-ImageContent::add_properties (list<UserProperty>& p) const
+ImageContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const
{
- Content::add_properties (p);
+ Content::add_properties (film, p);
video->add_properties (p);
}