/*
- Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "static_text.h"
#include "check_box.h"
#include "dcpomatic_button.h"
+#include "password_entry.h"
#include "lib/config.h"
#include "lib/ratio.h"
#include "lib/filter.h"
_use_any_servers = new CheckBox (_panel, _("Search network for servers"));
_panel->GetSizer()->Add (_use_any_servers, 0, wxALL, _border);
- vector<string> columns;
- columns.push_back (wx_to_std (_("IP address / host name")));
+ vector<EditableListColumn> columns;
+ columns.push_back (EditableListColumn(wx_to_std(_("IP address / host name"))));
_servers_list = new EditableList<string, ServerDialog> (
_panel,
columns,
table->Add (_tms_user, 1, wxEXPAND);
add_label_to_sizer (table, _panel, _("Password"), true);
- _tms_password = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_tms_password, 1, wxEXPAND);
+ _tms_password = new PasswordEntry (_panel);
+ table->Add (_tms_password->get_panel(), 1, wxEXPAND);
_tms_protocol->Append (_("SCP (for AAM and Doremi)"));
_tms_protocol->Append (_("FTP (for Dolby)"));
_tms_ip->Bind (wxEVT_TEXT, boost::bind (&TMSPage::tms_ip_changed, this));
_tms_path->Bind (wxEVT_TEXT, boost::bind (&TMSPage::tms_path_changed, this));
_tms_user->Bind (wxEVT_TEXT, boost::bind (&TMSPage::tms_user_changed, this));
- _tms_password->Bind (wxEVT_TEXT, boost::bind (&TMSPage::tms_password_changed, this));
+ _tms_password->Changed.connect (boost::bind (&TMSPage::tms_password_changed, this));
}
void config_changed ()
void tms_password_changed ()
{
- Config::instance()->set_tms_password (wx_to_std (_tms_password->GetValue ()));
+ Config::instance()->set_tms_password (_tms_password->get());
}
wxChoice* _tms_protocol;
wxTextCtrl* _tms_ip;
wxTextCtrl* _tms_path;
wxTextCtrl* _tms_user;
- wxTextCtrl* _tms_password;
+ PasswordEntry* _tms_password;
};
static string
table->Add (_user, 1, wxEXPAND | wxALL);
add_label_to_sizer (table, _panel, _("Password"), true);
- _password = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_password, 1, wxEXPAND | wxALL);
+ _password = new PasswordEntry (_panel);
+ table->Add (_password->get_panel(), 1, wxEXPAND | wxALL);
_server->Bind (wxEVT_TEXT, boost::bind (&EmailPage::server_changed, this));
_port->Bind (wxEVT_SPINCTRL, boost::bind (&EmailPage::port_changed, this));
_protocol->Bind (wxEVT_CHOICE, boost::bind (&EmailPage::protocol_changed, this));
_user->Bind (wxEVT_TEXT, boost::bind (&EmailPage::user_changed, this));
- _password->Bind (wxEVT_TEXT, boost::bind (&EmailPage::password_changed, this));
+ _password->Changed.connect (boost::bind (&EmailPage::password_changed, this));
}
void config_changed ()
break;
}
checked_set (_user, config->mail_user ());
- checked_set (_password, config->mail_password ());
+ checked_set (_password, config->mail_password());
}
void server_changed ()
void password_changed ()
{
- Config::instance()->set_mail_password (wx_to_std (_password->GetValue ()));
+ Config::instance()->set_mail_password(_password->get());
}
wxTextCtrl* _server;
wxSpinCtrl* _port;
wxChoice* _protocol;
wxTextCtrl* _user;
- wxTextCtrl* _password;
+ PasswordEntry* _password;
};
class KDMEmailPage : public StandardPage
_from = new wxTextCtrl (_panel, wxID_ANY);
table->Add (_from, 1, wxEXPAND | wxALL);
- vector<string> columns;
- columns.push_back (wx_to_std (_("Address")));
+ vector<EditableListColumn> columns;
+ columns.push_back (EditableListColumn(wx_to_std(_("Address"))));
add_label_to_sizer (table, _panel, _("CC addresses"), true);
_cc = new EditableList<string, EmailDialog> (
_panel,
table->Add (_barco_username, 1, wxEXPAND | wxALL);
add_label_to_sizer (table, _panel, _("certificates.barco.com password"), true);
- _barco_password = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_barco_password, 1, wxEXPAND | wxALL);
+ _barco_password = new PasswordEntry (_panel);
+ table->Add (_barco_password->get_panel(), 1, wxEXPAND | wxALL);
add_label_to_sizer (table, _panel, _("certificates.christiedigital.com user name"), true);
_christie_username = new wxTextCtrl (_panel, wxID_ANY);
table->Add (_christie_username, 1, wxEXPAND | wxALL);
add_label_to_sizer (table, _panel, _("certificates.christiedigital.com password"), true);
- _christie_password = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_christie_password, 1, wxEXPAND | wxALL);
+ _christie_password = new PasswordEntry (_panel);
+ table->Add (_christie_password->get_panel(), 1, wxEXPAND | wxALL);
add_label_to_sizer (table, _panel, _("GDC user name"), true);
_gdc_username = new wxTextCtrl (_panel, wxID_ANY);
table->Add (_gdc_username, 1, wxEXPAND | wxALL);
add_label_to_sizer (table, _panel, _("GDC password"), true);
- _gdc_password = new wxTextCtrl (_panel, wxID_ANY);
- table->Add (_gdc_password, 1, wxEXPAND | wxALL);
+ _gdc_password = new PasswordEntry (_panel);
+ table->Add (_gdc_password->get_panel(), 1, wxEXPAND | wxALL);
_barco_username->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::barco_username_changed, this));
- _barco_password->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::barco_password_changed, this));
+ _barco_password->Changed.connect (boost::bind(&AccountsPage::barco_password_changed, this));
_christie_username->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::christie_username_changed, this));
- _christie_password->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::christie_password_changed, this));
+ _christie_password->Changed.connect (boost::bind(&AccountsPage::christie_password_changed, this));
_gdc_username->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::gdc_username_changed, this));
- _gdc_password->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::gdc_password_changed, this));
+ _gdc_password->Changed.connect (boost::bind(&AccountsPage::gdc_password_changed, this));
}
void config_changed ()
void barco_password_changed ()
{
- wxString const s = _barco_password->GetValue();
- if (!s.IsEmpty()) {
- Config::instance()->set_barco_password (wx_to_std(s));
+ string const s = _barco_password->get();
+ if (!s.empty()) {
+ Config::instance()->set_barco_password(s);
} else {
- Config::instance()->unset_barco_password ();
+ Config::instance()->unset_barco_password();
}
}
void christie_password_changed ()
{
- wxString const s = _christie_password->GetValue();
- if (!s.IsEmpty()) {
- Config::instance()->set_christie_password (wx_to_std(s));
+ string const s = _christie_password->get();
+ if (!s.empty()) {
+ Config::instance()->set_christie_password(s);
} else {
- Config::instance()->unset_christie_password ();
+ Config::instance()->unset_christie_password();
}
}
void gdc_password_changed ()
{
- wxString const s = _gdc_password->GetValue();
- if (!s.IsEmpty()) {
- Config::instance()->set_gdc_password (wx_to_std(s));
+ string const s = _gdc_password->get();
+ if (!s.empty()) {
+ Config::instance()->set_gdc_password(s);
} else {
- Config::instance()->unset_gdc_password ();
+ Config::instance()->unset_gdc_password();
}
}
private:
wxTextCtrl* _barco_username;
- wxTextCtrl* _barco_password;
+ PasswordEntry* _barco_password;
wxTextCtrl* _christie_username;
- wxTextCtrl* _christie_password;
+ PasswordEntry* _christie_password;
wxTextCtrl* _gdc_username;
- wxTextCtrl* _gdc_password;
+ PasswordEntry* _gdc_password;
};
_to = new wxTextCtrl (_panel, wxID_ANY);
table->Add (_to, 1, wxEXPAND | wxALL);
- vector<string> columns;
- columns.push_back (wx_to_std (_("Address")));
+ vector<EditableListColumn> columns;
+ columns.push_back (EditableListColumn(wx_to_std(_("Address"))));
add_label_to_sizer (table, _panel, _("CC addresses"), true);
_cc = new EditableList<string, EmailDialog> (
_panel,
table->Add (s, 1);
}
+ add_label_to_sizer (table, _panel, _("Video display mode"), true);
+ _video_display_mode = new wxChoice (_panel, wxID_ANY);
+ table->Add (_video_display_mode);
+
+ wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to change display mode)"), false);
+ wxFont font = restart->GetFont();
+ font.SetStyle (wxFONTSTYLE_ITALIC);
+ font.SetPointSize (font.GetPointSize() - 1);
+ restart->SetFont (font);
+ table->AddSpacer (0);
+
_allow_any_dcp_frame_rate = new CheckBox (_panel, _("Allow any DCP frame rate"));
table->Add (_allow_any_dcp_frame_rate, 1, wxEXPAND | wxALL);
table->AddSpacer (0);
table->Add (_allow_any_container, 1, wxEXPAND | wxALL);
table->AddSpacer (0);
- wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to see all ratios)"), false);
- wxFont font = restart->GetFont();
- font.SetStyle (wxFONTSTYLE_ITALIC);
- font.SetPointSize (font.GetPointSize() - 1);
+ restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to see all ratios)"), false);
restart->SetFont (font);
table->AddSpacer (0);
_maximum_j2k_bandwidth->SetRange (1, 1000);
_maximum_j2k_bandwidth->Bind (wxEVT_SPINCTRL, boost::bind (&AdvancedPage::maximum_j2k_bandwidth_changed, this));
+ _video_display_mode->Append (_("Simple (safer)"));
+ _video_display_mode->Append (_("OpenGL (faster)"));
+ _video_display_mode->Bind (wxEVT_CHOICE, boost::bind(&AdvancedPage::video_display_mode_changed, this));
_allow_any_dcp_frame_rate->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this));
_allow_any_container->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_container_changed, this));
_only_servers_encode->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::only_servers_encode_changed, this));
Config* config = Config::instance ();
checked_set (_maximum_j2k_bandwidth, config->maximum_j2k_bandwidth() / 1000000);
+ switch (config->video_view_type()) {
+ case Config::VIDEO_VIEW_SIMPLE:
+ checked_set (_video_display_mode, 0);
+ break;
+ case Config::VIDEO_VIEW_OPENGL:
+ checked_set (_video_display_mode, 1);
+ break;
+ }
checked_set (_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate ());
checked_set (_allow_any_container, config->allow_any_container ());
checked_set (_only_servers_encode, config->only_servers_encode ());
Config::instance()->set_maximum_j2k_bandwidth (_maximum_j2k_bandwidth->GetValue() * 1000000);
}
+ void video_display_mode_changed ()
+ {
+ if (_video_display_mode->GetSelection() == 0) {
+ Config::instance()->set_video_view_type (Config::VIDEO_VIEW_SIMPLE);
+ } else {
+ Config::instance()->set_video_view_type (Config::VIDEO_VIEW_OPENGL);
+ }
+ }
+
void frames_in_memory_multiplier_changed ()
{
Config::instance()->set_frames_in_memory_multiplier (_frames_in_memory_multiplier->GetValue());
#endif
wxSpinCtrl* _maximum_j2k_bandwidth;
+ wxChoice* _video_display_mode;
wxSpinCtrl* _frames_in_memory_multiplier;
wxCheckBox* _allow_any_dcp_frame_rate;
wxCheckBox* _allow_any_container;