Distinguish master DoM encode threads count from the server count.
[dcpomatic.git] / src / lib / config.h
index abfdba3dd56cd2347022a7aaf4d47e12acfcbecb..40380f825f3247e7e545be4c4f5a12c4c3d6a79c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -47,9 +47,14 @@ class Film;
 class Config : public boost::noncopyable
 {
 public:
-       /** @return number of threads to use for J2K encoding on the local machine */
-       int num_local_encoding_threads () const {
-               return _num_local_encoding_threads;
+       /** @return number of threads which a master DoM should use for J2K encoding on the local machine */
+       int master_encoding_threads () const {
+               return _master_encoding_threads;
+       }
+
+       /** @return number of threads which a server should use for J2K encoding on the local machine */
+       int server_encoding_threads () const {
+               return _server_encoding_threads;
        }
 
        boost::optional<boost::filesystem::path> default_directory () const {
@@ -67,7 +72,8 @@ public:
                USE_ANY_SERVERS,
                SERVERS,
                CINEMAS,
-               SOUND_OUTPUT,
+               PREVIEW_SOUND,
+               PREVIEW_SOUND_OUTPUT,
                OTHER
        };
 
@@ -307,13 +313,20 @@ public:
                return _jump_to_selected;
        }
 
-       boost::optional<std::string> sound_output () const {
-               return _sound_output;
+       bool preview_sound () const {
+               return _preview_sound;
+       }
+
+       boost::optional<std::string> preview_sound_output () const {
+               return _preview_sound_output;
        }
 
-       /** @param n New number of local encoding threads */
-       void set_num_local_encoding_threads (int n) {
-               maybe_set (_num_local_encoding_threads, n);
+       void set_master_encoding_threads (int n) {
+               maybe_set (_master_encoding_threads, n);
+       }
+
+       void set_server_encoding_threads (int n) {
+               maybe_set (_server_encoding_threads, n);
        }
 
        void set_default_directory (boost::filesystem::path d) {
@@ -526,18 +539,22 @@ public:
                maybe_set (_confirm_kdm_email, s);
        }
 
-       void set_sound_output (std::string o)
+       void set_preview_sound (bool s) {
+               maybe_set (_preview_sound, s, PREVIEW_SOUND);
+       }
+
+       void set_preview_sound_output (std::string o)
        {
-               maybe_set (_sound_output, o, SOUND_OUTPUT);
+               maybe_set (_preview_sound_output, o, PREVIEW_SOUND_OUTPUT);
        }
 
-       void unset_sound_output ()
+       void unset_preview_sound_output ()
        {
-               if (!_sound_output) {
+               if (!_preview_sound_output) {
                        return;
                }
 
-               _sound_output = boost::none;
+               _preview_sound_output = boost::none;
                changed ();
        }
 
@@ -619,8 +636,10 @@ private:
                changed (prop);
        }
 
-       /** number of threads to use for J2K encoding on the local machine */
-       int _num_local_encoding_threads;
+       /** number of threads which a master DoM should use for J2K encoding on the local machine */
+       int _master_encoding_threads;
+       /** number of threads which a server should use for J2K encoding on the local machine */
+       int _server_encoding_threads;
        /** default directory to put new films in */
        boost::optional<boost::filesystem::path> _default_directory;
        /** base port number to use for J2K encoding servers;
@@ -698,12 +717,10 @@ private:
        dcp::NameFormat _kdm_container_name_format;
        dcp::NameFormat _dcp_metadata_filename_format;
        dcp::NameFormat _dcp_asset_filename_format;
-<<<<<<< 8de6a5d1d054bab25ab0d86bc48442d9d6adb849
        bool _jump_to_selected;
-=======
-       /** name of a specific sound output stream to use for preview */
-       boost::optional<std::string> _sound_output;
->>>>>>> First bits of audio support.
+       bool _preview_sound;
+       /** name of a specific sound output stream to use for preview, or empty to use the default */
+       boost::optional<std::string> _preview_sound_output;
 
        /** Singleton instance, or 0 */
        static Config* _instance;