////////////////////////////////////////////////////////////////////////// // 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(); } }
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 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(); } }
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"); }