////////////////////////////////////////////////////////////////////////// // public methods ////////////////////////////////////////////////////////////////////////// public AsfStreamPropertiesObject(AsfFile file, long position) : base(file, position) { if (file != null) { if (!Guid.Equals(AsfGuid.AsfStreamPropertiesObject)) { throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); } if (OriginalSize < 78) { throw new TagLibException(TagLibError.AsfObjectSizeTooSmall); } stream_type = file.ReadGuid(); error_correction_type = file.ReadGuid(); time_offset = file.ReadQWord(); int type_specific_data_length = (int)file.ReadDWord(); int error_correction_data_length = (int)file.ReadDWord(); flags = file.ReadWord(); reserved = file.ReadDWord(); type_specific_data = file.ReadBlock(type_specific_data_length); error_correction_data = file.ReadBlock(error_correction_data_length); } }
public AsfFilePropertiesObject(AsfFile file, long position) : base(file, position) { if (file != null) { if (!Guid.Equals(AsfGuid.AsfFilePropertiesObject)) { throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); } if (OriginalSize < 104) { throw new TagLibException(TagLibError.AsfObjectSizeTooSmall); } fileId = file.ReadGuid(); fileSize = file.ReadQWord(); creationDate = file.ReadQWord(); dataPacketsCount = file.ReadQWord(); playDuration = file.ReadQWord(); sendDuration = file.ReadQWord(); preRoll = file.ReadQWord(); flags = file.ReadDWord(); minimumDataPacketSize = file.ReadDWord(); maximumDataPacketSize = file.ReadDWord(); maximumBitrate = file.ReadDWord(); } }
public AsfHeaderObject(AsfFile file, long position) : base(file, position) { if (!Guid.Equals(AsfGuid.AsfHeaderObject)) throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); uint childCount = file.ReadDWord(); children = new List<AsfObject>((int)childCount); reserved = file.ReadBlock(2); foreach(AsfObject childObject in file.ReadObjects(childCount, file.Tell)) children.Add(childObject); //children.AddRange(file.ReadObjects(childCount, file.Tell)); }
protected bool Parse(AsfFile file) { if (file != null) { int size = file.ReadWord(); name = file.ReadUnicode(size); type = (AsfDataType)file.ReadWord(); size = file.ReadWord(); switch (type) { case AsfDataType.Word: lValue = file.ReadWord(); break; case AsfDataType.Bool: lValue = file.ReadDWord(); break; case AsfDataType.DWord: lValue = file.ReadDWord(); break; case AsfDataType.QWord: lValue = file.ReadQWord(); break; case AsfDataType.Unicode: sValue = file.ReadUnicode(size); break; case AsfDataType.Bytes: bvValue = file.ReadBlock(size); break; default: return(false); } return(true); } else { throw new ArgumentNullException("file"); } }
public AsfHeaderObject(AsfFile file, long position) : base(file, position) { if (!Guid.Equals(AsfGuid.AsfHeaderObject)) { throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); } uint childCount = file.ReadDWord(); children = new List <AsfObject>((int)childCount); reserved = file.ReadBlock(2); foreach (AsfObject childObject in file.ReadObjects(childCount, file.Tell)) { children.Add(childObject); } //children.AddRange(file.ReadObjects(childCount, file.Tell)); }
public AsfExtendedContentDescriptionObject(AsfFile file, long position) : base(file, position) { if (file != null) { if (!Guid.Equals(AsfGuid.AsfExtendedContentDescriptionObject)) throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); if (OriginalSize < 26) throw new TagLibException(TagLibError.AsfObjectSizeTooSmall); short count = file.ReadWord(); for (short i = 0; i < count; i++) { AsfContentDescriptor descriptor = new AsfContentDescriptor(file); descriptors.Add(descriptor); } } }
////////////////////////////////////////////////////////////////////////// // public methods ////////////////////////////////////////////////////////////////////////// public AsfStreamPropertiesObject (AsfFile file, long position) : base (file, position) { if (file != null) { if (!Guid.Equals (AsfGuid.AsfStreamPropertiesObject)) throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); if (OriginalSize < 78) throw new TagLibException(TagLibError.AsfObjectSizeTooSmall); stream_type = file.ReadGuid(); error_correction_type = file.ReadGuid(); time_offset = file.ReadQWord (); int type_specific_data_length = (int)file.ReadDWord(); int error_correction_data_length = (int)file.ReadDWord(); flags = file.ReadWord(); reserved = file.ReadDWord(); type_specific_data = file.ReadBlock(type_specific_data_length); error_correction_data = file.ReadBlock(error_correction_data_length); } }
public AsfExtendedContentDescriptionObject(AsfFile file, long position) : base(file, position) { if (file != null) { if (!Guid.Equals(AsfGuid.AsfExtendedContentDescriptionObject)) { throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); } if (OriginalSize < 26) { throw new TagLibException(TagLibError.AsfObjectSizeTooSmall); } short count = file.ReadWord(); for (short i = 0; i < count; i++) { AsfContentDescriptor descriptor = new AsfContentDescriptor(file); descriptors.Add(descriptor); } } }
public AsfFilePropertiesObject(AsfFile file, long position) : base(file, position) { if (file != null) { if (!Guid.Equals(AsfGuid.AsfFilePropertiesObject)) throw new TagLibException(TagLibError.AsfObjectGuidIncorrect); if (OriginalSize < 104) throw new TagLibException(TagLibError.AsfObjectSizeTooSmall); fileId = file.ReadGuid(); fileSize = file.ReadQWord(); creationDate = file.ReadQWord(); dataPacketsCount = file.ReadQWord(); playDuration = file.ReadQWord(); sendDuration = file.ReadQWord(); preRoll = file.ReadQWord(); flags = file.ReadDWord(); minimumDataPacketSize = file.ReadDWord(); maximumDataPacketSize = file.ReadDWord(); maximumBitrate = file.ReadDWord(); } }
protected bool Parse(AsfFile file) { if (file != null) { int size = file.ReadWord(); name = file.ReadUnicode(size); type = (AsfDataType)file.ReadWord(); size = file.ReadWord(); switch (type) { case AsfDataType.Word: lValue = file.ReadWord(); break; case AsfDataType.Bool: lValue = file.ReadDWord(); break; case AsfDataType.DWord: lValue = file.ReadDWord(); break; case AsfDataType.QWord: lValue = file.ReadQWord(); break; case AsfDataType.Unicode: sValue = file.ReadUnicode(size); break; case AsfDataType.Bytes: bvValue = file.ReadBlock(size); break; default: return false; } return true; } else throw new ArgumentNullException("file"); }
protected internal AsfContentDescriptor(AsfFile file) : this() { Parse(file); }