+class NonStandardPage : public Page
+{
+public:
+ NonStandardPage(wxSize panel_size, int border)
+ : Page(panel_size, border)
+ {}
+
+ wxString GetName() const override
+ {
+ return _("Non-standard");
+ }
+
+#ifdef DCPOMATIC_OSX
+ wxBitmap GetLargeIcon() const override
+ {
+ return wxBitmap(icon_path("non_standard"), wxBITMAP_TYPE_PNG);
+ }
+#endif
+
+private:
+ void setup() override
+ {
+ auto table = new wxFlexGridSizer(2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+ table->AddGrowableCol(1, 1);
+ _panel->GetSizer()->Add(table, 1, wxALL | wxEXPAND, _border);
+
+ {
+ add_label_to_sizer(table, _panel, _("Maximum JPEG2000 bandwidth"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+ auto s = new wxBoxSizer(wxHORIZONTAL);
+ _maximum_j2k_bandwidth = new wxSpinCtrl(_panel);
+ s->Add(_maximum_j2k_bandwidth, 1);
+ add_label_to_sizer(s, _panel, _("Mbit/s"), false, 0, wxLEFT | wxALIGN_CENTRE_VERTICAL);
+ table->Add(s, 1);
+ }
+
+ auto checkbox = [this, table](wxString name, CheckBox*& variable) {
+ variable = new CheckBox(_panel, name);
+ table->Add(variable, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
+ table->AddSpacer(0);
+ };
+
+ checkbox(_("Allow any DCP frame rate"), _allow_any_dcp_frame_rate);
+
+ _allow_any_container = new CheckBox(_panel, _("Allow full-frame and non-standard container ratios"));
+ table->Add(_allow_any_container, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
+ auto restart = new StaticText(_panel, _("(restart DCP-o-matic to see all ratios)"));
+ auto font = restart->GetFont();
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ font.SetPointSize(font.GetPointSize() - 1);
+ restart->SetFont(font);
+ table->Add(restart, 1, wxALIGN_CENTRE_VERTICAL | wxBOTTOM, DCPOMATIC_CHECKBOX_BOTTOM_PAD);
+ restart->SetFont(font);
+
+ checkbox(_("Allow creation of DCPs with 96kHz audio"), _allow_96khz_audio);
+ checkbox(_("Allow mapping to all audio channels"), _use_all_audio_channels);
+ checkbox(_("Allow use of SMPTE Bv2.0"), _allow_smpte_bv20);
+
+ {
+ add_label_to_sizer(table, _panel, _("ISDCF name part length"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+ auto s = new wxBoxSizer(wxHORIZONTAL);
+ _isdcf_name_part_length = new wxSpinCtrl(_panel);
+ s->Add(_isdcf_name_part_length, 1);
+ table->Add(s, 1);
+ }
+
+ _maximum_j2k_bandwidth->SetRange(1, 1000);
+ _maximum_j2k_bandwidth->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_j2k_bandwidth_changed, this));
+ _allow_any_dcp_frame_rate->bind(&NonStandardPage::allow_any_dcp_frame_rate_changed, this);
+ _allow_any_container->bind(&NonStandardPage::allow_any_container_changed, this);
+ _allow_96khz_audio->bind(&NonStandardPage::allow_96khz_audio_changed, this);
+ _use_all_audio_channels->bind(&NonStandardPage::use_all_channels_changed, this);
+ _allow_smpte_bv20->bind(&NonStandardPage::allow_smpte_bv20_changed, this);
+ _isdcf_name_part_length->SetRange(1, 256);
+ _isdcf_name_part_length->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::isdcf_name_part_length_changed, this));
+ }
+
+ void config_changed() override
+ {
+ auto config = Config::instance();
+
+ checked_set(_maximum_j2k_bandwidth, config->maximum_j2k_bandwidth() / 1000000);
+ checked_set(_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate());
+ checked_set(_allow_any_container, config->allow_any_container());
+ checked_set(_allow_96khz_audio, config->allow_96khz_audio());
+ checked_set(_use_all_audio_channels, config->use_all_audio_channels());
+ checked_set(_allow_smpte_bv20, config->allow_smpte_bv20());
+ checked_set(_isdcf_name_part_length, config->isdcf_name_part_length());
+ }
+
+ void maximum_j2k_bandwidth_changed()
+ {
+ Config::instance()->set_maximum_j2k_bandwidth(_maximum_j2k_bandwidth->GetValue() * 1000000);
+ }
+
+ void allow_any_dcp_frame_rate_changed()
+ {
+ Config::instance()->set_allow_any_dcp_frame_rate(_allow_any_dcp_frame_rate->GetValue());
+ }
+
+ void allow_any_container_changed()
+ {
+ Config::instance()->set_allow_any_container(_allow_any_container->GetValue());
+ }
+
+ void allow_96khz_audio_changed()
+ {
+ Config::instance()->set_allow_96hhz_audio(_allow_96khz_audio->GetValue());
+ }
+
+ void use_all_channels_changed()
+ {
+ Config::instance()->set_use_all_audio_channels(_use_all_audio_channels->GetValue());
+ }
+
+ void allow_smpte_bv20_changed()
+ {
+ Config::instance()->set_allow_smpte_bv20(_allow_smpte_bv20->GetValue());
+ }
+
+ void isdcf_name_part_length_changed()
+ {
+ Config::instance()->set_isdcf_name_part_length(_isdcf_name_part_length->GetValue());
+ }
+
+ wxSpinCtrl* _maximum_j2k_bandwidth = nullptr;
+ CheckBox* _allow_any_dcp_frame_rate = nullptr;
+ CheckBox* _allow_any_container = nullptr;
+ CheckBox* _allow_96khz_audio = nullptr;
+ CheckBox* _use_all_audio_channels = nullptr;
+ CheckBox* _allow_smpte_bv20 = nullptr;
+ wxSpinCtrl* _isdcf_name_part_length = nullptr;
+};
+
+
+