From dc3c76a718338212521a56614da49358f5eeabc8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 15 May 2023 00:03:44 +0200 Subject: [PATCH] Remove reference checkboxes from video/audio/text tabs. --- src/wx/audio_panel.cc | 57 +++---------------------------------- src/wx/audio_panel.h | 3 -- src/wx/content_sub_panel.cc | 23 --------------- src/wx/content_sub_panel.h | 1 - src/wx/dcp_panel.cc | 2 +- src/wx/text_panel.cc | 53 +--------------------------------- src/wx/text_panel.h | 3 -- src/wx/video_panel.cc | 56 ++++-------------------------------- src/wx/video_panel.h | 3 -- 9 files changed, 11 insertions(+), 190 deletions(-) diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index f0863431a..d7deeec41 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -71,14 +71,6 @@ AudioPanel::AudioPanel (ContentPanel* p) void AudioPanel::create () { - _reference = new CheckBox (this, _("Use this DCP's audio as OV and make VF")); - _reference_note = new StaticText (this, wxT("")); - _reference_note->Wrap (200); - auto font = _reference_note->GetFont(); - font.SetStyle(wxFONTSTYLE_ITALIC); - font.SetPointSize(font.GetPointSize() - 1); - _reference_note->SetFont(font); - _show = new Button (this, _("Show graph of audio levels...")); _peak = new StaticText (this, wxT ("")); @@ -121,6 +113,9 @@ AudioPanel::create () _description = new StaticText (this, wxT(" \n"), wxDefaultPosition, wxDefaultSize); _sizer->Add (_description, 0, wxALL, 12); + auto font = _description->GetFont(); + font.SetStyle(wxFONTSTYLE_ITALIC); + font.SetPointSize(font.GetPointSize() - 1); _description->SetFont (font); _gain->wrapped()->SetRange (-60, 60); @@ -133,7 +128,6 @@ AudioPanel::create () film_changed(FilmProperty::VIDEO_FRAME_RATE); film_changed(FilmProperty::REEL_TYPE); - _reference->bind(&AudioPanel::reference_clicked, this); _show->Bind (wxEVT_BUTTON, boost::bind (&AudioPanel::show_clicked, this)); _gain_calculate_button->Bind (wxEVT_BUTTON, boost::bind (&AudioPanel::gain_calculate_button_clicked, this)); @@ -155,12 +149,6 @@ AudioPanel::add_to_grid () { int r = 0; - auto reference_sizer = new wxBoxSizer (wxVERTICAL); - reference_sizer->Add (_reference, 0); - reference_sizer->Add (_reference_note, 0); - _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 4)); - ++r; - _grid->Add (_show, wxGBPosition (r, 0), wxGBSpan (1, 2)); _grid->Add (_peak, wxGBPosition (r, 2), wxGBSpan (1, 2), wxALIGN_CENTER_VERTICAL); ++r; @@ -257,15 +245,6 @@ AudioPanel::film_content_changed (int property) /* This is a bit aggressive but probably not so bad */ _peak_cache.clear(); setup_peak (); - } else if (property == DCPContentProperty::REFERENCE_AUDIO) { - if (ac.size() == 1) { - shared_ptr dcp = dynamic_pointer_cast (ac.front ()); - checked_set (_reference, dcp ? dcp->reference_audio () : false); - } else { - checked_set (_reference, false); - } - - setup_sensitivity (); } else if (property == ContentProperty::VIDEO_FRAME_RATE) { setup_description (); } else if (property == AudioContentProperty::FADE_IN) { @@ -383,19 +362,8 @@ AudioPanel::setup_sensitivity () dcp = dynamic_pointer_cast (sel.front ()); } - string why_not; - bool const can_reference = dcp && dcp->can_reference_audio (_parent->film(), why_not); - wxString cannot; - if (why_not.empty()) { - cannot = _("Cannot reference this DCP's audio."); - } else { - cannot = _("Cannot reference this DCP's audio: ") + std_to_wx(why_not); - } - setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot); - - auto const ref = _reference->GetValue(); + auto const ref = dcp && dcp->reference_audio(); auto const single = sel.size() == 1; - auto const all_have_video = std::all_of(sel.begin(), sel.end(), [](shared_ptr c) { return static_cast(c->video); }); _gain->wrapped()->Enable (!ref); @@ -499,23 +467,6 @@ AudioPanel::active_jobs_changed (optional old_active, optional n } -void -AudioPanel::reference_clicked () -{ - auto c = _parent->selected (); - if (c.size() != 1) { - return; - } - - auto d = dynamic_pointer_cast(c.front()); - if (!d) { - return; - } - - d->set_reference_audio (_reference->GetValue ()); -} - - void AudioPanel::set_film (shared_ptr) { diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h index 61dd2783a..d25f7e247 100644 --- a/src/wx/audio_panel.h +++ b/src/wx/audio_panel.h @@ -54,15 +54,12 @@ private: void setup_peak (); void active_jobs_changed (boost::optional, boost::optional); void setup_sensitivity (); - void reference_clicked (); void add_to_grid () override; boost::optional peak () const; void fade_in_changed (); void fade_out_changed (); void use_same_fades_as_video_changed (); - CheckBox* _reference; - wxStaticText* _reference_note; wxButton* _show; wxStaticText* _gain_label; wxStaticText* _gain_db_label; diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc index 6bbc9a51f..10fdfa232 100644 --- a/src/wx/content_sub_panel.cc +++ b/src/wx/content_sub_panel.cc @@ -52,29 +52,6 @@ ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name) _sizer->Add (_grid, 0, wxALL, 8); } -void -ContentSubPanel::setup_refer_button (wxCheckBox* button, wxStaticText* note, shared_ptr dcp, bool can_reference, wxString cannot) -{ - button->Enable (can_reference); - - if (dcp && !can_reference) { - note->SetLabel (cannot); - } else { - note->SetLabel (wxT("")); - } - - note->Wrap (400); - - if (cannot.IsEmpty()) { - note->Hide (); - } else { - note->Show (); - } - - layout (); -} - - void ContentSubPanel::layout () { diff --git a/src/wx/content_sub_panel.h b/src/wx/content_sub_panel.h index a3916817e..48970e6a9 100644 --- a/src/wx/content_sub_panel.h +++ b/src/wx/content_sub_panel.h @@ -55,7 +55,6 @@ public: protected: - void setup_refer_button (wxCheckBox* button, wxStaticText* note, std::shared_ptr dcp, bool can_reference, wxString cannot); void layout (); virtual void add_to_grid () = 0; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 1b1cc0e36..00d04c2ba 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -155,7 +155,7 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr film, FilmViewer& viewer) _reel_length->SetRange (1, 64); add_standards(); - _standard->SetToolTip(_("Which standard the DCP should use. Interop is older and SMPTE is the modern standard. If in doubt, choose 'SMPTE'")); + _standard->SetToolTip(_("The standard that the DCP should use. Interop is older, and SMPTE is the newer (current) standard. If in doubt, choose 'SMPTE'")); Config::instance()->Changed.connect (boost::bind(&DCPPanel::config_changed, this, _1)); diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 3b7973e30..637f26a19 100644 --- a/src/wx/text_panel.cc +++ b/src/wx/text_panel.cc @@ -84,14 +84,6 @@ TextPanel::create () refer = _("Use this DCP's closed caption as OV and make VF"); } - _reference = new CheckBox (this, refer); - _reference_note = new StaticText (this, wxT("")); - _reference_note->Wrap (200); - auto font = _reference_note->GetFont(); - font.SetStyle(wxFONTSTYLE_ITALIC); - font.SetPointSize(font.GetPointSize() - 1); - _reference_note->SetFont(font); - _use = new CheckBox (this, _("Use as")); _type = new wxChoice (this, wxID_ANY); _type->Append (_("open subtitles")); @@ -132,7 +124,6 @@ TextPanel::create () _y_scale->SetRange (0, 1000); _line_spacing->SetRange (0, 1000); - _reference->bind(&TextPanel::reference_clicked, this); _use->bind(&TextPanel::use_toggled, this); _type->Bind (wxEVT_CHOICE, boost::bind (&TextPanel::type_changed, this)); _burn->bind(&TextPanel::burn_toggled, this); @@ -232,12 +223,6 @@ TextPanel::add_to_grid () { int r = 0; - auto reference_sizer = new wxBoxSizer (wxVERTICAL); - reference_sizer->Add (_reference, 0); - reference_sizer->Add (_reference_note, 0); - _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 4)); - ++r; - auto use = new wxBoxSizer (wxHORIZONTAL); use->Add (_use, 0, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_GAP); use->Add (_type, 1, wxEXPAND, 0); @@ -496,15 +481,6 @@ TextPanel::film_content_changed (int property) if (_language_type) { _language_type->SetSelection (text ? (text->language_is_additional() ? 1 : 0) : 0); } - } else if (property == DCPContentProperty::REFERENCE_TEXT) { - if (scs) { - auto dcp = dynamic_pointer_cast (scs); - checked_set (_reference, dcp ? dcp->reference_text(_original_type) : false); - } else { - checked_set (_reference, false); - } - - setup_sensitivity (); } else if (property == DCPContentProperty::TEXTS) { setup_sensitivity (); } else if (property == ContentProperty::TRIM_START) { @@ -593,17 +569,7 @@ TextPanel::setup_sensitivity () dcp = dynamic_pointer_cast(sel.front()); } - string why_not; - bool const can_reference = dcp && dcp->can_reference_text (_parent->film(), _original_type, why_not); - wxString cannot; - if (why_not.empty()) { - cannot = _("Cannot reference this DCP's subtitles or captions."); - } else { - cannot = _("Cannot reference this DCP's subtitles or captions: ") + std_to_wx(why_not); - } - setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot); - - bool const reference = _reference->GetValue (); + auto const reference = dcp && dcp->reference_text(_original_type); auto const type = current_type (); @@ -762,23 +728,6 @@ TextPanel::fonts_dialog_clicked () } -void -TextPanel::reference_clicked () -{ - auto c = _parent->selected (); - if (c.size() != 1) { - return; - } - - auto d = dynamic_pointer_cast (c.front ()); - if (!d) { - return; - } - - d->set_reference_text (_original_type, _reference->GetValue ()); -} - - void TextPanel::appearance_dialog_clicked () { diff --git a/src/wx/text_panel.h b/src/wx/text_panel.h index 5adad5a3e..a2afba439 100644 --- a/src/wx/text_panel.h +++ b/src/wx/text_panel.h @@ -56,7 +56,6 @@ private: void stream_changed (); void text_view_clicked (); void fonts_dialog_clicked (); - void reference_clicked (); void appearance_dialog_clicked (); void outline_subtitles_changed (); TextType current_type () const; @@ -74,8 +73,6 @@ private: void update_outline_subtitles_in_viewer (); void clear_outline_subtitles (); - CheckBox* _reference; - wxStaticText* _reference_note; CheckBox* _outline_subtitles = nullptr; CheckBox* _use; wxChoice* _type; diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 8a02dff25..f78da05d9 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -76,14 +76,6 @@ VideoPanel::VideoPanel (ContentPanel* p) void VideoPanel::create () { - _reference = new CheckBox (this, _("Use this DCP's video as OV and make VF")); - _reference_note = new StaticText (this, wxT("")); - _reference_note->Wrap (200); - auto font = _reference_note->GetFont(); - font.SetStyle(wxFONTSTYLE_ITALIC); - font.SetPointSize(font.GetPointSize() - 1); - _reference_note->SetFont(font); - _type_label = create_label (this, _("Type"), true); _frame_type = new ContentChoice ( this, @@ -201,6 +193,9 @@ VideoPanel::create () _range->Append (_("Video (MPEG, 16-235)")); _description = new StaticText (this, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize); + auto font = _description->GetFont(); + font.SetStyle(wxFONTSTYLE_ITALIC); + font.SetPointSize(font.GetPointSize() - 1); _description->SetFont(font); _left_crop->wrapped()->SetRange (0, 4096); @@ -221,7 +216,6 @@ VideoPanel::create () _fade_in->Changed.connect (boost::bind (&VideoPanel::fade_in_changed, this)); _fade_out->Changed.connect (boost::bind (&VideoPanel::fade_out_changed, this)); - _reference->bind(&VideoPanel::reference_clicked, this); _scale_fit->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_fit_clicked, this)); _scale_custom->Bind (wxEVT_RADIOBUTTON, boost::bind (&VideoPanel::scale_custom_clicked, this)); _scale_custom_edit->Bind (wxEVT_BUTTON, boost::bind (&VideoPanel::scale_custom_edit_clicked, this)); @@ -242,12 +236,6 @@ VideoPanel::add_to_grid () { int r = 0; - auto reference_sizer = new wxBoxSizer (wxVERTICAL); - reference_sizer->Add (_reference, 0); - reference_sizer->Add (_reference_note, 0); - _grid->Add (reference_sizer, wxGBPosition(r, 0), wxGBSpan(1, 3)); - ++r; - add_label_to_sizer (_grid, _type_label, true, wxGBPosition(r, 0)); _frame_type->add (_grid, wxGBPosition(r, 1), wxGBSpan(1, 2)); ++r; @@ -456,15 +444,6 @@ VideoPanel::film_content_changed (int property) } else { _fade_out->clear (); } - } else if (property == DCPContentProperty::REFERENCE_VIDEO) { - if (vc.size() == 1) { - shared_ptr dcp = dynamic_pointer_cast (vc.front ()); - checked_set (_reference, dcp ? dcp->reference_video () : false); - } else { - checked_set (_reference, false); - } - - setup_sensitivity (); } else if (property == VideoContentProperty::RANGE) { if (vcs) { checked_set (_range, vcs->video->range() == VideoRange::FULL ? 0 : 1); @@ -592,15 +571,7 @@ VideoPanel::setup_sensitivity () dcp = dynamic_pointer_cast (sel.front ()); } - string why_not; - bool const can_reference = dcp && dcp->can_reference_video (_parent->film(), why_not); - wxString cannot; - if (why_not.empty()) { - cannot = _("Cannot reference this DCP's video."); - } else { - cannot = _("Cannot reference this DCP's video: ") + std_to_wx(why_not); - } - setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot); + bool const reference = dcp && dcp->reference_video(); bool any_use = false; for (auto i: _parent->selected_video()) { @@ -609,7 +580,7 @@ VideoPanel::setup_sensitivity () } } - bool const enable = !_reference->GetValue() && any_use; + bool const enable = !reference && any_use; if (!enable) { _frame_type->wrapped()->Enable (false); @@ -681,23 +652,6 @@ VideoPanel::fade_out_changed () } -void -VideoPanel::reference_clicked () -{ - auto c = _parent->selected (); - if (c.size() != 1) { - return; - } - - auto d = dynamic_pointer_cast (c.front ()); - if (!d) { - return; - } - - d->set_reference_video (_reference->GetValue ()); -} - - void VideoPanel::scale_fit_clicked () { diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h index 686d1b99b..e6b689b03 100644 --- a/src/wx/video_panel.h +++ b/src/wx/video_panel.h @@ -53,7 +53,6 @@ public: void content_selection_changed () override; private: - void reference_clicked (); void colour_conversion_changed (); void edit_colour_conversion_clicked (); void range_changed (); @@ -73,8 +72,6 @@ private: void setup_description (); void setup_sensitivity (); - CheckBox* _reference; - wxStaticText* _reference_note; wxStaticText* _type_label; ContentChoice* _frame_type; wxStaticText* _crop_label; -- 2.30.2