-private:
- void setup ()
- {
- wxGridBagSizer* table = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- _panel->GetSizer()->Add (table, 1, wxALL | wxEXPAND, _border);
-
- int r = 0;
- _set_language = new wxCheckBox (_panel, wxID_ANY, _("Set language"));
- table->Add (_set_language, wxGBPosition (r, 0));
- _language = new wxChoice (_panel, wxID_ANY);
- _language->Append (wxT ("Deutsch"));
- _language->Append (wxT ("English"));
- _language->Append (wxT ("Español"));
- _language->Append (wxT ("Français"));
- _language->Append (wxT ("Italiano"));
- _language->Append (wxT ("Nederlands"));
- _language->Append (wxT ("Svenska"));
- _language->Append (wxT ("Русский"));
- _language->Append (wxT ("Polski"));
- _language->Append (wxT ("Dansk"));
- _language->Append (wxT ("Português europeu"));
- _language->Append (wxT ("Slovenský jazyk"));
- _language->Append (wxT ("Čeština"));
- _language->Append (wxT ("українська мова"));
- table->Add (_language, wxGBPosition (r, 1));
- ++r;
-
- wxStaticText* restart = add_label_to_sizer (
- table, _panel, _("(restart DCP-o-matic to see language changes)"), false, wxGBPosition (r, 0), wxGBSpan (1, 2)
- );
- wxFont font = restart->GetFont();
- font.SetStyle (wxFONTSTYLE_ITALIC);
- font.SetPointSize (font.GetPointSize() - 1);
- restart->SetFont (font);
- ++r;
-
- add_label_to_sizer (table, _panel, _("Threads to use for encoding on this host"), true, wxGBPosition (r, 0));
- _num_local_encoding_threads = new wxSpinCtrl (_panel);
- table->Add (_num_local_encoding_threads, 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");
- table->Add (_cinemas_file, wxGBPosition (r, 1));
- ++r;
-
-#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
- _analyse_ebur128 = new wxCheckBox (_panel, wxID_ANY, _("Find integrated loudness, true peak and loudness range when analysing audio"));
- table->Add (_analyse_ebur128, wxGBPosition (r, 0), wxGBSpan (1, 2));
- ++r;
-#endif
-
- _automatic_audio_analysis = new wxCheckBox (_panel, wxID_ANY, _("Automatically analyse content audio"));
- table->Add (_automatic_audio_analysis, wxGBPosition (r, 0), wxGBSpan (1, 2));
- ++r;
-
- _check_for_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for updates on startup"));
- table->Add (_check_for_updates, wxGBPosition (r, 0), wxGBSpan (1, 2));
- ++r;
-
- _check_for_test_updates = new wxCheckBox (_panel, wxID_ANY, _("Check for testing updates on startup"));
- table->Add (_check_for_test_updates, wxGBPosition (r, 0), wxGBSpan (1, 2));
- ++r;
-
- wxFlexGridSizer* bottom_table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- bottom_table->AddGrowableCol (1, 1);
-
- add_label_to_sizer (bottom_table, _panel, _("Issuer"), true);
- _issuer = new wxTextCtrl (_panel, wxID_ANY);
- bottom_table->Add (_issuer, 1, wxALL | wxEXPAND);
-
- add_label_to_sizer (bottom_table, _panel, _("Creator"), true);
- _creator = new wxTextCtrl (_panel, wxID_ANY);
- bottom_table->Add (_creator, 1, wxALL | wxEXPAND);
-
- table->Add (bottom_table, wxGBPosition (r, 0), wxGBSpan (2, 2), wxEXPAND);
- ++r;
-
- _set_language->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::set_language_changed, this));
- _language->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&GeneralPage::language_changed, this));
- _cinemas_file->Bind (wxEVT_COMMAND_FILEPICKER_CHANGED, boost::bind (&GeneralPage::cinemas_file_changed, this));
-
- _num_local_encoding_threads->SetRange (1, 128);
- _num_local_encoding_threads->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&GeneralPage::num_local_encoding_threads_changed, this));
-
-#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
- _analyse_ebur128->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::analyse_ebur128_changed, this));
-#endif
- _automatic_audio_analysis->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::automatic_audio_analysis_changed, this));
- _check_for_updates->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::check_for_updates_changed, this));
- _check_for_test_updates->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::check_for_test_updates_changed, this));
-
- _issuer->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&GeneralPage::issuer_changed, this));
- _creator->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&GeneralPage::creator_changed, this));
- }
-
- void config_changed ()
- {
- Config* config = Config::instance ();
-
- checked_set (_set_language, static_cast<bool>(config->language()));
-
- if (config->language().get_value_or ("") == "fr") {
- checked_set (_language, 3);
- } else if (config->language().get_value_or ("") == "it") {
- checked_set (_language, 4);
- } else if (config->language().get_value_or ("") == "es") {
- checked_set (_language, 2);
- } else if (config->language().get_value_or ("") == "sv") {
- checked_set (_language, 6);
- } else if (config->language().get_value_or ("") == "de") {
- checked_set (_language, 0);
- } else if (config->language().get_value_or ("") == "nl") {
- checked_set (_language, 5);
- } else if (config->language().get_value_or ("") == "ru") {
- checked_set (_language, 7);
- } else if (config->language().get_value_or ("") == "pl") {
- checked_set (_language, 8);
- } else if (config->language().get_value_or ("") == "da") {
- checked_set (_language, 9);
- } else if (config->language().get_value_or ("") == "pt") {
- checked_set (_language, 10);
- } else if (config->language().get_value_or ("") == "sk") {
- checked_set (_language, 11);
- } else if (config->language().get_value_or ("") == "cs") {
- checked_set (_language, 12);
- } else if (config->language().get_value_or ("") == "uk") {
- checked_set (_language, 13);
- } else {
- _language->SetSelection (1);
- }
-
- checked_set (_num_local_encoding_threads, config->num_local_encoding_threads ());
-#ifdef DCPOMATIC_HAVE_PATCHED_FFMPEG
- checked_set (_analyse_ebur128, config->analyse_ebur128 ());
-#endif
- checked_set (_automatic_audio_analysis, config->automatic_audio_analysis ());
- checked_set (_check_for_updates, config->check_for_updates ());
- checked_set (_check_for_test_updates, config->check_for_test_updates ());
- checked_set (_issuer, config->dcp_issuer ());
- checked_set (_creator, config->dcp_creator ());
- checked_set (_cinemas_file, config->cinemas_file());
-
- setup_sensitivity ();
- }
-
- void setup_sensitivity ()
- {
- _language->Enable (_set_language->GetValue ());
- _check_for_test_updates->Enable (_check_for_updates->GetValue ());
- }