Remove reference checkboxes from video/audio/text tabs.
authorCarl Hetherington <cth@carlh.net>
Sun, 14 May 2023 22:03:44 +0000 (00:03 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 28 Jan 2024 01:01:58 +0000 (02:01 +0100)
src/wx/audio_panel.cc
src/wx/audio_panel.h
src/wx/content_sub_panel.cc
src/wx/content_sub_panel.h
src/wx/dcp_panel.cc
src/wx/text_panel.cc
src/wx/text_panel.h
src/wx/video_panel.cc
src/wx/video_panel.h

index f0863431a04b01bebad4feee14b08291c7b74a29..d7deeec41987053ce654dac7ac61797330140e4c 100644 (file)
@@ -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<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (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<DCPContent> (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<const Content> c) { return static_cast<bool>(c->video); });
 
        _gain->wrapped()->Enable (!ref);
@@ -499,23 +467,6 @@ AudioPanel::active_jobs_changed (optional<string> old_active, optional<string> n
 }
 
 
-void
-AudioPanel::reference_clicked ()
-{
-       auto c = _parent->selected ();
-       if (c.size() != 1) {
-               return;
-       }
-
-       auto d = dynamic_pointer_cast<DCPContent>(c.front());
-       if (!d) {
-               return;
-       }
-
-       d->set_reference_audio (_reference->GetValue ());
-}
-
-
 void
 AudioPanel::set_film (shared_ptr<Film>)
 {
index 61dd2783ac8cd54d4ad5e20f8a884490ca7c3ffd..d25f7e247005bdf0a9dfcae06735417f679452c0 100644 (file)
@@ -54,15 +54,12 @@ private:
        void setup_peak ();
        void active_jobs_changed (boost::optional<std::string>, boost::optional<std::string>);
        void setup_sensitivity ();
-       void reference_clicked ();
        void add_to_grid () override;
        boost::optional<float> 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;
index 6bbc9a51fcae43a89ad9e785ec99e2242fb266cb..10fdfa232e41e32027e7786bafc56e04f94dfb0d 100644 (file)
@@ -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<DCPContent> 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 ()
 {
index a3916817e45f7057fdca651aef5d22097ab65bfb..48970e6a92651a97189a6ed236c7cf9c68b3536d 100644 (file)
@@ -55,7 +55,6 @@ public:
 
 protected:
 
-       void setup_refer_button (wxCheckBox* button, wxStaticText* note, std::shared_ptr<DCPContent> dcp, bool can_reference, wxString cannot);
        void layout ();
        virtual void add_to_grid () = 0;
 
index f4ba74cdefbbcefd433379a26698af0bac33f9c5..fda5a21fcaa209ea81b9a28c7db213cf76064843 100644 (file)
@@ -155,7 +155,7 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr<Film> 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));
 
index 78c024565eb95434805ae3a5836b4a03abafb16a..c3a5706b0d23ced98d2bd98b47ea57b81ea3b4cf 100644 (file)
@@ -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<DCPContent> (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<DCPContent>(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<DCPContent> (c.front ());
-       if (!d) {
-               return;
-       }
-
-       d->set_reference_text (_original_type, _reference->GetValue ());
-}
-
-
 void
 TextPanel::appearance_dialog_clicked ()
 {
index 5adad5a3ed14dd55fb05579d1586fff7c2840615..a2afba4399c359931c6ffebe69405d62fc5af991 100644 (file)
@@ -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;
index 8a02dff25b01acc08e958f05717124dce8f96ad0..f78da05d9ccc0ce0a9febb289485ac7c30949a63 100644 (file)
@@ -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<VideoContent, VideoFrameType> (
                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<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (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<DCPContent> (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<DCPContent> (c.front ());
-       if (!d) {
-               return;
-       }
-
-       d->set_reference_video (_reference->GetValue ());
-}
-
-
 void
 VideoPanel::scale_fit_clicked ()
 {
index 686d1b99b32300e951013f947b08fa20ec1ceee5..e6b689b038ad71ec7b347983af46a897c5ab89eb 100644 (file)
@@ -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<VideoContent, VideoFrameType>* _frame_type;
        wxStaticText* _crop_label;