summaryrefslogtreecommitdiff
path: root/src/tools
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/tools
parente0eecce56d975d9819f902cbb51c886b16e8ebf7 (diff)
Allow specification of KDM annotation text (#296).
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic_kdm.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index 8e5e75da0..c125428db 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -382,12 +382,12 @@ private:
vector<KDMCertificatePeriod> period_checks;
- std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm = [decrypted, title](dcp::LocalTime begin, dcp::LocalTime end) {
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm = [this, decrypted, title](dcp::LocalTime begin, dcp::LocalTime end) {
/* Make an empty KDM */
dcp::DecryptedKDM kdm (
begin,
end,
- decrypted.annotation_text().get_value_or(""),
+ _output->annotation_text(),
title,
dcp::LocalTime().as_string()
);
@@ -487,7 +487,17 @@ private:
void dkdm_selection_changed()
{
- _selected_dkdm = selected_dkdm();
+ if (_selected_dkdm = selected_dkdm()) {
+ auto dkdm = std::dynamic_pointer_cast<DKDM>(_selected_dkdm);
+ if (dkdm) {
+ try {
+ dcp::DecryptedKDM decrypted(dkdm->dkdm(), Config::instance()->decryption_chain()->key().get());
+ if (decrypted.annotation_text()) {
+ _output->set_annotation_text(*decrypted.annotation_text());
+ }
+ } catch (...) {}
+ }
+ }
setup_sensitivity();
}