From 4b3554db5556f8745ff36c5ca80423aaa41ae506 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 31 Jan 2018 23:50:57 +0000 Subject: Disable DCP panel stuff which cannot be altered when a DCP is being referenced. --- src/lib/film.cc | 28 +++++++++++++++++++++++++++- src/lib/film.h | 5 ++++- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 361daa8b6..68ebddba2 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2017 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -1590,3 +1590,29 @@ Film::copy_from (shared_ptr film) { read_metadata (film->file (metadata_file)); } + +bool +Film::references_dcp_video () const +{ + BOOST_FOREACH (shared_ptr i, _playlist->content()) { + shared_ptr d = dynamic_pointer_cast(i); + if (d && d->reference_video()) { + return true; + } + } + + return false; +} + +bool +Film::references_dcp_audio () const +{ + BOOST_FOREACH (shared_ptr i, _playlist->content()) { + shared_ptr d = dynamic_pointer_cast(i); + if (d && d->reference_audio()) { + return true; + } + } + + return false; +} diff --git a/src/lib/film.h b/src/lib/film.h index 0aa3dab3f..bce2c3b54 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -167,6 +167,9 @@ public: std::list fix_conflicting_settings (); + bool references_dcp_video () const; + bool references_dcp_audio () const; + /** Identifiers for the parts of our state; used for signalling changes. */ -- cgit v1.2.3