From f07aadd69c58fef14f36c9a844f7834c93b4a7de Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 24 Aug 2020 10:20:12 +0200 Subject: [PATCH] Add advanced checkbox to set content trim mode. --- src/wx/content_advanced_dialog.cc | 13 +++++++++++++ src/wx/content_advanced_dialog.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/wx/content_advanced_dialog.cc b/src/wx/content_advanced_dialog.cc index 79e6da9fa..a7086d8aa 100644 --- a/src/wx/content_advanced_dialog.cc +++ b/src/wx/content_advanced_dialog.cc @@ -68,6 +68,10 @@ ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptrAdd (ignore_video, wxGBPosition(r, 0), wxGBSpan(1, 2)); ++r; + wxCheckBox* trim_playlist = new wxCheckBox (this, wxID_ANY, _("Use the playlist to trim rather than removing data from content")); + sizer->Add (trim_playlist, wxGBPosition(r, 0), wxGBSpan(1, 2)); + ++r; + wxSizer* overall = new wxBoxSizer (wxVERTICAL); overall->Add (sizer, 1, wxALL, DCPOMATIC_DIALOG_BORDER); wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); @@ -79,9 +83,11 @@ ContentAdvancedDialog::ContentAdvancedDialog (wxWindow* parent, shared_ptrEnable (static_cast(_content->video)); ignore_video->SetValue (_content->video ? !content->video->use() : false); + trim_playlist->SetValue (_content->trim_behaviour() == Content::TRIM_PLAYLIST); setup_filters (); ignore_video->Bind (wxEVT_CHECKBOX, bind(&ContentAdvancedDialog::ignore_video_changed, this, _1)); + trim_playlist->Bind (wxEVT_CHECKBOX, bind(&ContentAdvancedDialog::trim_playlist_changed, this, _1)); _filters_button->Bind (wxEVT_BUTTON, bind(&ContentAdvancedDialog::edit_filters, this)); } @@ -95,6 +101,13 @@ ContentAdvancedDialog::ignore_video_changed (wxCommandEvent& ev) } +void +ContentAdvancedDialog::trim_playlist_changed (wxCommandEvent& ev) +{ + _content->set_trim_behaviour (ev.IsChecked() ? Content::TRIM_PLAYLIST : Content::TRIM_CONTENT); +} + + void ContentAdvancedDialog::setup_filters () { diff --git a/src/wx/content_advanced_dialog.h b/src/wx/content_advanced_dialog.h index b8c12d7b2..fe57063d8 100644 --- a/src/wx/content_advanced_dialog.h +++ b/src/wx/content_advanced_dialog.h @@ -38,6 +38,7 @@ public: private: void ignore_video_changed (wxCommandEvent& ev); + void trim_playlist_changed (wxCommandEvent& ev); void edit_filters (); void filters_changed (std::vector filters); void setup_filters (); -- 2.30.2