Add _sign_language property to Content.
[dcpomatic.git] / src / lib / video_content.h
index c1e1dbeec5b05345f96730b56bd6871da6c4dead..864fa11aa87eb36262dcb95e7499dea64b514ef7 100644 (file)
 
 #include "colour_conversion.h"
 #include "content_part.h"
+#include "crop.h"
 #include "dcpomatic_time.h"
-#include "types.h"
+#include "pixel_quanta.h"
 #include "user_property.h"
+#include "video_frame_type.h"
+#include "video_range.h"
+#include "video_type.h"
+#include "types.h"
 #include <dcp/language_tag.h>
 #include <boost/thread/mutex.hpp>
 
@@ -45,7 +50,6 @@ public:
        static int const SIZE;
        static int const FRAME_TYPE;
        static int const CROP;
-       static int const SCALE;
        static int const COLOUR_CONVERSION;
        static int const FADE_IN;
        static int const FADE_OUT;
@@ -53,6 +57,7 @@ public:
        static int const CUSTOM_RATIO;
        static int const CUSTOM_SIZE;
        static int const BURNT_SUBTITLE_LANGUAGE;
+       static int const TYPE;
 };
 
 
@@ -60,7 +65,7 @@ class VideoContent : public ContentPart, public std::enable_shared_from_this<Vid
 {
 public:
        explicit VideoContent (Content* parent);
-       VideoContent (Content* parent, cxml::ConstNodePtrint);
+       VideoContent (Content* parent, cxml::ConstNodePtr node, int version, VideoRange video_range_hint);
        VideoContent (Content* parent, std::vector<std::shared_ptr<Content>>);
 
        void as_xml (xmlpp::Node *) const;
@@ -87,8 +92,10 @@ public:
                return _size;
        }
 
+       void set_type(VideoType type);
        void set_frame_type (VideoFrameType);
 
+       void set_crop (Crop crop);
        void set_left_crop (int);
        void set_right_crop (int);
        void set_top_crop (int);
@@ -108,32 +115,39 @@ public:
 
        void set_burnt_subtitle_language (boost::optional<dcp::LanguageTag> language);
 
+       VideoType type() const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _type;
+       }
+
        VideoFrameType frame_type () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _frame_type;
        }
 
-       Crop crop () const {
+       Crop actual_crop () const;
+
+       Crop requested_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop;
        }
 
-       int left_crop () const {
+       int requested_left_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.left;
        }
 
-       int right_crop () const {
+       int requested_right_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.right;
        }
 
-       int top_crop () const {
+       int requested_top_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.top;
        }
 
-       int bottom_crop () const {
+       int requested_bottom_crop () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _crop.bottom;
        }
@@ -181,6 +195,11 @@ public:
                return _range;
        }
 
+       PixelQuanta pixel_quanta () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _pixel_quanta;
+       }
+
        bool use () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _use;
@@ -197,19 +216,19 @@ public:
        dcp::Size size_after_crop () const;
        dcp::Size scaled_size (dcp::Size container_size);
 
-       boost::optional<double> fade (std::shared_ptr<const Film> film, Frame) const;
+       boost::optional<double> fade(std::shared_ptr<const Film> film, dcpomatic::ContentTime time) const;
 
        std::string processing_description (std::shared_ptr<const Film> film);
 
        void set_length (Frame);
 
-       void take_from_examiner (std::shared_ptr<VideoExaminer>);
+       void take_from_examiner(std::shared_ptr<const Film> film, std::shared_ptr<VideoExaminer>);
        void add_properties (std::list<UserProperty> &) const;
 
        void modify_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const;
        void modify_trim_start (dcpomatic::ContentTime& pos) const;
 
-       static std::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtrint);
+       static std::shared_ptr<VideoContent> from_xml (Content* parent, cxml::ConstNodePtr node, int version, VideoRange video_range_hint);
 
 private:
 
@@ -227,6 +246,7 @@ private:
        Frame _length;
        boost::optional<ColourConversion> _colour_conversion;
        dcp::Size _size;
+       VideoType _type;
        VideoFrameType _frame_type;
        Crop _crop;
        /** ratio to scale cropped image to (or none to guess); i.e. if set, scale to _custom_ratio:1 */
@@ -246,6 +266,7 @@ private:
        /** fade out time in content frames */
        Frame _fade_out;
        VideoRange _range;
+       PixelQuanta _pixel_quanta;
        boost::optional<dcp::LanguageTag> _burnt_subtitle_language;
 };