summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-10-31 22:11:36 +0100
committerCarl Hetherington <cth@carlh.net>2019-10-31 22:11:36 +0100
commitf0956ea1c21b81748af55867698561d12ad2c91b (patch)
tree50d1aa564546f83c0eb8c6d7f8eba2fc665fd62c /src/lib
parent2983479f9e579e8d6ec6cb33226efd7a0f97ec2a (diff)
Prevent reference/reel setting controls getting stuck when referenced
content is moved with reel mode 'single' enabled (#1645).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc47
-rw-r--r--src/lib/film.h1
2 files changed, 30 insertions, 18 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 988b7e2fe..f0dc683ed 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1276,6 +1276,9 @@ Film::playlist_content_change (ChangeType type, weak_ptr<Content> c, int p, bool
if (type == CHANGE_TYPE_DONE) {
emit (boost::bind (boost::ref (ContentChange), type, c, p, frequent));
+ if (!frequent) {
+ check_settings_consistency ();
+ }
} else {
ContentChange (type, c, p, frequent);
}
@@ -1288,29 +1291,37 @@ Film::playlist_change (ChangeType type)
signal_change (type, NAME);
if (type == CHANGE_TYPE_DONE) {
- /* Check that this change hasn't made our settings inconsistent */
- bool change_made = false;
- BOOST_FOREACH (shared_ptr<Content> i, content()) {
- shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
- if (!d) {
- continue;
- }
+ check_settings_consistency ();
+ }
+}
- string why_not;
- if (d->reference_video() && !d->can_reference_video(shared_from_this(), why_not)) {
- d->set_reference_video(false);
- change_made = true;
- }
- if (d->reference_audio() && !d->can_reference_audio(shared_from_this(), why_not)) {
- d->set_reference_audio(false);
- change_made = true;
- }
+/** Check for (and if necessary fix) impossible settings combinations, like
+ * video set to being referenced when it can't be.
+ */
+void
+Film::check_settings_consistency ()
+{
+ bool change_made = false;
+ BOOST_FOREACH (shared_ptr<Content> i, content()) {
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
+ if (!d) {
+ continue;
}
- if (change_made) {
- Message (_("DCP-o-matic had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want."));
+ string why_not;
+ if (d->reference_video() && !d->can_reference_video(shared_from_this(), why_not)) {
+ d->set_reference_video(false);
+ change_made = true;
+ }
+ if (d->reference_audio() && !d->can_reference_audio(shared_from_this(), why_not)) {
+ d->set_reference_audio(false);
+ change_made = true;
}
}
+
+ if (change_made) {
+ Message (_("DCP-o-matic had to change your settings for referring to DCPs as OV. Please review those settings to make sure they are what you want."));
+ }
}
void
diff --git a/src/lib/film.h b/src/lib/film.h
index 0c1959056..4c45c4ffc 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -405,6 +405,7 @@ private:
void playlist_content_change (ChangeType type, boost::weak_ptr<Content>, int, bool frequent);
void maybe_add_content (boost::weak_ptr<Job>, boost::weak_ptr<Content>, bool disable_audio_analysis);
void audio_analysis_finished ();
+ void check_settings_consistency ();
static std::string const metadata_file;