Use FileGroup in FFmpeg.
[dcpomatic.git] / src / wx / config_dialog.cc
index 65cc39f24f52953049149bdece47810a1e6823a6..71a0f505fc794947ce5a7791e5564245de078428 100644 (file)
@@ -28,7 +28,6 @@
 #include <wx/notebook.h>
 #include <libdcp/colour_matrix.h>
 #include "lib/config.h"
-#include "lib/server.h"
 #include "lib/ratio.h"
 #include "lib/scaler.h"
 #include "lib/filter.h"
 #include "config_dialog.h"
 #include "wx_util.h"
 #include "filter_dialog.h"
-#include "server_dialog.h"
 #include "dir_picker_ctrl.h"
 #include "dci_metadata_dialog.h"
 #include "preset_colour_conversion_dialog.h"
+#include "server_dialog.h"
 
 using std::vector;
 using std::string;
@@ -66,6 +65,8 @@ ConfigDialog::ConfigDialog (wxWindow* parent)
        _notebook->AddPage (_metadata_panel, _("Metadata"), false);
        make_tms_panel ();
        _notebook->AddPage (_tms_panel, _("TMS"), false);
+       make_kdm_email_panel ();
+       _notebook->AddPage (_kdm_email_panel, _("KDM email"), false);
 
        wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
        overall_sizer->Add (s, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
@@ -222,7 +223,7 @@ ConfigDialog::make_misc_panel ()
        _default_dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&ConfigDialog::default_dcp_content_type_changed, this));
 
        _default_j2k_bandwidth->SetRange (50, 250);
-       _default_j2k_bandwidth->SetValue (config->default_j2k_bandwidth() / 1e6);
+       _default_j2k_bandwidth->SetValue (config->default_j2k_bandwidth() / 1000000);
        _default_j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ConfigDialog::default_j2k_bandwidth_changed, this));
 }
 
@@ -292,32 +293,42 @@ ConfigDialog::make_metadata_panel ()
        _creator->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::creator_changed, this));
 }
 
-static std::string
-server_column (ServerDescription s, int c)
+static string 
+server_column (string s)
 {
-       switch (c) {
-       case 0:
-               return s.host_name ();
-       case 1:
-               return lexical_cast<string> (s.threads ());
-       }
-
-       return "";
+       return s;
 }
 
 void
 ConfigDialog::make_servers_panel ()
 {
+       _servers_panel = new wxPanel (_notebook);
+       wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+       _servers_panel->SetSizer (s);
+
+       _use_any_servers = new wxCheckBox (_servers_panel, wxID_ANY, _("Use all servers"));
+       s->Add (_use_any_servers, 0, wxALL, DCPOMATIC_SIZER_X_GAP);
+       
        vector<string> columns;
-       columns.push_back (wx_to_std (_("IP address")));
-       columns.push_back (wx_to_std (_("Threads")));
-       _servers_panel = new EditableList<ServerDescription, ServerDialog> (
-               _notebook,
+       columns.push_back (wx_to_std (_("IP address / host name")));
+       _servers_list = new EditableList<std::string, ServerDialog> (
+               _servers_panel,
                columns,
                boost::bind (&Config::servers, Config::instance()),
                boost::bind (&Config::set_servers, Config::instance(), _1),
-               boost::bind (&server_column, _1, _2)
+               boost::bind (&server_column, _1)
                );
+
+       s->Add (_servers_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
+
+       _use_any_servers->SetValue (Config::instance()->use_any_servers ());
+       _use_any_servers->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&ConfigDialog::use_any_servers_changed, this));
+}
+
+void
+ConfigDialog::use_any_servers_changed ()
+{
+       Config::instance()->set_use_any_servers (_use_any_servers->GetValue ());
 }
 
 void
@@ -443,7 +454,7 @@ ConfigDialog::creator_changed ()
 void
 ConfigDialog::default_j2k_bandwidth_changed ()
 {
-       Config::instance()->set_default_j2k_bandwidth (_default_j2k_bandwidth->GetValue() * 1e6);
+       Config::instance()->set_default_j2k_bandwidth (_default_j2k_bandwidth->GetValue() * 1000000);
 }
 
 static std::string
@@ -462,7 +473,8 @@ ConfigDialog::make_colour_conversions_panel ()
                columns,
                boost::bind (&Config::colour_conversions, Config::instance()),
                boost::bind (&Config::set_colour_conversions, Config::instance(), _1),
-               boost::bind (&colour_conversion_column, _1)
+               boost::bind (&colour_conversion_column, _1),
+               300
                );
 }
 
@@ -478,3 +490,23 @@ ConfigDialog::kdm_from_changed ()
 {
        Config::instance()->set_kdm_from (wx_to_std (_kdm_from->GetValue ()));
 }
+
+void
+ConfigDialog::make_kdm_email_panel ()
+{
+       _kdm_email_panel = new wxPanel (_notebook);
+       wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+       _kdm_email_panel->SetSizer (s);
+
+       _kdm_email = new wxTextCtrl (_kdm_email_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
+       s->Add (_kdm_email, 1, wxEXPAND | wxALL, 12);
+
+       _kdm_email->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::kdm_email_changed, this));
+       _kdm_email->SetValue (wx_to_std (Config::instance()->kdm_email ()));
+}
+
+void
+ConfigDialog::kdm_email_changed ()
+{
+       Config::instance()->set_kdm_email (wx_to_std (_kdm_email->GetValue ()));
+}