Take some stuff out of VideoContent into ContentPart.
[dcpomatic.git] / src / lib / video_content.h
index 6896551314eaaf9c2a96ae7d5b28af2e1781d044..075f7b7015b623a7be591210aff0efd1af90ccfb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2016 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
 #ifndef DCPOMATIC_VIDEO_CONTENT_H
 #define DCPOMATIC_VIDEO_CONTENT_H
 
-#include "content.h"
 #include "colour_conversion.h"
 #include "video_content_scale.h"
+#include "dcpomatic_time.h"
+#include "user_property.h"
+#include "types.h"
+#include "content_part.h"
+#include <boost/thread/mutex.hpp>
+#include <boost/weak_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
 
 class VideoExaminer;
 class Ratio;
+class Film;
+class Content;
 
 class VideoContentProperty
 {
@@ -40,25 +48,18 @@ public:
        static int const VIDEO_FADE_OUT;
 };
 
-class VideoContent : public virtual Content
+class VideoContent : public ContentPart, public boost::enable_shared_from_this<VideoContent>
 {
 public:
-       VideoContent (boost::shared_ptr<const Film>);
-       VideoContent (boost::shared_ptr<const Film>, DCPTime, Frame);
-       VideoContent (boost::shared_ptr<const Film>, boost::filesystem::path);
-       VideoContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
-       VideoContent (boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
+       VideoContent (Content* parent, boost::shared_ptr<const Film>);
+       VideoContent (Content* parent, boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
+       VideoContent (Content* parent, boost::shared_ptr<const Film>, std::vector<boost::shared_ptr<Content> >);
 
        void as_xml (xmlpp::Node *) const;
        std::string technical_summary () const;
-       virtual std::string identifier () const;
+       std::string identifier () const;
 
-       virtual void set_default_colour_conversion ();
-
-       /** @return points at which to split this content when
-        *  REELTYPE_BY_VIDEO_CONTENT is in use.
-        */
-       virtual std::list<DCPTime> reel_split_points () const;
+       void set_default_colour_conversion ();
 
        Frame video_length () const {
                boost::mutex::scoped_lock lm (_mutex);
@@ -177,16 +178,18 @@ public:
 
        std::string processing_description () const;
 
-protected:
+       void set_video_length (Frame);
+
        void take_from_video_examiner (boost::shared_ptr<VideoExaminer>);
-       void add_properties (std::list<std::pair<std::string, std::string> > &) const;
+       void add_properties (std::list<UserProperty> &) const;
+
+private:
 
        Frame _video_length;
        /** Video frame rate, or not set if this content should use the DCP's frame rate */
        boost::optional<double> _video_frame_rate;
        boost::optional<ColourConversion> _colour_conversion;
 
-private:
        friend struct ffmpeg_pts_offset_test;
        friend struct best_dcp_frame_rate_test_single;
        friend struct best_dcp_frame_rate_test_double;