Remove Scaler config and use SWS_BICUBIC everywhere.
[dcpomatic.git] / src / wx / config_dialog.cc
index 8d8f44b4ecc6fa05366c05b6366ef7a925a11e30..eee2c375608278e4bdb52067b4ebe1e710e5002f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@
 #include <dcp/signer.h>
 #include "lib/config.h"
 #include "lib/ratio.h"
-#include "lib/scaler.h"
 #include "lib/filter.h"
 #include "lib/dcp_content_type.h"
 #include "lib/colour_conversion.h"
@@ -86,6 +85,11 @@ public:
        GeneralPage (wxSize panel_size, int border)
                : wxStockPreferencesPage (Kind_General)
                , Page (panel_size, border)
+               , _set_language (0)
+               , _language (0)
+               , _num_local_encoding_threads (0)
+               , _check_for_updates (0)
+               , _check_for_test_updates (0)
        {}
 
        wxWindow* CreateWindow (wxWindow* parent)
@@ -234,6 +238,14 @@ class DefaultsPage : public wxPreferencesPage, public Page
 public:
        DefaultsPage (wxSize panel_size, int border)
                : Page (panel_size, border)
+               , _j2k_bandwidth (0)
+               , _audio_delay (0)
+               , _isdcf_metadata_button (0)
+               , _still_length (0)
+               , _directory (0)
+               , _container (0)
+               , _dcp_content_type (0)
+               , _issuer (0)
        {}
        
        wxString GetName () const
@@ -277,10 +289,6 @@ public:
                _isdcf_metadata_button = new wxButton (panel, wxID_ANY, _("Edit..."));
                table->Add (_isdcf_metadata_button);
 
-               add_label_to_sizer (table, panel, _("Default scale to"), true);
-               _scale = new wxChoice (panel, wxID_ANY);
-               table->Add (_scale);
-               
                add_label_to_sizer (table, panel, _("Default container"), true);
                _container = new wxChoice (panel, wxID_ANY);
                table->Add (_container);
@@ -322,14 +330,6 @@ public:
                
                _isdcf_metadata_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this, parent));
                
-               vector<VideoContentScale> scales = VideoContentScale::all ();
-               for (size_t i = 0; i < scales.size(); ++i) {
-                       _scale->Append (std_to_wx (scales[i].name ()));
-                       if (scales[i] == config->default_scale ()) {
-                               _scale->SetSelection (i);
-                       }
-               }
-
                vector<Ratio const *> ratios = Ratio::all ();
                for (size_t i = 0; i < ratios.size(); ++i) {
                        _container->Append (std_to_wx (ratios[i]->nickname ()));
@@ -338,7 +338,6 @@ public:
                        }
                }
                
-               _scale->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::scale_changed, this));
                _container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DefaultsPage::container_changed, this));
                
                vector<DCPContentType const *> const ct = DCPContentType::all ();
@@ -362,10 +361,17 @@ public:
                _issuer->SetValue (std_to_wx (config->dcp_issuer ()));
                _issuer->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DefaultsPage::issuer_changed, this));
 
+               _config_connection = config->Changed.connect (boost::bind (&DefaultsPage::config_changed, this));
+
                return panel;
        }
 
 private:
+       void config_changed ()
+       {
+               _j2k_bandwidth->SetRange (50, Config::instance()->maximum_j2k_bandwidth() / 1000000);
+       }
+               
        void j2k_bandwidth_changed ()
        {
                Config::instance()->set_default_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000);
@@ -394,12 +400,6 @@ private:
                Config::instance()->set_default_still_length (_still_length->GetValue ());
        }
 
-       void scale_changed ()
-       {
-               vector<VideoContentScale> scale = VideoContentScale::all ();
-               Config::instance()->set_default_scale (scale[_scale->GetSelection()]);
-       }
-       
        void container_changed ()
        {
                vector<Ratio const *> ratio = Ratio::all ();
@@ -426,10 +426,11 @@ private:
 #else
        wxDirPickerCtrl* _directory;
 #endif
-       wxChoice* _scale;
        wxChoice* _container;
        wxChoice* _dcp_content_type;
        wxTextCtrl* _issuer;
+
+       boost::signals2::scoped_connection _config_connection;
 };
 
 class EncodingServersPage : public wxPreferencesPage, public Page
@@ -437,6 +438,8 @@ class EncodingServersPage : public wxPreferencesPage, public Page
 public:
        EncodingServersPage (wxSize panel_size, int border)
                : Page (panel_size, border)
+               , _use_any_servers (0)
+               , _servers_list (0)
        {}
        
        wxString GetName () const
@@ -541,6 +544,18 @@ class KeysPage : public wxPreferencesPage, public Page
 public:
        KeysPage (wxSize panel_size, int border)
                : Page (panel_size, border)
+               , _panel (0)
+               , _certificates (0)
+               , _add_certificate (0)
+               , _remove_certificate (0)
+               , _remake_certificates (0)
+               , _signer_private_key (0)
+               , _load_signer_private_key (0)
+               , _decryption_certificate (0)
+               , _load_decryption_certificate (0)
+               , _decryption_private_key (0)
+               , _load_decryption_private_key (0)
+               , _export_decryption_certificate (0)
        {}
 
        wxString GetName () const
@@ -874,6 +889,10 @@ class TMSPage : public wxPreferencesPage, public Page
 public:
        TMSPage (wxSize panel_size, int border)
                : Page (panel_size, border)
+               , _tms_ip (0)
+               , _tms_path (0)
+               , _tms_user (0)
+               , _tms_password (0)
        {}
 
        wxString GetName () const
@@ -959,6 +978,15 @@ public:
 
        KDMEmailPage (wxSize panel_size, int border)
                : Page (panel_size, border)
+               , _mail_server (0)
+               , _mail_user (0)
+               , _mail_password (0)
+               , _kdm_subject (0)
+               , _kdm_from (0)
+               , _kdm_cc (0)
+               , _kdm_bcc (0)
+               , _kdm_email (0)
+               , _reset_kdm_email (0)
        {}
        
        wxString GetName () const
@@ -1119,6 +1147,12 @@ public:
        AdvancedPage (wxSize panel_size, int border)
                : wxStockPreferencesPage (Kind_Advanced)
                , Page (panel_size, border)
+               , _maximum_j2k_bandwidth (0)
+               , _allow_any_dcp_frame_rate (0)
+               , _log_general (0)
+               , _log_warning (0)
+               , _log_error (0)
+               , _log_timing (0)
        {}
        
        wxWindow* CreateWindow (wxWindow* parent)
@@ -1171,7 +1205,7 @@ public:
                
                Config* config = Config::instance ();
                
-               _maximum_j2k_bandwidth->SetRange (1, 500);
+               _maximum_j2k_bandwidth->SetRange (1, 1000);
                _maximum_j2k_bandwidth->SetValue (config->maximum_j2k_bandwidth() / 1000000);
                _maximum_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&AdvancedPage::maximum_j2k_bandwidth_changed, this));
                _allow_any_dcp_frame_rate->SetValue (config->allow_any_dcp_frame_rate ());