Partial attempt at cleanup of naming straight vs DCI.
[dcpomatic.git] / src / lib / film.h
index f746da480cc23a2fee989db89e92397799661aaa..a1cf26bc61896f8ac15620cf11c6a5ac06ab10a1 100644 (file)
@@ -29,6 +29,7 @@
 #include <vector>
 #include <inttypes.h>
 #include <boost/thread/mutex.hpp>
+#include <boost/thread.hpp>
 #include <sigc++/signal.h>
 extern "C" {
 #include <libavcodec/avcodec.h>
@@ -70,24 +71,18 @@ public:
                return _state.name;
        }
 
-       /** @return number of pixels to crop from the top of the original picture */
-       int top_crop () const {
-               return _state.top_crop;
+       /** @return name to give the DCP */
+       std::string dcp_name () const {
+               return _state.dcp_name ();
        }
 
-       /** @return number of pixels to crop from the bottom of the original picture */
-       int bottom_crop () const {
-               return _state.bottom_crop;
+       bool use_dci_name () const {
+               return _state.use_dci_name;
        }
 
-       /** @return number of pixels to crop from the left-hand side of the original picture */
-       int left_crop () const {
-               return _state.left_crop;
-       }
-
-       /** @return number of pixels to crop from the right-hand side of the original picture */
-       int right_crop () const {
-               return _state.right_crop;
+       /** @return number of pixels to crop from the sides of the original picture */
+       Crop crop () const {
+               return _state.crop;
        }
 
        /** @return the format to present this film in (flat, scope, etc.) */
@@ -133,6 +128,18 @@ public:
        int still_duration () const {
                return _state.still_duration;
        }
+
+       bool with_subtitles () const {
+               return _state.with_subtitles;
+       }
+
+       int subtitle_offset () const {
+               return _state.subtitle_offset;
+       }
+
+       float subtitle_scale () const {
+               return _state.subtitle_scale;
+       }
        
        void set_filters (std::vector<Filter const *> const &);
 
@@ -148,17 +155,27 @@ public:
        void set_dcp_ab (bool);
        
        void set_name (std::string);
+       void set_use_dci_name (bool);
        void set_content (std::string);
        void set_top_crop (int);
        void set_bottom_crop (int);
        void set_left_crop (int);
        void set_right_crop (int);
-       void set_frames_per_second (float);
        void set_format (Format const *);
        void set_dcp_content_type (DCPContentType const *);
        void set_audio_gain (float);
        void set_audio_delay (int);
        void set_still_duration (int);
+       void set_with_subtitles (bool);
+       void set_subtitle_offset (int);
+       void set_subtitle_scale (float);
+       void set_audio_language (std::string);
+       void set_subtitle_language (std::string);
+       void set_territory (std::string);
+       void set_rating (std::string);
+       void set_studio (std::string);
+       void set_facility (std::string);
+       void set_package_type (std::string);
 
        /** @return size, in pixels, of the source (ignoring cropping) */
        Size size () const {
@@ -189,7 +206,39 @@ public:
        AVSampleFormat audio_sample_format () const {
                return _state.audio_sample_format;
        }
+
+       bool has_subtitles () const {
+               return _state.has_subtitles;
+       }
+
+       std::string audio_language () const {
+               return _state.audio_language;
+       }
+
+       std::string subtitle_language () const {
+               return _state.subtitle_language;
+       }
        
+       std::string territory () const {
+               return _state.territory;
+       }
+
+       std::string rating () const {
+               return _state.rating;
+       }
+
+       std::string studio () const {
+               return _state.studio;
+       }
+
+       std::string facility () const {
+               return _state.facility;
+       }
+
+       std::string package_type () const {
+               return _state.package_type;
+       }
+
        std::string j2k_dir () const;
 
        std::vector<std::string> audio_files () const;
@@ -199,6 +248,7 @@ public:
        int num_thumbs () const;
        int thumb_frame (int) const;
        std::string thumb_file (int) const;
+       std::pair<Position, std::string> thumb_subtitle (int) const;
 
        void copy_from_dvd_post_gui ();
        void examine_content ();
@@ -214,14 +264,12 @@ public:
        void make_dcp (bool, int freq = 0);
 
        enum Property {
+               NONE,
                NAME,
                CONTENT,
                DCP_CONTENT_TYPE,
                FORMAT,
-               LEFT_CROP,
-               RIGHT_CROP,
-               TOP_CROP,
-               BOTTOM_CROP,
+               CROP,
                FILTERS,
                SCALER,
                DCP_FRAMES,
@@ -235,7 +283,12 @@ public:
                FRAMES_PER_SECOND,
                AUDIO_CHANNELS,
                AUDIO_SAMPLE_RATE,
-               STILL_DURATION
+               STILL_DURATION,
+               WITH_SUBTITLES,
+               SUBTITLE_OFFSET,
+               SUBTITLE_SCALE,
+               USE_DCI_NAME,
+               DCI_METADATA
        };
 
        boost::shared_ptr<FilmState> state_copy () const;
@@ -247,6 +300,8 @@ public:
                return _log;
        }
 
+       int encoded_frames () const;
+
        /** Emitted when some metadata property has changed */
        mutable sigc::signal1<void, Property> Changed;