Use an enum class for Marker.
[libdcp.git] / src / reel_subtitle_asset.h
index 976ff56d2d976adbf83268ef998fa4bf6b4b0730..8c3b7d185cad946a7a91f05cc7f091d3c741ae74 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
 #ifndef LIBDCP_REEL_SUBTITLE_ASSET_H
 #define LIBDCP_REEL_SUBTITLE_ASSET_H
 
+#include "language_tag.h"
 #include "reel_asset.h"
 #include "reel_mxf.h"
 #include "subtitle_asset.h"
 
+struct verify_test26;
+
 namespace dcp {
 
 class SubtitleAsset;
@@ -52,18 +55,33 @@ class SubtitleAsset;
 class ReelSubtitleAsset : public ReelAsset, public ReelMXF
 {
 public:
-       ReelSubtitleAsset (boost::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
-       explicit ReelSubtitleAsset (boost::shared_ptr<const cxml::Node>);
+       ReelSubtitleAsset (std::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point);
+       explicit ReelSubtitleAsset (std::shared_ptr<const cxml::Node>);
 
-       void write_to_cpl (xmlpp::Node* node, Standard standard) const;
+       xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
+       bool equals (std::shared_ptr<const ReelSubtitleAsset>, EqualityOptions, NoteHandler) const;
 
-       boost::shared_ptr<SubtitleAsset> asset () const {
+       std::shared_ptr<SubtitleAsset> asset () const {
                return asset_of_type<SubtitleAsset> ();
        }
 
+       void set_language (dcp::LanguageTag language);
+
+       boost::optional<std::string> language () const {
+               return _language;
+       }
+
 private:
+       friend struct ::verify_test26;
+
        std::string key_type () const;
        std::string cpl_node_name (Standard standard) const;
+
+       /** As in other places, this is stored and returned as a string so that
+        *  we can tolerate non-RFC-5646 strings, but must be set as a dcp::LanguageTag
+        *  to try to ensure that we create compliant output.
+        */
+       boost::optional<std::string> _language;
 };
 
 }