X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fdcp_panel.cc;h=1b97a023d263b327202ffb69d8a6e45446b024e0;hb=fe851f2e6e57d3a8781ecc173089c19632c521e3;hp=1457c06a6ad2d4c423e5583c89ab2d3169d4b2bf;hpb=811cd49873641f612a1df12b5b9d7d26bc289759;p=dcpomatic.git diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 1457c06a6..1b97a023d 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -97,7 +97,7 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr film, FilmViewer& viewer) wxALIGN_CENTRE_HORIZONTAL | wxST_NO_AUTORESIZE | wxST_ELLIPSIZE_MIDDLE ); - _enable_audio_language = new wxCheckBox (_panel, wxID_ANY, _("Audio language")); + _enable_audio_language = new CheckBox(_panel, _("Audio language")); _audio_language = new wxStaticText (_panel, wxID_ANY, wxT("")); _edit_audio_language = new Button (_panel, _("Edit...")); @@ -130,16 +130,16 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr film, FilmViewer& viewer) _notebook->AddPage (make_audio_panel (), _("Audio"), false); _name->Bind (wxEVT_TEXT, boost::bind(&DCPPanel::name_changed, this)); - _use_isdcf_name->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::use_isdcf_name_toggled, this)); + _use_isdcf_name->bind(&DCPPanel::use_isdcf_name_toggled, 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)); - _encrypted->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::encrypted_toggled, this)); + _encrypted->bind(&DCPPanel::encrypted_toggled, 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)); _markers->Bind (wxEVT_BUTTON, boost::bind(&DCPPanel::markers_clicked, this)); _metadata->Bind (wxEVT_BUTTON, boost::bind(&DCPPanel::metadata_clicked, this)); - _enable_audio_language->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::enable_audio_language_toggled, this)); + _enable_audio_language->bind(&DCPPanel::enable_audio_language_toggled, this); _edit_audio_language->Bind (wxEVT_BUTTON, boost::bind(&DCPPanel::edit_audio_language_clicked, this)); for (auto i: DCPContentType::all()) { @@ -327,12 +327,7 @@ DCPPanel::standard_changed () void DCPPanel::markers_clicked () { - if (_markers_dialog) { - _markers_dialog->Destroy (); - _markers_dialog = nullptr; - } - - _markers_dialog = new MarkersDialog (_panel, _film, _viewer); + _markers_dialog.reset(_panel, _film, _viewer); _markers_dialog->Show(); } @@ -341,21 +336,11 @@ void DCPPanel::metadata_clicked () { if (_film->interop()) { - if (_interop_metadata_dialog) { - _interop_metadata_dialog->Destroy (); - _interop_metadata_dialog = nullptr; - } - - _interop_metadata_dialog = new InteropMetadataDialog (_panel, _film); + _interop_metadata_dialog.reset(_panel, _film); _interop_metadata_dialog->setup (); _interop_metadata_dialog->Show (); } else { - if (_smpte_metadata_dialog) { - _smpte_metadata_dialog->Destroy (); - _smpte_metadata_dialog = nullptr; - } - - _smpte_metadata_dialog = new SMPTEMetadataDialog (_panel, _film); + _smpte_metadata_dialog.reset(_panel, _film); _smpte_metadata_dialog->setup (); _smpte_metadata_dialog->Show (); } @@ -586,22 +571,10 @@ void 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 = nullptr; - } - if (_markers_dialog) { - _markers_dialog->Destroy (); - _markers_dialog = nullptr; - } - if (_interop_metadata_dialog) { - _interop_metadata_dialog->Destroy (); - _interop_metadata_dialog = nullptr; - } - if (_smpte_metadata_dialog) { - _smpte_metadata_dialog->Destroy (); - _smpte_metadata_dialog = nullptr; - } + _audio_dialog.reset(); + _markers_dialog.reset(); + _interop_metadata_dialog.reset(); + _smpte_metadata_dialog.reset(); _film = film; @@ -806,8 +779,8 @@ DCPPanel::make_video_panel () /* 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)); - _reencode_j2k->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::reencode_j2k_changed, this)); + _three_d->bind(&DCPPanel::three_d_changed, this); + _reencode_j2k->bind(&DCPPanel::reencode_j2k_changed, this); for (auto i: Ratio::containers()) { _container->add(i->container_nickname()); @@ -979,13 +952,8 @@ DCPPanel::show_audio_clicked () return; } - if (_audio_dialog) { - _audio_dialog->Destroy (); - _audio_dialog = nullptr; - } - - auto d = new AudioDialog (_panel, _film, _viewer); - d->Show (); + _audio_dialog.reset(_panel, _film, _viewer); + _audio_dialog->Show(); } @@ -1039,11 +1007,10 @@ void DCPPanel::edit_audio_language_clicked () { DCPOMATIC_ASSERT (_film->audio_language()); - auto d = new LanguageTagDialog (_panel, *_film->audio_language()); + auto d = make_wx(_panel, *_film->audio_language()); if (d->ShowModal() == wxID_OK) { _film->set_audio_language(d->get()); } - d->Destroy (); }