From 6e4dfa6cba7cb878bc3931140189cbf35dd4718b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 16 Dec 2025 17:45:52 +0100 Subject: Add can_be_read() to Reel. --- src/reel.cc | 9 +++++++++ src/reel.h | 6 ++++++ 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/reel.cc b/src/reel.cc index 469c4416..1e31f1e1 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -515,3 +515,12 @@ Reel::duration () const return d; } + + +bool +Reel::can_be_read() const +{ + auto assets = file_assets(); + return std::all_of(assets.begin(), assets.end(), [](shared_ptr asset) { return asset->can_be_read(); }); +} + diff --git a/src/reel.h b/src/reel.h index ecea0965..31e11abc 100644 --- a/src/reel.h +++ b/src/reel.h @@ -43,6 +43,7 @@ #include "decrypted_kdm.h" #include "key.h" +#include "picture_encoding.h" #include "ref.h" #include #include @@ -140,6 +141,11 @@ public: bool any_encrypted () const; bool all_encrypted () const; + /** Checks to see whether all assets can be read (either because + * they are unencrypted, or the provided KDM can decrypt them). + */ + bool can_be_read() const; + bool equals(std::shared_ptr other, EqualityOptions const& opt, NoteHandler notes) const; void add (DecryptedKDM const &); -- cgit v1.2.3