/// <summary>
        /// Read a list of keys
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="categoryName"></param>
        /// <returns></returns>
        protected UInt32 ReadKeyList(MXFReader reader, string categoryName, string singleItem)
        {
            MXFObject keylist = reader.ReadKeyList(categoryName, singleItem);

            this.AddChild(keylist);
            return((UInt32)keylist.ChildCount);
        }
示例#2
0
        public MXFPartition(MXFReader reader, MXFKLV headerKLV)
            : base(headerKLV, "Partition", KeyType.Partition)
        {
            this.m_eType = MXFObjectType.Partition;

            // Determine the partition type
            switch (this.Key[13])
            {
            case 2: this.PartitionType = PartitionType.Header; break;

            case 3: this.PartitionType = PartitionType.Body; break;

            case 4: this.PartitionType = PartitionType.Footer; break;

            default:
                this.PartitionType = PartitionType.Unknown;
                Log(MXFLogType.Error, "unknown partition type");
                break;
            }

            this.Closed   = (this.PartitionType == PartitionType.Footer) || (this.Key[14] & 0x01) == 0x00;
            this.Complete = (this.Key[14] > 2);

            // Make sure we read at the data position
            reader.Seek(this.DataOffset);

            reader.ReadD();             // Skip 4 bytes

            this.KagSize           = reader.ReadD();
            this.ThisPartition     = reader.ReadL();
            this.PreviousPartition = reader.ReadL();
            this.FooterPartition   = reader.ReadL();
            this.HeaderByteCount   = reader.ReadL();
            this.IndexByteCount    = reader.ReadL();
            this.IndexSID          = reader.ReadD();
            this.BodyOffset        = reader.ReadL();
            this.BodySID           = reader.ReadD();

            this.OP = new MXFKey(reader, 16);

            MXFObject essenceContainers = reader.ReadKeyList("Essence Containers", "Essence Container");

            this.AddChild(essenceContainers);
        }