예제 #1
0
        //////////////////////////////////////////////////////////////////////////
        // 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);
            }
        }
예제 #2
0
 public override bool Equals(object obj)
 {
     if (obj is AsfGuid)
     {
         AsfGuid otherGuid = (AsfGuid)obj;
         return(this == otherGuid);
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
        public AsfObject[] ReadObjects(uint count, long position)
        {
            ArrayList l = new ArrayList();

            for (int i = 0; i < (int)count; i++)
            {
                Seek(position);
                AsfGuid id = ReadGuid();

                AsfObject obj;

                if (id.Equals(AsfGuid.AsfFilePropertiesObject))
                {
                    obj = new AsfFilePropertiesObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfStreamPropertiesObject))
                {
                    obj = new AsfStreamPropertiesObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfContentDescriptionObject))
                {
                    obj = new AsfContentDescriptionObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfExtendedContentDescriptionObject))
                {
                    obj = new AsfExtendedContentDescriptionObject(this, position);
                }
                else if (id.Equals(AsfGuid.AsfPaddingObject))
                {
                    obj = new AsfPaddingObject(this, position);
                }
                else
                {
                    obj = new AsfUnknownObject(this, position);
                }

                l.Add(obj);
                position += obj.OriginalSize;
            }

            return((AsfObject[])l.ToArray(typeof(AsfObject)));
        }
      //////////////////////////////////////////////////////////////////////////
      // 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);
			}
		}