summaryrefslogtreecommitdiff
path: root/src/wx/kdm_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-01-18 00:58:51 +0100
committerCarl Hetherington <cth@carlh.net>2024-01-18 00:58:51 +0100
commit5b10ee366f819c05d69ea8e78c8348eca99721b5 (patch)
tree7eae306a3a20ff2d3760e18a0e4b83b62b0a4f01 /src/wx/kdm_dialog.cc
parente0eecce56d975d9819f902cbb51c886b16e8ebf7 (diff)
Allow specification of KDM annotation text (#296).
Diffstat (limited to 'src/wx/kdm_dialog.cc')
-rw-r--r--src/wx/kdm_dialog.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index c15156eee..c88a1ac40 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -37,6 +37,7 @@
#include "lib/kdm_util.h"
#include "lib/screen.h"
#include <libcxml/cxml.h>
+#include <dcp/cpl.h>
#include <dcp/exceptions.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
@@ -127,8 +128,9 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
_screens->ScreensChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
_timing->TimingChanged.connect (boost::bind (&KDMDialog::setup_sensitivity, this));
_make->Bind (wxEVT_BUTTON, boost::bind (&KDMDialog::make_clicked, this));
- _cpl->Changed.connect(boost::bind(&KDMDialog::setup_sensitivity, this));
+ _cpl->Changed.connect(boost::bind(&KDMDialog::cpl_changed, this));
+ cpl_changed();
setup_sensitivity ();
SetSizer (overall_sizer);
@@ -138,6 +140,20 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
void
+KDMDialog::cpl_changed()
+{
+ try {
+ dcp::CPL cpl(_cpl->cpl());
+ if (auto text = cpl.annotation_text()) {
+ _output->set_annotation_text(*text);
+ }
+ } catch (...) {}
+
+ setup_sensitivity();
+}
+
+
+void
KDMDialog::setup_sensitivity ()
{
_screens->setup_sensitivity ();