Beispiel #1
0
        /// <summary>
        ///    Reads the file with a specified read style.
        /// </summary>
        /// <param name="propertiesStyle">
        ///    A <see cref="ReadStyle" /> value specifying at what level
        ///    of accuracy to read the media properties, or <see
        ///    cref="ReadStyle.None" /> to ignore the properties.
        /// </param>
        private void Read(ReadStyle propertiesStyle)
        {
            Mode = AccessMode.Read;
            try {
                tag = new Tag(this);

                // Read the tags and property data at the beginning of
                // the file.
                InvariantStartPosition = tag.ReadStart();
                TagTypesOnDisk        |= StartTag.TagTypes;
                ReadStart(InvariantStartPosition, propertiesStyle);

                // Read the tags and property data at the end of the
                // file.
                InvariantEndPosition =
                    (InvariantStartPosition == Length) ?
                    Length : tag.ReadEnd();
                TagTypesOnDisk |= EndTag.TagTypes;
                ReadEnd(InvariantEndPosition, propertiesStyle);

                // Read the audio properties.
                properties = (propertiesStyle != ReadStyle.None) ?
                             ReadProperties(InvariantStartPosition,
                                            InvariantEndPosition, propertiesStyle) :
                             null;
            } finally {
                Mode = AccessMode.Closed;
            }
        }
Beispiel #2
0
 private void Read(ReadStyle propertiesStyle)
 {
     Mode = AccessMode.Read;
     try
     {
         tag = new Tag(this);
         InvariantStartPosition = tag.ReadStart();
         TagTypesOnDisk        |= StartTag.TagTypes;
         ReadStart(InvariantStartPosition, propertiesStyle);
         InvariantEndPosition = (InvariantStartPosition == Length)?Length:tag.ReadEnd();
         TagTypesOnDisk      |= EndTag.TagTypes;
         ReadEnd(InvariantEndPosition, propertiesStyle);
         properties = (propertiesStyle != ReadStyle.None)?ReadProperties(InvariantStartPosition, InvariantEndPosition, propertiesStyle):null;
     }
     finally
     {
         Mode = AccessMode.Closed;
     }
 }
Beispiel #3
0
 private void Read(ReadStyle propertiesStyle)
 {
     base.Mode = TagLib.File.AccessMode.Read;
     try
     {
         this.tag = new TagLib.NonContainer.Tag(this);
         base.InvariantStartPosition = this.tag.ReadStart();
         base.TagTypesOnDisk |= this.StartTag.TagTypes;
         this.ReadStart(base.InvariantStartPosition, propertiesStyle);
         base.InvariantEndPosition = (base.InvariantStartPosition != base.Length) ? this.tag.ReadEnd() : base.Length;
         base.TagTypesOnDisk |= this.EndTag.TagTypes;
         this.ReadEnd(base.InvariantEndPosition, propertiesStyle);
         this.properties = (propertiesStyle == ReadStyle.None) ? null : this.ReadProperties(base.InvariantStartPosition, base.InvariantEndPosition, propertiesStyle);
     }
     finally
     {
         base.Mode = TagLib.File.AccessMode.Closed;
     }
 }
Beispiel #4
0
		/// <summary>
		///    Reads the file with a specified read style.
		/// </summary>
		/// <param name="propertiesStyle">
		///    A <see cref="ReadStyle" /> value specifying at what level
		///    of accuracy to read the media properties, or <see
		///    cref="ReadStyle.None" /> to ignore the properties.
		/// </param>
		private void Read (ReadStyle propertiesStyle)
		{
			Mode = AccessMode.Read;
			try {
				tag = new Tag (this);
				
				// Read the tags and property data at the beginning of
				// the file.
				InvariantStartPosition = tag.ReadStart ();
				TagTypesOnDisk |= StartTag.TagTypes;
				ReadStart (InvariantStartPosition, propertiesStyle);
				
				// Read the tags and property data at the end of the
				// file.
				InvariantEndPosition =
					(InvariantStartPosition == Length) ?
					Length : tag.ReadEnd ();
				TagTypesOnDisk |= EndTag.TagTypes;
				ReadEnd (InvariantEndPosition, propertiesStyle);
				
				// Read the audio properties.
				properties = (propertiesStyle != ReadStyle.None) ?
					ReadProperties (InvariantStartPosition,
						InvariantEndPosition, propertiesStyle) :
					null;
			} finally {
				Mode = AccessMode.Closed;
			}
		}