Some work on DCI naming. Clean up compacted / aligned image handling somewhat.
[dcpomatic.git] / src / lib / film_state.h
index 1df2dc95d7fe88e77cf086a129f928fec01d83a4..e58d46b0f6fcb605fa55cf7cd09c87e841374a9d 100644 (file)
@@ -55,10 +55,6 @@ public:
                : dcp_content_type (0)
                , frames_per_second (0)
                , format (0)
-               , left_crop (0)
-               , right_crop (0)
-               , top_crop (0)
-               , bottom_crop (0)
                , scaler (Scaler::from_id ("bicubic"))
                , dcp_frames (0)
                , dcp_trim_action (CUT)
@@ -66,10 +62,14 @@ public:
                , audio_gain (0)
                , audio_delay (0)
                , still_duration (10)
+               , with_subtitles (false)
+               , subtitle_offset (0)
+               , subtitle_scale (1)
                , length (0)
                , audio_channels (0)
                , audio_sample_rate (0)
                , audio_sample_format (AV_SAMPLE_FMT_NONE)
+               , has_subtitles (false)
        {}
 
        std::string file (std::string f) const;
@@ -81,14 +81,18 @@ public:
        bool content_is_dvd () const;
 
        std::string thumb_file (int) const;
+       std::string thumb_base (int) const;
        int thumb_frame (int) const;
 
        int bytes_per_sample () const;
+       int target_sample_rate () const;
        
        void write_metadata (std::ofstream &) const;
        void read_metadata (std::string, std::string);
 
        Size cropped_size (Size) const;
+       int dcp_length () const;
+       std::string dci_name () const;
 
        /** Complete path to directory containing the film metadata;
            must not be relative.
@@ -106,14 +110,7 @@ public:
        float frames_per_second;
        /** The format to present this Film in (flat, scope, etc.) */
        Format const * format;
-       /** Number of pixels to crop from the left-hand side of the original picture */
-       int left_crop;
-       /** Number of pixels to crop from the right-hand side of the original picture */
-       int right_crop;
-       /** Number of pixels to crop from the top of the original picture */
-       int top_crop;
-       /** Number of pixels to crop from the bottom of the original picture */
-       int bottom_crop;
+       Crop crop;
        /** Video filters that should be used when generating DCPs */
        std::vector<Filter const *> filters;
        /** Scaler algorithm to use */
@@ -134,6 +131,22 @@ public:
        int audio_delay;
        /** Duration to make still-sourced films (in seconds) */
        int still_duration;
+       bool with_subtitles;
+       /** y offset for placing subtitles, in source pixels; +ve is further down
+           the frame, -ve is further up.
+       */
+       int subtitle_offset;
+       float subtitle_scale;
+
+       /* DCI naming stuff */
+       std::string dci_name_prefix;
+       std::string audio_language;
+       std::string subtitle_language;
+       std::string territory;
+       std::string rating;
+       std::string studio;
+       std::string facility;
+       std::string package_type;
 
        /* Data which is cached to speed things up */
 
@@ -151,9 +164,12 @@ public:
        AVSampleFormat audio_sample_format;
        /** MD5 digest of our content file */
        std::string content_digest;
+       /** true if the source has subtitles */
+       bool has_subtitles;
 
 private:
        std::string thumb_file_for_frame (int) const;
+       std::string thumb_base_for_frame (int) const;
 };
 
 #endif