Use EnumIndexedVector in DCPExaminer.
[dcpomatic.git] / src / lib / dcp_examiner.h
index 68508847f4125dce5c33936bd11072085cb1d9db..75ea8b68c664176d8aa6072063c272fee74e1da7 100644 (file)
@@ -25,7 +25,6 @@
 
 
 #include "audio_examiner.h"
-#include "dcp.h"
 #include "dcp_text_track.h"
 #include "dcpomatic_assert.h"
 #include "video_examiner.h"
@@ -36,7 +35,7 @@
 class DCPContent;
 
 
-class DCPExaminer : public DCP, public VideoExaminer, public AudioExaminer
+class DCPExaminer : public VideoExaminer, public AudioExaminer
 {
 public:
        explicit DCPExaminer (std::shared_ptr<const DCPContent>, bool tolerant);
@@ -107,7 +106,7 @@ public:
         *  @return Number of assets of this type in this DCP.
         */
        int text_count (TextType type) const {
-               return _text_count[static_cast<int>(type)];
+               return _text_count[type];
        }
 
        boost::optional<dcp::LanguageTag> open_subtitle_language () const {
@@ -132,7 +131,8 @@ public:
        }
 
        dcp::ContentKind content_kind () const {
-               return _content_kind;
+               DCPOMATIC_ASSERT(_content_kind);
+               return *_content_kind;
        }
 
        std::string cpl () const {
@@ -167,6 +167,11 @@ public:
                return _atmos_edit_rate;
        }
 
+       /** @return fonts in each reel */
+       std::vector<std::vector<std::shared_ptr<dcpomatic::Font>>> fonts() const {
+               return _fonts;
+       }
+
 private:
        boost::optional<double> _video_frame_rate;
        boost::optional<dcp::Size> _video_size;
@@ -181,7 +186,7 @@ private:
        bool _has_audio = false;
        boost::optional<dcp::LanguageTag> _audio_language;
        /** number of different assets of each type (OCAP/CCAP) */
-       int _text_count[static_cast<int>(TextType::COUNT)];
+       EnumIndexedVector<int, TextType> _text_count;
        boost::optional<dcp::LanguageTag> _open_subtitle_language;
        /** the DCPTextTracks for each of our CCAPs */
        std::vector<DCPTextTrack> _dcp_text_tracks;
@@ -190,7 +195,7 @@ private:
        bool _kdm_valid = false;
        boost::optional<dcp::Standard> _standard;
        bool _three_d = false;
-       dcp::ContentKind _content_kind;
+       boost::optional<dcp::ContentKind> _content_kind;
        std::string _cpl;
        std::list<int64_t> _reel_lengths;
        std::map<dcp::Marker, dcp::Time> _markers;
@@ -199,4 +204,5 @@ private:
        bool _has_atmos = false;
        Frame _atmos_length = 0;
        dcp::Fraction _atmos_edit_rate;
+       std::vector<std::vector<std::shared_ptr<dcpomatic::Font>>> _fonts;
 };