summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-14 21:22:33 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-14 21:22:33 +0100
commit234bca29f70aeeba4fffd67f987de876ff89b6cc (patch)
tree1096d9356805a79d802e950438aef8267ff6df42 /src/tools
parent53c7f717da44c6ff681bde8946875e4f39764b25 (diff)
Basic and rather clumsy option to respect KDM validity windows.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic_player.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 10b75b03d..53947527f 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -162,6 +162,7 @@ public:
_viewer.reset (new FilmViewer (_overall_panel));
_controls = new Controls (_overall_panel, _viewer);
_viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
+ _viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
_info = new PlayerInformation (_overall_panel, _viewer);
wxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
main_sizer->Add (_viewer->panel(), 1, wxEXPAND);
@@ -197,6 +198,27 @@ public:
setup_screen ();
}
+ bool playback_permitted ()
+ {
+ if (!_film || !Config::instance()->respect_kdm_validity_periods()) {
+ return true;
+ }
+
+ bool ok = true;
+ BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
+ if (d && !d->kdm_timing_window_valid()) {
+ ok = false;
+ }
+ }
+
+ if (!ok) {
+ error_dialog (this, _("The KDM does not allow playback of this content at this time."));
+ }
+
+ return ok;
+ }
+
void set_decode_reduction (optional<int> reduction)
{
_viewer->set_dcp_decode_reduction (reduction);