Cleanup: make things a little clearer.
[dcpomatic.git] / src / lib / dcp_examiner.h
index ac43805977c98f75d5cc9eea1a0c6e94a8871c64..75ea8b68c664176d8aa6072063c272fee74e1da7 100644 (file)
@@ -106,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 {
@@ -131,7 +131,8 @@ public:
        }
 
        dcp::ContentKind content_kind () const {
-               return _content_kind;
+               DCPOMATIC_ASSERT(_content_kind);
+               return *_content_kind;
        }
 
        std::string cpl () const {
@@ -185,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;
@@ -194,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;