X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fdcp_panel.cc;h=527c275a4b10406ec7edad982f033feb556c4f86;hb=a6a797d3abd7b650fe070a3b696cf3bca9444654;hp=8cbd1dbb654ed947038b1e03b6f5789aceccaf6d;hpb=94056bf7f8fdef32da3cd78eff68d58560b4e6be;p=dcpomatic.git diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 8cbd1dbb6..527c275a4 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -34,7 +34,7 @@ #include "lib/subtitle_content.h" #include "lib/dcp_content.h" #include "lib/audio_content.h" -#include "lib/locale_convert.h" +#include #include #include #include @@ -53,6 +53,7 @@ using std::max; using std::make_pair; using boost::lexical_cast; using boost::shared_ptr; +using dcp::locale_convert; DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr film) : _audio_dialog (0) @@ -161,22 +162,21 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr film) grid->Add (_upload_after_make_dcp, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; - _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::name_changed, this)); - _use_isdcf_name->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::use_isdcf_name_toggled, this)); - _edit_isdcf_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this)); - _copy_isdcf_name_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this)); - _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::dcp_content_type_changed, this)); - _signed->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::signed_toggled, this)); - _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::encrypted_toggled, this)); - _edit_key->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_key_clicked, this)); - _reel_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::reel_type_changed, this)); - _reel_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::reel_length_changed, this)); - _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::standard_changed, this)); - _upload_after_make_dcp->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::upload_after_make_dcp_changed, this)); + _name->Bind (wxEVT_TEXT, boost::bind (&DCPPanel::name_changed, this)); + _use_isdcf_name->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::use_isdcf_name_toggled, this)); + _edit_isdcf_button->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this)); + _copy_isdcf_name_button->Bind(wxEVT_BUTTON, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this)); + _dcp_content_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::dcp_content_type_changed, this)); + _signed->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::signed_toggled, this)); + _encrypted->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::encrypted_toggled, this)); + _edit_key->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::edit_key_clicked, this)); + _reel_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::reel_type_changed, this)); + _reel_length->Bind (wxEVT_SPINCTRL, boost::bind (&DCPPanel::reel_length_changed, this)); + _standard->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::standard_changed, this)); + _upload_after_make_dcp->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::upload_after_make_dcp_changed, this)); - vector const ct = DCPContentType::all (); - for (vector::const_iterator i = ct.begin(); i != ct.end(); ++i) { - _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ())); + BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) { + _dcp_content_type->Append (std_to_wx (i->pretty_name ())); } _reel_type->Append (_("Single reel")); @@ -380,6 +380,7 @@ DCPPanel::film_changed (int p) checked_set (_frame_rate_spin, _film->video_frame_rate ()); _best_frame_rate->Enable (_film->best_video_frame_rate () != _film->video_frame_rate ()); + setup_dcp_name (); break; } case Film::AUDIO_CHANNELS: @@ -444,7 +445,7 @@ void DCPPanel::setup_container () { int n = 0; - vector ratios = Ratio::all (); + vector ratios = Ratio::containers (); vector::iterator i = ratios.begin (); while (i != ratios.end() && *i != _film->container ()) { ++i; @@ -473,7 +474,7 @@ DCPPanel::container_changed () int const n = _container->GetSelection (); if (n >= 0) { - vector ratios = Ratio::all (); + vector ratios = Ratio::containers (); DCPOMATIC_ASSERT (n < int (ratios.size())); _film->set_container (ratios[n]); } @@ -652,6 +653,11 @@ DCPPanel::make_video_panel () ++r; } + add_label_to_sizer (grid, panel, _("Resolution"), true, wxGBPosition (r, 0)); + _resolution = new wxChoice (panel, wxID_ANY); + grid->Add (_resolution, wxGBPosition (r, 1)); + ++r; + add_label_to_sizer (grid, panel, _("Frame Rate"), true, wxGBPosition (r, 0)); { _frame_rate_sizer = new wxBoxSizer (wxHORIZONTAL); @@ -670,13 +676,8 @@ DCPPanel::make_video_panel () grid->Add (_three_d, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; - add_label_to_sizer (grid, panel, _("Resolution"), true, wxGBPosition (r, 0)); - _resolution = new wxChoice (panel, wxID_ANY); - grid->Add (_resolution, wxGBPosition (r, 1)); - ++r; - { - add_label_to_sizer (grid, panel, _("JPEG2000 bandwidth"), true, wxGBPosition (r, 0)); + add_label_to_sizer (grid, panel, _("JPEG2000 bandwidth\nfor newly-encoded data"), true, wxGBPosition (r, 0)); wxSizer* s = new wxBoxSizer (wxHORIZONTAL); _j2k_bandwidth = new wxSpinCtrl (panel, wxID_ANY); s->Add (_j2k_bandwidth, 1); @@ -685,24 +686,22 @@ DCPPanel::make_video_panel () } ++r; - _container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::container_changed, this)); - _frame_rate_choice->Bind(wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::frame_rate_choice_changed, this)); - _frame_rate_spin->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::frame_rate_spin_changed, this)); - _best_frame_rate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::best_frame_rate_clicked, this)); - _j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::j2k_bandwidth_changed, this)); - /* Also listen to wxEVT_COMMAND_TEXT_UPDATED so that typing numbers directly in is always noticed */ - _j2k_bandwidth->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::j2k_bandwidth_changed, this)); - _resolution->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::resolution_changed, this)); - _three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::three_d_changed, this)); + _container->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::container_changed, this)); + _frame_rate_choice->Bind(wxEVT_CHOICE, boost::bind (&DCPPanel::frame_rate_choice_changed, this)); + _frame_rate_spin->Bind (wxEVT_SPINCTRL, boost::bind (&DCPPanel::frame_rate_spin_changed, this)); + _best_frame_rate->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::best_frame_rate_clicked, this)); + _j2k_bandwidth->Bind (wxEVT_SPINCTRL, boost::bind (&DCPPanel::j2k_bandwidth_changed, this)); + /* Also listen to wxEVT_TEXT so that typing numbers directly in is always noticed */ + _j2k_bandwidth->Bind (wxEVT_TEXT, boost::bind (&DCPPanel::j2k_bandwidth_changed, this)); + _resolution->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::resolution_changed, this)); + _three_d->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::three_d_changed, this)); - vector const ratio = Ratio::all (); - for (vector::const_iterator i = ratio.begin(); i != ratio.end(); ++i) { - _container->Append (std_to_wx ((*i)->nickname ())); + BOOST_FOREACH (Ratio const * i, Ratio::containers()) { + _container->Append (std_to_wx(i->container_nickname())); } - list const dfr = Config::instance()->allowed_dcp_frame_rates (); - for (list::const_iterator i = dfr.begin(); i != dfr.end(); ++i) { - _frame_rate_choice->Append (std_to_wx (boost::lexical_cast (*i))); + BOOST_FOREACH (int i, Config::instance()->allowed_dcp_frame_rates()) { + _frame_rate_choice->Append (std_to_wx (boost::lexical_cast (i))); } _j2k_bandwidth->SetRange (1, Config::instance()->maximum_j2k_bandwidth() / 1000000); @@ -759,9 +758,9 @@ DCPPanel::make_audio_panel () grid->Add (_show_audio, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; - _audio_channels->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::audio_channels_changed, this)); - _audio_processor->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::audio_processor_changed, this)); - _show_audio->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::show_audio_clicked, this)); + _audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_channels_changed, this)); + _audio_processor->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_processor_changed, this)); + _show_audio->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::show_audio_clicked, this)); return panel; }