Add PlaylistEditorRestrictedMenus option, similar to PlayerRestrictedMenus.
[dcpomatic.git] / src / lib / config.h
index bd040f09abe3f3eecef979576176c4d95eb64f1a..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,
@@ -95,6 +97,9 @@ public:
                AUTO_CROP_THRESHOLD,
                ALLOW_SMPTE_BV20,
                ISDCF_NAME_PART_LENGTH,
+#ifdef DCPOMATIC_GROK
+               GROK,
+#endif
                OTHER
        };
 
@@ -529,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;
        }
@@ -619,27 +632,27 @@ public:
                return _allow_smpte_bv20;
        }
 
-       boost::filesystem::path gpu_binary_location() const {
-               return _gpu_binary_location;
-       }
+#ifdef DCPOMATIC_GROK
+       class Grok
+       {
+       public:
+               Grok() = default;
+               Grok(cxml::ConstNodePtr node);
 
-       bool enable_gpu () const {
-               return _enable_gpu;
-       }
+               void as_xml(xmlpp::Element* node) const;
 
-       int selected_gpu () const {
-               return _selected_gpu;
-       }
-       std::string gpu_license_server () const {
-               return _gpu_license_server;
-       }
+               bool enable = false;
+               boost::filesystem::path binary_location;
+               int selected = 0;
+               std::string licence_server;
+               int licence_port = 5000;
+               std::string licence;
+       };
 
-       int gpu_license_port () const {
-               return _gpu_license_port;
-       }
-       std::string gpu_license () const {
-               return _gpu_license;
+       boost::optional<Grok> grok() const {
+               return _grok;
        }
+#endif
 
        int isdcf_name_part_length() const {
                return _isdcf_name_part_length;
@@ -1222,29 +1235,9 @@ public:
                maybe_set(_allow_smpte_bv20, allow, ALLOW_SMPTE_BV20);
        }
 
-       void set_gpu_binary_location(boost::filesystem::path location) {
-               maybe_set (_gpu_binary_location, location);
-       }
-
-       void set_enable_gpu (bool enable) {
-               maybe_set (_enable_gpu, enable);
-       }
-
-       void set_selected_gpu (int selected) {
-               maybe_set (_selected_gpu, selected);
-       }
-
-       void set_gpu_license_server (std::string s) {
-               maybe_set (_gpu_license_server, s);
-       }
-
-       void set_gpu_license_port (int p) {
-               maybe_set (_gpu_license_port, p);
-       }
-
-       void set_gpu_license (std::string p) {
-               maybe_set (_gpu_license, p);
-       }
+#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);
@@ -1464,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;
@@ -1492,13 +1487,9 @@ private:
        bool _allow_smpte_bv20;
        int _isdcf_name_part_length;
 
-       /* GPU */
-       bool _enable_gpu;
-       boost::filesystem::path _gpu_binary_location;
-       int _selected_gpu;
-       std::string _gpu_license_server;
-       int _gpu_license_port;
-       std::string _gpu_license;
+#ifdef DCPOMATIC_GROK
+       boost::optional<Grok> _grok;
+#endif
 
        ExportConfig _export;