Use a typedef for a note-taking functor.
[libdcp.git] / src / mxf.cc
index 6709af4c57a8625f97f1f3d5c15b3fc6669b9eeb..442eb696b62cc347d86031dde771e0822dc7955a 100644 (file)
@@ -29,6 +29,7 @@
 #include "util.h"
 #include "metadata.h"
 #include "exceptions.h"
+#include "dcp_assert.h"
 #include "compose.hpp"
 #include <libxml++/nodes/element.h>
 #include <boost/filesystem.hpp>
@@ -79,7 +80,7 @@ MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, Standard standard)
        }
        unsigned int c;
        Kumu::hex2bin (_id.c_str(), writer_info->AssetUUID, Kumu::UUID_Length, &c);
-       assert (c == Kumu::UUID_Length);
+       DCP_ASSERT (c == Kumu::UUID_Length);
 
        if (_key) {
                Kumu::GenRandomUUID (writer_info->ContextID);
@@ -87,12 +88,12 @@ MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, Standard standard)
 
                unsigned int c;
                Kumu::hex2bin (_key_id.c_str(), writer_info->CryptographicKeyID, Kumu::UUID_Length, &c);
-               assert (c == Kumu::UUID_Length);
+               DCP_ASSERT (c == Kumu::UUID_Length);
        }
 }
 
 bool
-MXF::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+MXF::equals (shared_ptr<const Asset> other, EqualityOptions opt, NoteHandler note) const
 {
        if (!Content::equals (other, opt, note)) {
                return false;
@@ -114,9 +115,11 @@ MXF::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function
        }
 
        if (_file != other_mxf->file ()) {
-               note (DCP_ERROR, "MXF: names differ");
                if (!opt.mxf_names_can_differ) {
+                       note (DCP_ERROR, "MXF: names differ");
                        return false;
+               } else {
+                       note (DCP_NOTE, "MXF: names differ");
                }
        }
        
@@ -173,6 +176,6 @@ MXF::pkl_type (Standard standard) const
        case SMPTE:
                return "application/mxf";
        default:
-               assert (false);
+               DCP_ASSERT (false);
        }
 }