Update copyright date.
[asdcplib.git] / src / MXF.h
index da7b92f2d570204b8fa5230fa5d6ccecca47c77f..f3c244907af75ba2fe6a7b70fa53b015b5e0c2a2 100755 (executable)
--- a/src/MXF.h
+++ b/src/MXF.h
@@ -40,6 +40,16 @@ namespace ASDCP
     {
       class InterchangeObject;
 
+      //
+      typedef ASDCP::MXF::InterchangeObject* (*MXFObjectFactory_t)();
+
+      //
+      void SetObjectFactory(UL label, MXFObjectFactory_t factory);
+
+      //
+      InterchangeObject* CreateObject(const byte_t* label);
+
+
       // seek an open file handle to the start of the RIP KLV packet
       Result_t SeekToRIP(const Kumu::FileReader&);
       
@@ -64,7 +74,7 @@ namespace ASDCP
 
              inline const char* EncodeString(char* str_buf, ui32_t buf_len) const {
                Kumu::ui64Printer offset_str(ByteOffset);
-               snprintf(str_buf, buf_len, "%-6lu: %s", BodySID, offset_str.c_str());
+               snprintf(str_buf, buf_len, "%-6u: %s", BodySID, offset_str.c_str());
                return str_buf;
              }
 
@@ -89,6 +99,7 @@ namespace ASDCP
          virtual ~RIP() {}
          virtual Result_t InitFromFile(const Kumu::FileReader& Reader);
          virtual Result_t WriteToFile(Kumu::FileWriter& Writer);
+         virtual Result_t GetPairBySID(ui32_t, Pair&) const;
          virtual void     Dump(FILE* = 0);
        };
 
@@ -200,9 +211,6 @@ namespace ASDCP
          virtual void     Dump(FILE* stream = 0);
        };
 
-      //
-      InterchangeObject* CreateObject(const byte_t* label);
-
       //
       class Preface : public InterchangeObject
        {
@@ -259,6 +267,9 @@ namespace ASDCP
              i8_t               KeyFrameOffset;
              ui8_t              Flags;
              ui64_t             StreamOffset;
+
+             // if you use these, you will need to change CBRIndexEntriesPerSegment in MXF.cpp
+             // to a more suitable value
              //              std::list<ui32_t>  SliceOffset;
              //              Array<Rational>    PosTable;
 
@@ -290,7 +301,6 @@ namespace ASDCP
 
       //---------------------------------------------------------------------------------
       //
-      class h__PacketList; // See MXF.cpp
       class Identification;
       class SourcePackage;
 
@@ -311,7 +321,9 @@ namespace ASDCP
          virtual Result_t InitFromFile(const Kumu::FileReader& Reader);
          virtual Result_t WriteToFile(Kumu::FileWriter& Writer, ui32_t HeaderLength = 16384);
          virtual void     Dump(FILE* = 0);
+         virtual Result_t GetMDObjectByID(const UUID&, InterchangeObject** = 0);
          virtual Result_t GetMDObjectByType(const byte_t*, InterchangeObject** = 0);
+         virtual Result_t GetMDObjectsByType(const byte_t* ObjectID, std::list<InterchangeObject*>& ObjectList);
          Identification*  GetIdentification();
          SourcePackage*   GetSourcePackage();
        };
@@ -327,7 +339,7 @@ namespace ASDCP
          ASDCP_NO_COPY_CONSTRUCT(OPAtomIndexFooter);
 
        public:
-         fpos_t              m_ECOffset;
+         Kumu::fpos_t        m_ECOffset;
          IPrimerLookup*      m_Lookup;
         
          OPAtomIndexFooter();
@@ -336,10 +348,10 @@ namespace ASDCP
          virtual Result_t WriteToFile(Kumu::FileWriter& Writer, ui64_t duration);
          virtual void     Dump(FILE* = 0);
 
-         virtual Result_t Lookup(ui32_t frame_num, IndexTableSegment::IndexEntry&);
+         virtual Result_t Lookup(ui32_t frame_num, IndexTableSegment::IndexEntry&) const;
          virtual void     PushIndexEntry(const IndexTableSegment::IndexEntry&);
          virtual void     SetIndexParamsCBR(IPrimerLookup* lookup, ui32_t size, const Rational& Rate);
-         virtual void     SetIndexParamsVBR(IPrimerLookup* lookup, const Rational& Rate, fpos_t offset);
+         virtual void     SetIndexParamsVBR(IPrimerLookup* lookup, const Rational& Rate, Kumu::fpos_t offset);
        };
 
     } // namespace MXF