Move luminance to Interop/SMPTE metadata and remove the ISDCF metadata dialogue.
[dcpomatic.git] / src / wx / full_config_dialog.cc
index f376d96820661d5246526821fe0fe2d46bd32ed0..9622955282725648e2e346ef78e77f59876df11d 100644 (file)
@@ -28,7 +28,6 @@
 #include "filter_dialog.h"
 #include "dir_picker_ctrl.h"
 #include "file_picker_ctrl.h"
-#include "isdcf_metadata_dialog.h"
 #include "server_dialog.h"
 #include "make_chain_dialog.h"
 #include "email_dialog.h"
@@ -57,7 +56,6 @@
 #include <wx/filepicker.h>
 #include <RtAudio.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::vector;
@@ -103,12 +101,12 @@ private:
                ++r;
 
                add_label_to_sizer (table, _panel, _("Configuration file"), true, wxGBPosition (r, 0));
-               _config_file = new FilePickerCtrl (_panel, _("Select configuration file"), "*.xml", true, true);
+               _config_file = new FilePickerCtrl (_panel, _("Select configuration file"), "*.xml", true, false);
                table->Add (_config_file, wxGBPosition (r, 1));
                ++r;
 
                add_label_to_sizer (table, _panel, _("Cinema and screen database file"), true, wxGBPosition (r, 0));
-               _cinemas_file = new FilePickerCtrl (_panel, _("Select cinema and screen database file"), "*.xml", true, true);
+               _cinemas_file = new FilePickerCtrl (_panel, _("Select cinema and screen database file"), "*.xml", true, false);
                table->Add (_cinemas_file, wxGBPosition (r, 1));
                Button* export_cinemas = new Button (_panel, _("Export..."));
                table->Add (export_cinemas, wxGBPosition (r, 2));
@@ -276,10 +274,6 @@ private:
 #endif
                table->Add (_directory, 1, wxEXPAND);
 
-               add_label_to_sizer (table, _panel, _("Default ISDCF name details"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
-               _isdcf_metadata_button = new Button (_panel, _("Edit..."));
-               table->Add (_isdcf_metadata_button);
-
                add_label_to_sizer (table, _panel, _("Default container"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
                _container = new wxChoice (_panel, wxID_ANY);
                table->Add (_container);
@@ -329,15 +323,13 @@ private:
                _directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this));
                _kdm_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::kdm_directory_changed, this));
 
-               _isdcf_metadata_button->Bind (wxEVT_BUTTON, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this));
-
-               BOOST_FOREACH (Ratio const * i, Ratio::containers()) {
+               for (auto i: Ratio::containers()) {
                        _container->Append (std_to_wx(i->container_nickname()));
                }
 
                _container->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::container_changed, this));
 
-               BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) {
+               for (auto i: DCPContentType::all()) {
                        _dcp_content_type->Append (std_to_wx (i->pretty_name ()));
                }
 
@@ -415,14 +407,6 @@ private:
                Config::instance()->set_default_kdm_directory (wx_to_std (_kdm_directory->GetPath ()));
        }
 
-       void edit_isdcf_metadata_clicked ()
-       {
-               ISDCFMetadataDialog* d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata (), false);
-               d->ShowModal ();
-               Config::instance()->set_default_isdcf_metadata (d->isdcf_metadata ());
-               d->Destroy ();
-       }
-
        void still_length_changed ()
        {
                Config::instance()->set_default_still_length (_still_length->GetValue ());
@@ -447,7 +431,6 @@ private:
 
        wxSpinCtrl* _j2k_bandwidth;
        wxSpinCtrl* _audio_delay;
-       wxButton* _isdcf_metadata_button;
        wxSpinCtrl* _still_length;
 #ifdef DCPOMATIC_USE_OWN_PICKER
        DirPickerCtrl* _directory;
@@ -587,7 +570,7 @@ private:
                Config* config = Config::instance ();
 
                checked_set (_upload, config->upload_after_make_dcp());
-               checked_set (_tms_protocol, config->tms_protocol ());
+               checked_set (_tms_protocol, static_cast<int>(config->tms_protocol()));
                checked_set (_tms_ip, config->tms_ip ());
                checked_set (_tms_path, config->tms_path ());
                checked_set (_tms_user, config->tms_user ());
@@ -701,21 +684,21 @@ private:
 
        void config_changed ()
        {
-               Config* config = Config::instance ();
+               auto config = Config::instance ();
 
                checked_set (_server, config->mail_server ());
                checked_set (_port, config->mail_port ());
                switch (config->mail_protocol()) {
-               case EMAIL_PROTOCOL_AUTO:
+               case EmailProtocol::AUTO:
                        checked_set (_protocol, 0);
                        break;
-               case EMAIL_PROTOCOL_PLAIN:
+               case EmailProtocol::PLAIN:
                        checked_set (_protocol, 1);
                        break;
-               case EMAIL_PROTOCOL_STARTTLS:
+               case EmailProtocol::STARTTLS:
                        checked_set (_protocol, 2);
                        break;
-               case EMAIL_PROTOCOL_SSL:
+               case EmailProtocol::SSL:
                        checked_set (_protocol, 3);
                        break;
                }
@@ -737,16 +720,16 @@ private:
        {
                switch (_protocol->GetSelection()) {
                case 0:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_AUTO);
+                       Config::instance()->set_mail_protocol(EmailProtocol::AUTO);
                        break;
                case 1:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_PLAIN);
+                       Config::instance()->set_mail_protocol(EmailProtocol::PLAIN);
                        break;
                case 2:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_STARTTLS);
+                       Config::instance()->set_mail_protocol(EmailProtocol::STARTTLS);
                        break;
                case 3:
-                       Config::instance()->set_mail_protocol(EMAIL_PROTOCOL_SSL);
+                       Config::instance()->set_mail_protocol(EmailProtocol::SSL);
                        break;
                }
        }
@@ -1342,6 +1325,14 @@ private:
                        table->Add (s, 1);
                }
 
+               {
+                       add_label_to_sizer (table, _panel, _("Minimum size of frame (KB)"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+                       wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+                       _minimum_frame_size = new wxSpinCtrl (_panel);
+                       s->Add (_minimum_frame_size, 1);
+                       table->Add (s, 1);
+               }
+
                {
                        add_top_aligned_label_to_sizer (table, _panel, _("DCP metadata filename format"));
                        dcp::NameFormat::Map titles;
@@ -1415,6 +1406,7 @@ private:
                _show_experimental_audio_processors->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::show_experimental_audio_processors_changed, this));
                _only_servers_encode->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::only_servers_encode_changed, this));
                _frames_in_memory_multiplier->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::frames_in_memory_multiplier_changed, this));
+               _minimum_frame_size->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::minimum_frame_size_changed, this));
                _dcp_metadata_filename_format->Changed.connect (boost::bind (&AdvancedPage::dcp_metadata_filename_format_changed, this));
                _dcp_asset_filename_format->Changed.connect (boost::bind (&AdvancedPage::dcp_asset_filename_format_changed, this));
                _log_general->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::log_changed, this));
@@ -1453,13 +1445,14 @@ private:
                checked_set (_log_warning, config->log_types() & LogEntry::TYPE_WARNING);
                checked_set (_log_error, config->log_types() & LogEntry::TYPE_ERROR);
                checked_set (_log_timing, config->log_types() & LogEntry::TYPE_TIMING);
-               checked_set (_log_debug_threed, config->log_types() & LogEntry::TYPE_DEBUG_THREED);
+               checked_set (_log_debug_threed, config->log_types() & LogEntry::TYPE_DEBUG_THREE_D);
                checked_set (_log_debug_encode, config->log_types() & LogEntry::TYPE_DEBUG_ENCODE);
                checked_set (_log_debug_email, config->log_types() & LogEntry::TYPE_DEBUG_EMAIL);
                checked_set (_log_debug_video_view, config->log_types() & LogEntry::TYPE_DEBUG_VIDEO_VIEW);
                checked_set (_log_debug_player, config->log_types() & LogEntry::TYPE_DEBUG_PLAYER);
                checked_set (_log_debug_audio_analysis, config->log_types() & LogEntry::TYPE_DEBUG_AUDIO_ANALYSIS);
                checked_set (_frames_in_memory_multiplier, config->frames_in_memory_multiplier());
+               checked_set (_minimum_frame_size, config->minimum_frame_size() / 1024);
 #ifdef DCPOMATIC_WINDOWS
                checked_set (_win32_console, config->win32_console());
 #endif
@@ -1484,6 +1477,11 @@ private:
                Config::instance()->set_frames_in_memory_multiplier (_frames_in_memory_multiplier->GetValue());
        }
 
+       void minimum_frame_size_changed ()
+       {
+               Config::instance()->set_minimum_frame_size (_minimum_frame_size->GetValue() * 1024);
+       }
+
        void allow_any_dcp_frame_rate_changed ()
        {
                Config::instance()->set_allow_any_dcp_frame_rate (_allow_any_dcp_frame_rate->GetValue ());
@@ -1530,7 +1528,7 @@ private:
                        types |= LogEntry::TYPE_TIMING;
                }
                if (_log_debug_threed->GetValue ()) {
-                       types |= LogEntry::TYPE_DEBUG_THREED;
+                       types |= LogEntry::TYPE_DEBUG_THREE_D;
                }
                if (_log_debug_encode->GetValue ()) {
                        types |= LogEntry::TYPE_DEBUG_ENCODE;
@@ -1560,6 +1558,7 @@ private:
        wxSpinCtrl* _maximum_j2k_bandwidth;
        wxChoice* _video_display_mode;
        wxSpinCtrl* _frames_in_memory_multiplier;
+       wxSpinCtrl* _minimum_frame_size;
        wxCheckBox* _allow_any_dcp_frame_rate;
        wxCheckBox* _allow_any_container;
        wxCheckBox* _show_experimental_audio_processors;