Make CPL metadata writing optional.
[dcpomatic.git] / src / lib / film.h
index d42eb5626b71dad5050e3fa5335002611f59edf1..8d0d6187aa92fef705964c83a018a79d3a02fa92 100644 (file)
@@ -37,6 +37,7 @@
 #include "types.h"
 #include "util.h"
 #include <dcp/encrypted_kdm.h>
+#include <dcp/file.h>
 #include <dcp/key.h>
 #include <dcp/language_tag.h>
 #include <dcp/rating.h>
@@ -75,13 +76,8 @@ class InfoFileHandle
 {
 public:
        InfoFileHandle (boost::mutex& mutex, boost::filesystem::path file, bool read);
-       ~InfoFileHandle ();
 
-       FILE* get () const {
-               return _handle;
-       }
-
-       boost::filesystem::path file () const {
+       dcp::File& get () {
                return _file;
        }
 
@@ -89,10 +85,10 @@ private:
        friend class Film;
 
        boost::mutex::scoped_lock _lock;
-       FILE* _handle;
-       boost::filesystem::path _file;
+       dcp::File _file;
 };
 
+
 /** @class Film
  *
  *  @brief A representation of some audio, video, subtitle and closed-caption content,
@@ -214,6 +210,8 @@ public:
                return _tolerant;
        }
 
+       bool last_written_by_earlier_than(int major, int minor, int micro) const;
+
        /** Identifiers for the parts of our state;
            used for signalling changes.
        */
@@ -259,6 +257,7 @@ public:
                RED_BAND,
                TWO_D_VERSION_OF_THREE_D,
                LUMINANCE,
+               WRITE_CPL_METADATA,
        };
 
 
@@ -420,6 +419,10 @@ public:
                return _audio_frame_rate;
        }
 
+       bool write_cpl_metadata() const {
+               return _write_cpl_metadata;
+       }
+
        /* SET */
 
        void set_directory (boost::filesystem::path);
@@ -467,6 +470,7 @@ public:
        void set_luminance (boost::optional<dcp::Luminance> l = boost::none);
        void set_audio_language (boost::optional<dcp::LanguageTag> language);
        void set_audio_frame_rate (int rate);
+       void set_write_cpl_metadata(bool write);
 
        void add_ffoc_lfoc (Markers& markers) const;
 
@@ -520,6 +524,8 @@ private:
         */
        boost::optional<boost::filesystem::path> _directory;
 
+       boost::optional<std::string> _last_written_by;
+
        /** Name for DCP-o-matic */
        std::string _name;
        /** True if a auto-generated ISDCF-compliant name should be used for our DCP */
@@ -578,6 +584,7 @@ private:
        boost::optional<dcp::Luminance> _luminance;
        boost::optional<dcp::LanguageTag> _audio_language;
        int _audio_frame_rate = 48000;
+       bool _write_cpl_metadata = true;
 
        int _state_version;