In-line run of subs_in_out so that it gets the environment more easily.
[libdcp.git] / src / reel_closed_caption_asset.cc
index 2bc5f3e063167b9701be32b1d5d7ab66f3ff55e8..e5649d6a407b3b331909c0ea33bf403d84852d6a 100644 (file)
  */
 
 
-#include "subtitle_asset.h"
+#include "dcp_assert.h"
 #include "reel_closed_caption_asset.h"
 #include "smpte_subtitle_asset.h"
-#include "dcp_assert.h"
+#include "subtitle_asset.h"
+#include "warnings.h"
+LIBDCP_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+LIBDCP_ENABLE_WARNINGS
 
 
 using std::string;
-using std::pair;
-using std::make_pair;
 using std::shared_ptr;
 using std::dynamic_pointer_cast;
-using boost::optional;
 using namespace dcp;
 
 
 ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr<SubtitleAsset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
-       : ReelAsset (asset->id(), edit_rate, intrinsic_duration, entry_point)
-       , ReelEncryptableAsset (asset, dynamic_pointer_cast<SMPTESubtitleAsset>(asset) ? dynamic_pointer_cast<SMPTESubtitleAsset>(asset)->key_id() : optional<string>())
+       : ReelFileAsset (
+               asset,
+               dynamic_pointer_cast<SMPTESubtitleAsset>(asset) ? dynamic_pointer_cast<SMPTESubtitleAsset>(asset)->key_id() : boost::none,
+               asset->id(),
+               edit_rate,
+               intrinsic_duration,
+               entry_point
+               )
 {
 
 }
 
 
 ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr<const cxml::Node> node)
-       : ReelAsset (node)
-       , ReelEncryptableAsset (node)
+       : ReelFileAsset (node)
 {
        _language = node->optional_string_child ("Language");
-       node->done ();
-}
-
-
-string
-ReelClosedCaptionAsset::cpl_node_name (Standard standard) const
-{
-       switch (standard) {
-       case Standard::INTEROP:
-               return "cc-cpl:MainClosedCaption";
-       case Standard::SMPTE:
-               return "tt:ClosedCaption";
-       }
-
-       DCP_ASSERT (false);
-}
-
-
-pair<string, string>
-ReelClosedCaptionAsset::cpl_node_namespace (Standard standard) const
-{
-       switch (standard) {
-       case Standard::INTEROP:
-               return make_pair ("http://www.digicine.com/PROTO-ASDCP-CC-CPL-20070926#", "cc-cpl");
-       case Standard::SMPTE:
-               return make_pair ("http://www.smpte-ra.org/schemas/429-12/2008/TT", "tt");
-       }
-
-       DCP_ASSERT (false);
-}
-
-
-string
-ReelClosedCaptionAsset::key_type () const
-{
-       return "MDSK";
-}
-
-
-xmlpp::Node *
-ReelClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
-{
-       auto asset = write_to_cpl_asset (node, standard, hash());
-       write_to_cpl_mxf (asset);
-
-       if (_language) {
-               switch (standard) {
-               case Standard::INTEROP:
-                       asset->add_child("Language")->add_child_text(*_language);
-                       break;
-               case Standard::SMPTE:
-                       asset->add_child("Language", "tt")->add_child_text(*_language);
-                       break;
-               }
-       }
-
-       return asset;
 }
 
 
 bool
-ReelClosedCaptionAsset::equals (shared_ptr<const ReelClosedCaptionAsset> other, EqualityOptions opt, NoteHandler note) const
+ReelClosedCaptionAsset::equals(shared_ptr<const ReelClosedCaptionAsset> other, EqualityOptions const& opt, NoteHandler note) const
 {
        if (!asset_equals (other, opt, note)) {
                return false;
        }
-       if (!mxf_equals (other, opt, note)) {
+       if (!file_asset_equals (other, opt, note)) {
                return false;
        }
 
        return true;
 }
+
+