Merge branch 'master' into content-rework-take5
[dcpomatic.git] / src / lib / film.h
index afd57b7c24703fe171ecf4bae85a6f467454bdf6..6e097d44e86ee2402961c856d8547e48f97f1647 100644 (file)
@@ -47,6 +47,7 @@ class ExamineContentJob;
 class AnalyseAudioJob;
 class ExternalAudioStream;
 class Content;
+class Player;
 class Playlist;
 
 /** @class Film
@@ -105,7 +106,17 @@ public:
 
        bool have_dcp () const;
 
-       boost::shared_ptr<Playlist> playlist () const;
+       boost::shared_ptr<Player> player () const;
+
+       ContentAudioFrame audio_length () const;
+       int audio_channels () const;
+       int audio_frame_rate () const;
+       int64_t audio_channel_layout () const;
+       bool has_audio () const;
+       
+       float video_frame_rate () const;
+       libdcp::Size video_size () const;
+       ContentVideoFrame video_length () const;        
 
        /** Identifiers for the parts of our state;
            used for signalling changes.
@@ -114,7 +125,7 @@ public:
                NONE,
                NAME,
                USE_DCI_NAME,
-               TRUST_CONTENT_HEADER,
+               TRUST_CONTENT_HEADERS,
                CONTENT,
                DCP_CONTENT_TYPE,
                FORMAT,
@@ -123,7 +134,7 @@ public:
                SCALER,
                TRIM_START,
                TRIM_END,
-               DCP_AB,
+               AB,
                AUDIO_GAIN,
                AUDIO_DELAY,
                STILL_DURATION,
@@ -155,9 +166,9 @@ public:
                return _use_dci_name;
        }
 
-       bool trust_content_header () const {
+       bool trust_content_headers () const {
                boost::mutex::scoped_lock lm (_state_mutex);
-               return _trust_content_header;
+               return _trust_content_headers;
        }
 
        std::list<boost::shared_ptr<Content> > content () const {
@@ -200,9 +211,9 @@ public:
                return _trim_end;
        }
 
-       bool dcp_ab () const {
+       bool ab () const {
                boost::mutex::scoped_lock lm (_state_mutex);
-               return _dcp_ab;
+               return _ab;
        }
 
        float audio_gain () const {
@@ -255,7 +266,7 @@ public:
        void set_directory (std::string);
        void set_name (std::string);
        void set_use_dci_name (bool);
-       void set_trust_content_header (bool);
+       void set_trust_content_headers (bool);
        void add_content (boost::shared_ptr<Content>);
        void set_dcp_content_type (DCPContentType const *);
        void set_format (Format const *);
@@ -268,7 +279,7 @@ public:
        void set_scaler (Scaler const *);
        void set_trim_start (int);
        void set_trim_end (int);
-       void set_dcp_ab (bool);
+       void set_ab (bool);
        void set_audio_gain (float);
        void set_audio_delay (int);
        void set_still_duration (int);
@@ -301,6 +312,8 @@ private:
        void analyse_audio_finished ();
        std::string video_state_identifier () const;
 
+       boost::shared_ptr<Playlist> _playlist;
+
        /** Complete path to directory containing the film metadata;
         *  must not be relative.
         */
@@ -314,11 +327,7 @@ private:
        bool _use_dci_name;
        typedef std::list<boost::shared_ptr<Content> > ContentList;
        ContentList _content;
-       /** If this is true, we will believe the length specified by the content
-        *  file's header; if false, we will run through the whole content file
-        *  the first time we see it in order to obtain the length.
-        */
-       bool _trust_content_header;
+       bool _trust_content_headers;
        /** The type of content that this Film represents (feature, trailer etc.) */
        DCPContentType const * _dcp_content_type;
        /** The format to present this Film in (flat, scope, etc.) */
@@ -337,7 +346,7 @@ private:
            is the video without any filters or post-processing, and the right half
            has the specified filters and post-processing.
        */
-       bool _dcp_ab;
+       bool _ab;
        /** Gain to apply to audio in dB */
        float _audio_gain;
        /** Delay to apply to audio (positive moves audio later) in milliseconds */