Add PlaylistEditorRestrictedMenus option, similar to PlayerRestrictedMenus.
[dcpomatic.git] / src / lib / config.h
index 2535bd82ae0d5ef3f34ca891b04c0f15623888d0..ec804c9bf58cbdad822028f2da3f7f135b972706 100644 (file)
@@ -79,6 +79,8 @@ public:
        boost::filesystem::path default_directory_or (boost::filesystem::path a) const;
        boost::filesystem::path default_kdm_directory_or (boost::filesystem::path a) const;
 
+       void load_from_zip(boost::filesystem::path zip_file);
+
        enum Property {
                USE_ANY_SERVERS,
                SERVERS,
@@ -93,6 +95,11 @@ public:
                SHOW_EXPERIMENTAL_AUDIO_PROCESSORS,
                AUDIO_MAPPING,
                AUTO_CROP_THRESHOLD,
+               ALLOW_SMPTE_BV20,
+               ISDCF_NAME_PART_LENGTH,
+#ifdef DCPOMATIC_GROK
+               GROK,
+#endif
                OTHER
        };
 
@@ -428,6 +435,7 @@ public:
                NAG_32_ON_64,
                NAG_TOO_MANY_DROPPED_FRAMES,
                NAG_BAD_SIGNER_CHAIN_VALIDITY,
+               NAG_BAD_SIGNER_DN_QUALIFIER,
                NAG_COUNT
        };
 
@@ -526,6 +534,14 @@ public:
                return _player_mode;
        }
 
+       bool player_restricted_menus() const {
+               return _player_restricted_menus;
+       }
+
+       bool playlist_editor_restricted_menus() const {
+               return _playlist_editor_restricted_menus;
+       }
+
        int image_display () const {
                return _image_display;
        }
@@ -565,9 +581,7 @@ public:
                return _custom_languages;
        }
 
-       boost::optional<boost::filesystem::path> add_files_path () const {
-               return _add_files_path;
-       }
+       boost::optional<boost::filesystem::path> initial_path(std::string id) const;
 
        bool use_isdcf_name_by_default () const {
                return _use_isdcf_name_by_default;
@@ -605,6 +619,45 @@ public:
                return _main_content_divider_sash_position;
        }
 
+       enum class DefaultAddFileLocation {
+               SAME_AS_LAST_TIME,
+               SAME_AS_PROJECT
+       };
+
+       DefaultAddFileLocation default_add_file_location() const {
+               return _default_add_file_location;
+       }
+
+       bool allow_smpte_bv20() const {
+               return _allow_smpte_bv20;
+       }
+
+#ifdef DCPOMATIC_GROK
+       class Grok
+       {
+       public:
+               Grok() = default;
+               Grok(cxml::ConstNodePtr node);
+
+               void as_xml(xmlpp::Element* node) const;
+
+               bool enable = false;
+               boost::filesystem::path binary_location;
+               int selected = 0;
+               std::string licence_server;
+               int licence_port = 5000;
+               std::string licence;
+       };
+
+       boost::optional<Grok> grok() const {
+               return _grok;
+       }
+#endif
+
+       int isdcf_name_part_length() const {
+               return _isdcf_name_part_length;
+       }
+
        /* SET (mostly) */
 
        void set_master_encoding_threads (int n) {
@@ -1128,10 +1181,7 @@ public:
 
        void add_custom_language (dcp::LanguageTag tag);
 
-       void set_add_files_path (boost::filesystem::path p) {
-               _add_files_path = p;
-               changed ();
-       }
+       void set_initial_path(std::string id, boost::filesystem::path path);
 
        void set_use_isdcf_name_by_default (bool use) {
                maybe_set (_use_isdcf_name_by_default, use);
@@ -1177,6 +1227,23 @@ public:
                maybe_set(_main_content_divider_sash_position, position);
        }
 
+       void set_default_add_file_location(DefaultAddFileLocation location) {
+               maybe_set(_default_add_file_location, location);
+       }
+
+       void set_allow_smpte_bv20(bool allow) {
+               maybe_set(_allow_smpte_bv20, allow, ALLOW_SMPTE_BV20);
+       }
+
+#ifdef DCPOMATIC_GROK
+       void set_grok(Grok const& grok);
+#endif
+
+       void set_isdcf_name_part_length(int length) {
+               maybe_set(_isdcf_name_part_length, length, ISDCF_NAME_PART_LENGTH);
+       }
+
+
        void changed (Property p = OTHER);
        boost::signals2::signal<void (Property)> Changed;
        /** Emitted if read() failed on an existing Config file.  There is nothing
@@ -1198,6 +1265,7 @@ public:
                BAD_SIGNER_INCONSISTENT,      ///< signer chain is somehow inconsistent
                BAD_DECRYPTION_INCONSISTENT,  ///< KDM decryption chain is somehow inconsistent
                BAD_SIGNER_VALIDITY_TOO_LONG, ///< signer certificate validity periods are >10 years
+               BAD_SIGNER_DN_QUALIFIER,      ///< some signer certificate has a bad dnQualifier (DoM #2716).
        };
 
        static boost::signals2::signal<bool (BadReason)> Bad;
@@ -1389,6 +1457,8 @@ private:
        boost::optional<std::string> _gdc_username;
        boost::optional<std::string> _gdc_password;
        PlayerMode _player_mode;
+       bool _player_restricted_menus = false;
+       bool _playlist_editor_restricted_menus = false;
        int _image_display;
        VideoViewType _video_view_type;
        bool _respect_kdm_validity_periods;
@@ -1403,7 +1473,7 @@ private:
        boost::optional<boost::filesystem::path> _player_kdm_directory;
        boost::optional<AudioMapping> _audio_mapping;
        std::vector<dcp::LanguageTag> _custom_languages;
-       boost::optional<boost::filesystem::path> _add_files_path;
+       std::map<std::string, boost::optional<boost::filesystem::path>> _initial_paths;
        bool _use_isdcf_name_by_default;
        bool _write_kdms_to_disk;
        bool _email_kdms;
@@ -1413,6 +1483,13 @@ private:
        boost::optional<std::string> _last_release_notes_version;
        boost::optional<int> _main_divider_sash_position;
        boost::optional<int> _main_content_divider_sash_position;
+       DefaultAddFileLocation _default_add_file_location;
+       bool _allow_smpte_bv20;
+       int _isdcf_name_part_length;
+
+#ifdef DCPOMATIC_GROK
+       boost::optional<Grok> _grok;
+#endif
 
        ExportConfig _export;