Cleanup: move EqualityOptions into its own file.
[libdcp.git] / src / smpte_subtitle_asset.cc
index 4b2ae8cd40e8fd03bdac0dc84447b49a76bf9ea9..7e2bcb73abda0c42998cf42a81712b24dccd8ef5 100644 (file)
@@ -40,6 +40,7 @@
 #include "compose.hpp"
 #include "crypto_context.h"
 #include "dcp_assert.h"
+#include "equality_options.h"
 #include "exceptions.h"
 #include "raw_convert.h"
 #include "smpte_load_font_node.h"
@@ -238,9 +239,6 @@ SMPTESubtitleAsset::read_mxf_resources (shared_ptr<ASDCP::TimedText::MXFReader>
                char id[64];
                Kumu::bin2UUIDhex (i->ResourceID, ASDCP::UUIDlen, id, sizeof(id));
 
-               shared_array<uint8_t> data (new uint8_t[buffer.Size()]);
-               memcpy (data.get(), buffer.RoData(), buffer.Size());
-
                switch (i->Type) {
                case ASDCP::TimedText::MT_OPENTYPE:
                {
@@ -250,7 +248,7 @@ SMPTESubtitleAsset::read_mxf_resources (shared_ptr<ASDCP::TimedText::MXFReader>
                        }
 
                        if (j != _load_font_nodes.end ()) {
-                               _fonts.push_back (Font ((*j)->id, (*j)->urn, ArrayData (data, buffer.Size ())));
+                               _fonts.push_back(Font((*j)->id, (*j)->urn, ArrayData(buffer.RoData(), buffer.Size())));
                        }
                        break;
                }
@@ -262,7 +260,7 @@ SMPTESubtitleAsset::read_mxf_resources (shared_ptr<ASDCP::TimedText::MXFReader>
                        }
 
                        if (j != _subtitles.end()) {
-                               dynamic_pointer_cast<SubtitleImage>(*j)->set_png_image (ArrayData(data, buffer.Size()));
+                               dynamic_pointer_cast<SubtitleImage>(*j)->set_png_image(ArrayData(buffer.RoData(), buffer.Size()));
                        }
                        break;
                }
@@ -384,7 +382,7 @@ SMPTESubtitleAsset::xml_as_string () const
 
        subtitles_as_xml (root->add_child("SubtitleList"), _time_code_rate, Standard::SMPTE);
 
-       return format_xml(doc, { {"", schema_namespace()}, {"xs", "http://www.w3.org/2001/XMLSchema"} });
+       return format_xml(doc, std::make_pair(string{}, schema_namespace()));
 }
 
 
@@ -494,7 +492,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const
 }
 
 bool
-SMPTESubtitleAsset::equals (shared_ptr<const Asset> other_asset, EqualityOptions options, NoteHandler note) const
+SMPTESubtitleAsset::equals(shared_ptr<const Asset> other_asset, EqualityOptions const& options, NoteHandler note) const
 {
        if (!SubtitleAsset::equals (other_asset, options, note)) {
                return false;