Merge master branch.
[dcpomatic.git] / src / lib / film.h
index d3530b81772ac43f117d2d4f2734778c9d0d28c9..60646b0c8d78adc52f6fa8da0740d704926ac1c9 100644 (file)
@@ -78,6 +78,10 @@ public:
        std::string file (std::string f) const;
        std::string dir (std::string d) const;
 
+       std::string frame_out_path (int f, bool t) const;
+       std::string hash_out_path (int f, bool t) const;
+       std::string multichannel_audio_out_path (int c, bool t) const;
+       
        std::string content_path () const;
        ContentType content_type () const;
        
@@ -87,10 +91,13 @@ public:
        void read_metadata ();
 
        libdcp::Size cropped_size (libdcp::Size) const;
-       boost::optional<int> dcp_length () const;
        std::string dci_name () const;
        std::string dcp_name () const;
 
+       boost::optional<int> dcp_intrinsic_duration () const {
+               return _dcp_intrinsic_duration;
+       }
+
        /** @return true if our state has changed since we last saved it */
        bool dirty () const {
                return _dirty;
@@ -114,8 +121,8 @@ public:
                CROP,
                FILTERS,
                SCALER,
-               DCP_TRIM_START,
-               DCP_TRIM_END,
+               TRIM_START,
+               TRIM_END,
                DCP_AB,
                CONTENT_AUDIO_STREAM,
                EXTERNAL_AUDIO,
@@ -132,6 +139,7 @@ public:
                DCI_METADATA,
                SIZE,
                LENGTH,
+               DCP_INTRINSIC_DURATION,
                CONTENT_AUDIO_STREAMS,
                SUBTITLE_STREAMS,
                FRAMES_PER_SECOND,
@@ -190,14 +198,14 @@ public:
                return _scaler;
        }
 
-       SourceFrame dcp_trim_start () const {
+       int trim_start () const {
                boost::mutex::scoped_lock lm (_state_mutex);
-               return _dcp_trim_start;
+               return _trim_start;
        }
 
-       SourceFrame dcp_trim_end () const {
+       int trim_end () const {
                boost::mutex::scoped_lock lm (_state_mutex);
-               return _dcp_trim_end;
+               return _trim_end;
        }
 
        bool dcp_ab () const {
@@ -235,6 +243,8 @@ public:
                return _still_duration;
        }
 
+       int still_duration_in_frames () const;
+
        boost::shared_ptr<SubtitleStream> subtitle_stream () const {
                boost::mutex::scoped_lock lm (_state_mutex);
                return _subtitle_stream;
@@ -353,8 +363,8 @@ public:
        void set_bottom_crop (int);
        void set_filters (std::vector<Filter const *>);
        void set_scaler (Scaler const *);
-       void set_dcp_trim_start (int);
-       void set_dcp_trim_end (int);
+       void set_trim_start (int);
+       void set_trim_end (int);
        void set_dcp_ab (bool);
        void set_content_audio_stream (boost::shared_ptr<AudioStream>);
        void set_external_audio (std::vector<std::string>);
@@ -378,6 +388,7 @@ public:
        void set_size (libdcp::Size);
        void set_length (SourceFrame);
        void unset_length ();
+       void set_dcp_intrinsic_duration (int);
        void set_content_digest (std::string);
        void set_content_audio_streams (std::vector<boost::shared_ptr<AudioStream> >);
        void set_subtitle_streams (std::vector<boost::shared_ptr<SubtitleStream> >);
@@ -434,9 +445,9 @@ private:
        /** Scaler algorithm to use */
        Scaler const * _scaler;
        /** Frames to trim off the start of the DCP */
-       int _dcp_trim_start;
+       int _trim_start;
        /** Frames to trim off the end of the DCP */
-       int _dcp_trim_end;
+       int _trim_end;
        /** true to create an A/B comparison DCP, where the left half of the image
            is the video without any filters or post-processing, and the right half
            has the specified filters and post-processing.
@@ -484,10 +495,11 @@ private:
 
        /* Data which are cached to speed things up */
 
-       /** libdcp::Size, in pixels, of the source (ignoring cropping) */
+       /** Size, in pixels, of the source (ignoring cropping) */
        libdcp::Size _size;
        /** The length of the source, in video frames (as far as we know) */
        boost::optional<SourceFrame> _length;
+       boost::optional<int> _dcp_intrinsic_duration;
        /** MD5 digest of our content file */
        std::string _content_digest;
        /** The audio streams in our content */