summaryrefslogtreecommitdiff
path: root/src/reel.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-19 00:32:53 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-19 00:32:53 +0100
commit1f284533185a798c0ed36669bd6c9729adf6ec5a (patch)
tree94dd3de07e0670f1bf1eed0de94ada1033ceb7f6 /src/reel.cc
parent37631b4d5e07eddbf052c1cff315d6a98b3bcb73 (diff)
Rename encrypted() to any_encrypted() and add all_encrypted().
Diffstat (limited to 'src/reel.cc')
-rw-r--r--src/reel.cc30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/reel.cc b/src/reel.cc
index 89056cff..a05a7b36 100644
--- a/src/reel.cc
+++ b/src/reel.cc
@@ -223,7 +223,7 @@ Reel::equals (std::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandle
}
bool
-Reel::encrypted () const
+Reel::any_encrypted () const
{
auto ecc = false;
for (auto i: _closed_captions) {
@@ -233,14 +233,34 @@ Reel::encrypted () const
}
return (
- (_main_picture && _main_picture->encrypted ()) ||
- (_main_sound && _main_sound->encrypted ()) ||
- (_main_subtitle && _main_subtitle->encrypted ()) ||
+ (_main_picture && _main_picture->encrypted()) ||
+ (_main_sound && _main_sound->encrypted()) ||
+ (_main_subtitle && _main_subtitle->encrypted()) ||
ecc ||
- (_atmos && _atmos->encrypted ())
+ (_atmos && _atmos->encrypted())
);
}
+
+bool
+Reel::all_encrypted () const
+{
+ auto ecc = true;
+ for (auto i: _closed_captions) {
+ if (!i->encrypted()) {
+ ecc = false;
+ }
+ }
+
+ return (
+ (!_main_picture || _main_picture->encrypted()) &&
+ (!_main_sound || _main_sound->encrypted()) &&
+ (!_main_subtitle || _main_subtitle->encrypted()) &&
+ ecc &&
+ (!_atmos || _atmos->encrypted())
+ );
+}
+
void
Reel::add (DecryptedKDM const & kdm)
{