diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-06-21 11:57:24 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-07-10 23:13:14 +0200 |
| commit | 9db2168dcc14a803dcd9da047ddd70e2142d82e2 (patch) | |
| tree | 452103b2ed3a65cbaf9f3b4bb731c2afdbd809f7 /src/wx | |
| parent | d1c151cfdedbf1946d30e9072dc4a5b2ea5f2f80 (diff) | |
Allow specification of player crop in playlist.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/spl_entry_dialog.cc | 76 | ||||
| -rw-r--r-- | src/wx/spl_entry_dialog.h | 42 | ||||
| -rw-r--r-- | src/wx/wscript | 1 |
3 files changed, 119 insertions, 0 deletions
diff --git a/src/wx/spl_entry_dialog.cc b/src/wx/spl_entry_dialog.cc new file mode 100644 index 000000000..332b7840c --- /dev/null +++ b/src/wx/spl_entry_dialog.cc @@ -0,0 +1,76 @@ +/* + Copyright (C) 2025 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#include "check_box.h" +#include "ratio_picker.h" +#include "spl_entry_dialog.h" +#include "wx_util.h" +#include "lib/spl.h" +#include <wx/wx.h> + + +using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif + + + +SPLEntryDialog::SPLEntryDialog(wxWindow* parent, SPLEntry entry) + : TableDialog(parent, _("Playlist item"), 2, 1, true) + , _entry(entry) +{ + add(_("Name"), true); + auto name = _entry.name; +#ifdef DCPOMATIC_LINUX + boost::replace_all(name, "_", "__"); +#endif + add(std_to_wx(name), false); + add(_("CPL"), true); + add(std_to_wx(_entry.id.get_value_or("")), false); + add(_("Type"), true); + add(std_to_wx(_entry.kind->name()), false); + add(_("Encrypted"), true); + add(_entry.encrypted ? _("Yes") : _("No"), false); + + _crop = new RatioPicker(this, entry.crop_to_ratio); + add(_crop->enable_checkbox(), false); + add(_crop, false); + + layout(); + + _crop->Changed.connect(boost::bind(&SPLEntryDialog::crop_changed, this, _1)); +} + + +SPLEntry +SPLEntryDialog::get() const +{ + return _entry; +} + + +void +SPLEntryDialog::crop_changed(optional<float> ratio) +{ + _entry.crop_to_ratio = ratio; +} + diff --git a/src/wx/spl_entry_dialog.h b/src/wx/spl_entry_dialog.h new file mode 100644 index 000000000..63e4ba56f --- /dev/null +++ b/src/wx/spl_entry_dialog.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2025 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#include "table_dialog.h" +#include "lib/spl.h" + + +class RatioPicker; + + +class SPLEntryDialog : public TableDialog +{ +public: + SPLEntryDialog(wxWindow* parent, SPLEntry entry); + + SPLEntry get() const; + +private: + void crop_changed(boost::optional<float> ratio); + + SPLEntry _entry; + + RatioPicker* _crop; +}; diff --git a/src/wx/wscript b/src/wx/wscript index 3049d842d..06e24936c 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -164,6 +164,7 @@ sources = """ simple_video_view.cc smpte_metadata_dialog.cc sound_preferences_page.cc + spl_entry_dialog.cc standard_controls.cc static_text.cc subtag_list_ctrl.cc |
