using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace MatrixIO.IO.Bmff.Boxes { /// /// Item Protection Box ("ipro") /// [Box("ipro", "Item Protection Box")] public class ItemProtectionBox : FullBox, ISuperBox { public ItemProtectionBox() : base() { } public ItemProtectionBox(Stream stream) : base(stream) { } internal override ulong CalculateSize() { return base.CalculateSize() + 2; } protected override void LoadFromStream(System.IO.Stream stream) { base.LoadFromStream(stream); ProtectionCount = stream.ReadBEUInt16(); } protected override void SaveToStream(System.IO.Stream stream) { base.SaveToStream(stream); stream.WriteBEUInt16((ushort)Children.Count); } private IList _Children = Portability.CreateList(); public IList Children { get { return _Children; } } public IEnumerator GetEnumerator() { return Children.GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return Children.GetEnumerator(); } private ushort ProtectionCount { get; set; } /* public IEnumerable ProtectionInformation { get { return from c in Children where c is ProtectionSchemeInfoBox select (ProtectionSchemeInfoBox)c; } } */ } }