From 51ae14c7e304d4fbc8d7524d584f3f4762d51f67 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 13 Apr 2021 01:38:56 +0200 Subject: [PATCH] Make ReelAsset the parent of ReelFileAsset. --- src/reel_atmos_asset.cc | 6 ++---- src/reel_atmos_asset.h | 2 +- src/reel_closed_caption_asset.cc | 6 ++---- src/reel_closed_caption_asset.h | 2 +- src/reel_file_asset.cc | 8 +++++--- src/reel_file_asset.h | 9 +++++---- src/reel_picture_asset.cc | 6 ++---- src/reel_picture_asset.h | 2 +- src/reel_sound_asset.cc | 6 ++---- src/reel_sound_asset.h | 2 +- src/reel_subtitle_asset.cc | 6 ++---- src/reel_subtitle_asset.h | 2 +- 12 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/reel_atmos_asset.cc b/src/reel_atmos_asset.cc index 32ebbcf5..b17dceca 100644 --- a/src/reel_atmos_asset.cc +++ b/src/reel_atmos_asset.cc @@ -51,8 +51,7 @@ using namespace dcp; ReelAtmosAsset::ReelAtmosAsset (std::shared_ptr asset, int64_t entry_point) - : ReelAsset (asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) - , ReelFileAsset (asset) + : ReelFileAsset (asset, asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) , ReelEncryptableAsset (asset->key_id()) { @@ -60,8 +59,7 @@ ReelAtmosAsset::ReelAtmosAsset (std::shared_ptr asset, int64_t entry ReelAtmosAsset::ReelAtmosAsset (std::shared_ptr node) - : ReelAsset (node) - , ReelFileAsset (node) + : ReelFileAsset (node) , ReelEncryptableAsset (node) { node->ignore_child ("DataType"); diff --git a/src/reel_atmos_asset.h b/src/reel_atmos_asset.h index 6f452c3a..8aaf6a59 100644 --- a/src/reel_atmos_asset.h +++ b/src/reel_atmos_asset.h @@ -55,7 +55,7 @@ class AtmosAsset; /** @class ReelAtmosAsset * @brief Part of a Reel's description which refers to a Atmos MXF */ -class ReelAtmosAsset : public ReelAsset, public ReelFileAsset, public ReelEncryptableAsset +class ReelAtmosAsset : public ReelFileAsset, public ReelEncryptableAsset { public: ReelAtmosAsset (std::shared_ptr asset, int64_t entry_point); diff --git a/src/reel_closed_caption_asset.cc b/src/reel_closed_caption_asset.cc index a29d6e37..4ba6fe0c 100644 --- a/src/reel_closed_caption_asset.cc +++ b/src/reel_closed_caption_asset.cc @@ -54,16 +54,14 @@ using namespace dcp; ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) - : ReelAsset (asset->id(), edit_rate, intrinsic_duration, entry_point) - , ReelFileAsset (asset) + : ReelFileAsset (asset, asset->id(), edit_rate, intrinsic_duration, entry_point) { } ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr node) - : ReelAsset (node) - , ReelFileAsset (node) + : ReelFileAsset (node) { _language = node->optional_string_child ("Language"); } diff --git a/src/reel_closed_caption_asset.h b/src/reel_closed_caption_asset.h index 44ae83f3..a1f3b6ec 100644 --- a/src/reel_closed_caption_asset.h +++ b/src/reel_closed_caption_asset.h @@ -56,7 +56,7 @@ namespace dcp { /** @class ReelClosedCaptionAsset * @brief Part of a Reel's description which refers to a closed caption XML/MXF file */ -class ReelClosedCaptionAsset : public ReelAsset, public ReelFileAsset +class ReelClosedCaptionAsset : public ReelFileAsset { public: ReelClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point); diff --git a/src/reel_file_asset.cc b/src/reel_file_asset.cc index a55e084e..85bf9de7 100644 --- a/src/reel_file_asset.cc +++ b/src/reel_file_asset.cc @@ -45,8 +45,9 @@ using std::shared_ptr; using namespace dcp; -ReelFileAsset::ReelFileAsset (shared_ptr asset) - : _asset_ref (asset) +ReelFileAsset::ReelFileAsset (shared_ptr asset, std::string id, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) + : ReelAsset (id, edit_rate, intrinsic_duration, entry_point) + , _asset_ref (asset) , _hash (asset->hash()) { @@ -54,7 +55,8 @@ ReelFileAsset::ReelFileAsset (shared_ptr asset) ReelFileAsset::ReelFileAsset (shared_ptr node) - : _asset_ref (remove_urn_uuid(node->string_child("Id"))) + : ReelAsset (node) + , _asset_ref (remove_urn_uuid(node->string_child("Id"))) , _hash (node->optional_string_child ("Hash")) { diff --git a/src/reel_file_asset.h b/src/reel_file_asset.h index 070a3e0f..042f94b4 100644 --- a/src/reel_file_asset.h +++ b/src/reel_file_asset.h @@ -41,6 +41,7 @@ #define LIBDCP_REEL_FILE_ASSET_H +#include "reel_asset.h" #include "ref.h" #include #include @@ -49,10 +50,10 @@ namespace dcp { -class ReelFileAsset +class ReelFileAsset : public ReelAsset { public: - explicit ReelFileAsset (std::shared_ptr asset); + ReelFileAsset (std::shared_ptr asset, std::string id, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelFileAsset (std::shared_ptr node); /** @return a Ref to our actual asset */ @@ -82,12 +83,12 @@ protected: template std::shared_ptr asset_of_type () const { - return std::dynamic_pointer_cast (_asset_ref.asset ()); + return std::dynamic_pointer_cast(_asset_ref.asset()); } template std::shared_ptr asset_of_type () { - return std::dynamic_pointer_cast (_asset_ref.asset ()); + return std::dynamic_pointer_cast(_asset_ref.asset()); } /** Reference to the asset (MXF or XML file) that this reel entry diff --git a/src/reel_picture_asset.cc b/src/reel_picture_asset.cc index 8b439003..ddc6a802 100644 --- a/src/reel_picture_asset.cc +++ b/src/reel_picture_asset.cc @@ -57,8 +57,7 @@ using namespace dcp; ReelPictureAsset::ReelPictureAsset (shared_ptr asset, int64_t entry_point) - : ReelAsset (asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) - , ReelFileAsset (asset) + : ReelFileAsset (asset, asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) , ReelEncryptableAsset (asset->key_id()) , _frame_rate (asset->frame_rate ()) , _screen_aspect_ratio (asset->screen_aspect_ratio ()) @@ -68,8 +67,7 @@ ReelPictureAsset::ReelPictureAsset (shared_ptr asset, int64_t entr ReelPictureAsset::ReelPictureAsset (shared_ptr node) - : ReelAsset (node) - , ReelFileAsset (node) + : ReelFileAsset (node) , ReelEncryptableAsset (node) { _frame_rate = Fraction (node->string_child ("FrameRate")); diff --git a/src/reel_picture_asset.h b/src/reel_picture_asset.h index 3d98b09d..6eb01bc9 100644 --- a/src/reel_picture_asset.h +++ b/src/reel_picture_asset.h @@ -52,7 +52,7 @@ namespace dcp { /** @class ReelPictureAsset * @brief Part of a Reel's description which refers to a picture asset */ -class ReelPictureAsset : public ReelAsset, public ReelFileAsset, public ReelEncryptableAsset +class ReelPictureAsset : public ReelFileAsset, public ReelEncryptableAsset { public: ReelPictureAsset (std::shared_ptr asset, int64_t entry_point); diff --git a/src/reel_sound_asset.cc b/src/reel_sound_asset.cc index 7ca2b2da..9cf672df 100644 --- a/src/reel_sound_asset.cc +++ b/src/reel_sound_asset.cc @@ -49,8 +49,7 @@ using namespace dcp; ReelSoundAsset::ReelSoundAsset (shared_ptr asset, int64_t entry_point) - : ReelAsset (asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) - , ReelFileAsset (asset) + : ReelFileAsset (asset, asset->id(), asset->edit_rate(), asset->intrinsic_duration(), entry_point) , ReelEncryptableAsset (asset->key_id()) { @@ -58,8 +57,7 @@ ReelSoundAsset::ReelSoundAsset (shared_ptr asset, int64_t entry_poin ReelSoundAsset::ReelSoundAsset (shared_ptr node) - : ReelAsset (node) - , ReelFileAsset (node) + : ReelFileAsset (node) , ReelEncryptableAsset (node) { node->ignore_child ("Language"); diff --git a/src/reel_sound_asset.h b/src/reel_sound_asset.h index c5619ad9..bf686ec9 100644 --- a/src/reel_sound_asset.h +++ b/src/reel_sound_asset.h @@ -50,7 +50,7 @@ namespace dcp { /** @class ReelSoundAsset * @brief Part of a Reel's description which refers to a sound asset */ -class ReelSoundAsset : public ReelAsset, public ReelFileAsset, public ReelEncryptableAsset +class ReelSoundAsset : public ReelFileAsset, public ReelEncryptableAsset { public: ReelSoundAsset (std::shared_ptr content, int64_t entry_point); diff --git a/src/reel_subtitle_asset.cc b/src/reel_subtitle_asset.cc index 0981d1c0..9c683caa 100644 --- a/src/reel_subtitle_asset.cc +++ b/src/reel_subtitle_asset.cc @@ -52,16 +52,14 @@ using namespace dcp; ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) - : ReelAsset (asset->id(), edit_rate, intrinsic_duration, entry_point) - , ReelFileAsset (asset) + : ReelFileAsset (asset, asset->id(), edit_rate, intrinsic_duration, entry_point) { } ReelSubtitleAsset::ReelSubtitleAsset (std::shared_ptr node) - : ReelAsset (node) - , ReelFileAsset (node) + : ReelFileAsset (node) { _language = node->optional_string_child("Language"); } diff --git a/src/reel_subtitle_asset.h b/src/reel_subtitle_asset.h index ad1ea6cd..fd4c5cd1 100644 --- a/src/reel_subtitle_asset.h +++ b/src/reel_subtitle_asset.h @@ -59,7 +59,7 @@ class SubtitleAsset; /** @class ReelSubtitleAsset * @brief Part of a Reel's description which refers to a subtitle XML/MXF file */ -class ReelSubtitleAsset : public ReelAsset, public ReelFileAsset +class ReelSubtitleAsset : public ReelFileAsset { public: ReelSubtitleAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); -- 2.30.2