diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-01-31 23:50:57 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-01-31 23:50:57 +0000 |
| commit | 4b3554db5556f8745ff36c5ca80423aaa41ae506 (patch) | |
| tree | 36386608a7da560213f92b84b47d349ec3a60704 /src/lib | |
| parent | 0a83994b5308cadc36e08d944bc65c2aef84449e (diff) | |
Disable DCP panel stuff which cannot be altered when a DCP is being referenced.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 28 | ||||
| -rw-r--r-- | src/lib/film.h | 5 |
2 files changed, 31 insertions, 2 deletions
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 <cth@carlh.net> + Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -1590,3 +1590,29 @@ Film::copy_from (shared_ptr<const Film> film) { read_metadata (film->file (metadata_file)); } + +bool +Film::references_dcp_video () const +{ + BOOST_FOREACH (shared_ptr<Content> i, _playlist->content()) { + shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i); + if (d && d->reference_video()) { + return true; + } + } + + return false; +} + +bool +Film::references_dcp_audio () const +{ + BOOST_FOREACH (shared_ptr<Content> i, _playlist->content()) { + shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(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 <cth@carlh.net> + Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -167,6 +167,9 @@ public: std::list<std::string> fix_conflicting_settings (); + bool references_dcp_video () const; + bool references_dcp_audio () const; + /** Identifiers for the parts of our state; used for signalling changes. */ |
