X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fdcp_panel.cc;h=047768f56119c7e03f322e07393795145b62b577;hb=refs%2Ftags%2Fv2.15.123;hp=0a0bd5aab8c9b0e1e23fe8401215672eb6b7409f;hpb=b621aa2e3c7dedcfce6382f9f69e646fa53a9e23;p=dcpomatic.git diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 0a0bd5aab..047768f56 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2020 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -47,7 +47,6 @@ #include #include #include -#include #include using std::cout; @@ -58,8 +57,8 @@ using std::pair; using std::max; using std::make_pair; using boost::lexical_cast; -using boost::shared_ptr; -using boost::weak_ptr; +using std::shared_ptr; +using std::weak_ptr; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif @@ -103,7 +102,7 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr film, weak_ptr v _encrypted = new CheckBox (_panel, _("Encrypted")); wxClientDC dc (_panel); - wxSize size = dc.GetTextExtent (wxT ("GGGGGGGG...")); + auto size = dc.GetTextExtent (wxT ("GGGGGGGG...")); size.SetHeight (-1); _reels_label = create_label (_panel, _("Reels"), true); @@ -137,7 +136,7 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr film, weak_ptr v _markers->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::markers_clicked, this)); _metadata->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::metadata_clicked, this)); - BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) { + for (auto i: DCPContentType::all()) { _dcp_content_type->Append (std_to_wx (i->pretty_name ())); } @@ -197,7 +196,7 @@ DCPPanel::add_to_grid () { wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); s->Add (_reel_length); - add_label_to_sizer (s, _reel_length_gb_label, false); + add_label_to_sizer (s, _reel_length_gb_label, false, 0, wxLEFT | wxALIGN_CENTER_VERTICAL); _grid->Add (s, wxGBPosition (r, 1)); } ++r; @@ -206,7 +205,7 @@ DCPPanel::add_to_grid () _grid->Add (_standard, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); ++r; - wxBoxSizer* extra = new wxBoxSizer (wxHORIZONTAL); + auto extra = new wxBoxSizer (wxHORIZONTAL); extra->Add (_markers, 1, wxRIGHT, DCPOMATIC_SIZER_X_GAP); extra->Add (_metadata, 1, wxRIGHT, DCPOMATIC_SIZER_X_GAP); _grid->Add (extra, wxGBPosition(r, 0), wxGBSpan(1, 2)); @@ -524,19 +523,19 @@ DCPPanel::set_film (shared_ptr film) /* We are changing film, so destroy any dialogs for the old one */ if (_audio_dialog) { _audio_dialog->Destroy (); - _audio_dialog = 0; + _audio_dialog = nullptr; } if (_markers_dialog) { _markers_dialog->Destroy (); - _markers_dialog = 0; + _markers_dialog = nullptr; } if (_interop_metadata_dialog) { _interop_metadata_dialog->Destroy (); - _interop_metadata_dialog = 0; + _interop_metadata_dialog = nullptr; } if (_smpte_metadata_dialog) { _smpte_metadata_dialog->Destroy (); - _smpte_metadata_dialog = 0; + _smpte_metadata_dialog = nullptr; } _film = film; @@ -635,7 +634,7 @@ DCPPanel::edit_isdcf_button_clicked () return; } - ISDCFMetadataDialog* d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata (), _film->three_d ()); + auto d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata (), _film->three_d ()); d->ShowModal (); _film->set_isdcf_metadata (d->isdcf_metadata ()); d->Destroy (); @@ -708,8 +707,8 @@ DCPPanel::setup_frame_rate_widget () wxPanel * DCPPanel::make_video_panel () { - wxPanel* panel = new wxPanel (_notebook); - wxSizer* sizer = new wxBoxSizer (wxVERTICAL); + auto panel = new wxPanel (_notebook); + auto sizer = new wxBoxSizer (wxVERTICAL); _video_grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); sizer->Add (_video_grid, 0, wxALL, 8); panel->SetSizer (sizer); @@ -746,11 +745,11 @@ DCPPanel::make_video_panel () _three_d->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::three_d_changed, this)); _reencode_j2k->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::reencode_j2k_changed, this)); - BOOST_FOREACH (Ratio const * i, Ratio::containers()) { + for (auto i: Ratio::containers()) { _container->Append (std_to_wx(i->container_nickname())); } - BOOST_FOREACH (int i, Config::instance()->allowed_dcp_frame_rates()) { + for (auto i: Config::instance()->allowed_dcp_frame_rates()) { _frame_rate_choice->Append (std_to_wx (boost::lexical_cast (i))); } @@ -797,10 +796,10 @@ DCPPanel::add_video_panel_to_grid () ++r; add_label_to_sizer (_video_grid, _j2k_bandwidth_label, true, wxGBPosition (r, 0)); - wxSizer* s = new wxBoxSizer (wxHORIZONTAL); - s->Add (_j2k_bandwidth, 1); - add_label_to_sizer (s, _mbits_label, false); - _video_grid->Add (s, wxGBPosition (r, 1)); + auto s = new wxBoxSizer (wxHORIZONTAL); + s->Add (_j2k_bandwidth, 0, wxALIGN_CENTER_VERTICAL); + add_label_to_sizer (s, _mbits_label, false, 0, wxLEFT | wxALIGN_CENTER_VERTICAL); + _video_grid->Add (s, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND); ++r; _video_grid->Add (_reencode_j2k, wxGBPosition(r, 0), wxGBSpan(1, 2)); } @@ -823,7 +822,7 @@ DCPPanel::minimum_allowed_audio_channels () const wxPanel * DCPPanel::make_audio_panel () { - wxPanel* panel = new wxPanel (_notebook); + auto panel = new wxPanel (_notebook); _audio_panel_sizer = new wxBoxSizer (wxVERTICAL); _audio_grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); _audio_panel_sizer->Add (_audio_grid, 0, wxALL, 8); @@ -879,7 +878,7 @@ DCPPanel::audio_processor_changed () return; } - string const s = string_client_data (_audio_processor->GetClientObject (_audio_processor->GetSelection ())); + auto const s = string_client_data (_audio_processor->GetClientObject (_audio_processor->GetSelection ())); _film->set_audio_processor (AudioProcessor::from_id (s)); } @@ -895,7 +894,7 @@ DCPPanel::show_audio_clicked () _audio_dialog = 0; } - AudioDialog* d = new AudioDialog (_panel, _film, _viewer); + auto d = new AudioDialog (_panel, _film, _viewer); d->Show (); } @@ -923,7 +922,7 @@ void DCPPanel::add_audio_processors () { _audio_processor->Append (_("None"), new wxStringClientData (N_("none"))); - BOOST_FOREACH (AudioProcessor const * ap, AudioProcessor::visible()) { + for (auto ap: AudioProcessor::visible()) { _audio_processor->Append (std_to_wx(ap->name()), new wxStringClientData(std_to_wx(ap->id()))); } _audio_panel_sizer->Layout();