当前位置: 首页>>代码示例>>C#>>正文


C# ReadStyle类代码示例

本文整理汇总了C#中ReadStyle的典型用法代码示例。如果您正苦于以下问题:C# ReadStyle类的具体用法?C# ReadStyle怎么用?C# ReadStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ReadStyle类属于命名空间,在下文中一共展示了ReadStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadStart

 protected override void ReadStart(long start, ReadStyle propertiesStyle)
 {
     if ((propertiesStyle != ReadStyle.None) && !AudioHeader.Find(out this.first_header, this, start, 0x4000))
     {
         throw new CorruptFileException("MPEG audio header not found.");
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:7,代码来源:AudioFile.cs

示例2: FlacFile

		public FlacFile(string file, ReadStyle propertiesStyle) : base (file)
		{
			//id3v2Tag           = null;
			//id3v1Tag           = null;
			//comment             = null;
			//properties          = null;
			//flac_start          = 0;
			//stream_start        = 0;
			//stream_length       = 0;
			//scanned             = false;
			tag = new CombinedTag();
         
			try
			{
				Mode = FileAccessMode.Read;
			}
			catch (TagLibException)
			{
				return;
			}
         
			Read(propertiesStyle);
         
			Mode = FileAccessMode.Closed;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:25,代码来源:FlacFile.cs

示例3: OggFlacFile

		protected OggFlacFile(string file, ReadStyle propertiesStyle) : base(file)
		{
			//comment = null;
			//properties = null;
			//stream_info_data = null;
			//xiph_comment_data = null;
			//stream_start = 0;
			//stream_length = 0;
			//scanned = false;
			//has_xiph_comment = false;
			//comment_packet = 0;

			try
			{
				Mode = FileAccessMode.Read;
			}
			catch (TagLibException)
			{
				scanned = true;
				return;
			}

			Read(propertiesStyle);

			Mode = FileAccessMode.Closed;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:26,代码来源:OggFlacFile.cs

示例4: AsfProperties

		public AsfProperties(AsfHeaderObject header, ReadStyle style) : base(style)
		{
			duration = TimeSpan.Zero;
			//codecId = 0;
			//channels = 0;
			//sampleRate = 0;
			//bytesPerSecond = 0;

			foreach (AsfObject obj in header.Children)
			{
				if (obj is AsfFilePropertiesObject)
					duration = ((AsfFilePropertiesObject)obj).PlayDuration;

				if (obj is AsfStreamPropertiesObject && bytesPerSecond == 0)
				{
					AsfStreamPropertiesObject stream = (AsfStreamPropertiesObject)obj;

					if (!stream.StreamType.Equals(AsfGuid.AsfAudioMedia))
						continue;

					ByteVector data = stream.TypeSpecificData;

					codecId = data.Mid(0, 2).ToShort(false);
					channels = data.Mid(2, 2).ToShort(false);
					sampleRate = data.Mid(4, 4).ToUInt(false);
					bytesPerSecond = data.Mid(8, 4).ToUInt(false);
				}
			}
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:29,代码来源:AsfProperties.cs

示例5: File

        /// <summary>
        ///    Constructs and initializes a new instance of <see
        ///    cref="File" /> for a specified file abstraction and
        ///    specified read style.
        /// </summary>
        /// <param name="abstraction">
        ///    A <see cref="File.IFileAbstraction" /> object to use when
        ///    reading from and writing to the file.
        /// </param>
        /// <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>
        /// <exception cref="ArgumentNullException">
        ///    <paramref name="abstraction" /> is <see langword="null"
        ///    />.
        /// </exception>
        public File(File.IFileAbstraction abstraction,
		             ReadStyle propertiesStyle)
            : base(abstraction)
        {
            Magic = 85; // Panasonic uses 0x55
            Read (propertiesStyle);
        }
开发者ID:Sirais,项目名称:taglib-sharp-portable,代码行数:25,代码来源:File.cs

示例6: ReadStart

 protected override void ReadStart(long start, ReadStyle propertiesStyle)
 {
     if ((this.header_block == null) || (propertiesStyle != ReadStyle.None))
     {
         base.Seek(start);
         this.header_block = base.ReadBlock(0x20);
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:8,代码来源:File.cs

示例7: Read

		private void Read(ReadStyle propertiesStyle)
		{
			AsfHeaderObject header = new AsfHeaderObject(this, 0);

			asfTag = new AsfTag(header);

			if (propertiesStyle != ReadStyle.None)
				properties = new AsfProperties(header, propertiesStyle);
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:9,代码来源:AsfFile.cs

示例8: FlacProperties

		public FlacProperties(ByteVector data, long streamLength, ReadStyle style) : base(style)
		{
			duration = TimeSpan.Zero;
			//bitrate      = 0;
			//sample_rate  = 0;
			//sample_width = 0;
			//channels     = 0;

			Read(data, streamLength); // the old version of this had style as the third parameter
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:10,代码来源:FlacProperties.cs

示例9: Read

 private void Read(bool read_tags, ReadStyle style, out uint aiff_size, out long tag_start, out long tag_end)
 {
     base.Seek(0L);
     if (base.ReadBlock(4) != FileIdentifier)
     {
         throw new CorruptFileException("File does not begin with AIFF identifier");
     }
     aiff_size = base.ReadBlock(4).ToUInt(true);
     tag_start = -1L;
     tag_end = -1L;
     if ((this.header_block == null) && (style != ReadStyle.None))
     {
         long offset = base.Find(CommIdentifier, 0L);
         if (offset == -1L)
         {
             throw new CorruptFileException("No Common chunk available in AIFF file.");
         }
         base.Seek(offset);
         this.header_block = base.ReadBlock(0x1a);
         StreamHeader header = new StreamHeader(this.header_block, (long) ((ulong) aiff_size));
         ICodec[] codecs = new ICodec[] { header };
         this.properties = new TagLib.Properties(TimeSpan.Zero, codecs);
     }
     long num2 = -1L;
     if (base.Find(SoundIdentifier, 0L, ID3Identifier) == -1L)
     {
         num2 = base.Find(ID3Identifier, 0L);
     }
     long num3 = base.Find(SoundIdentifier, 0L);
     if (num3 == -1L)
     {
         throw new CorruptFileException("No Sound chunk available in AIFF file.");
     }
     base.Seek(num3 + 4L);
     long startPosition = (((long) base.ReadBlock(4).ToULong(true)) + num3) + 4L;
     if (num2 == -1L)
     {
         num2 = base.Find(ID3Identifier, startPosition);
     }
     if (num2 > -1L)
     {
         if (read_tags && (this.tag == null))
         {
             this.tag = new TagLib.Id3v2.Tag(this, num2 + 8L);
         }
         base.Seek(num2 + 4L);
         uint num6 = base.ReadBlock(4).ToUInt(true) + 8;
         long num7 = num2;
         base.InvariantStartPosition = num7;
         tag_start = num7;
         num7 = tag_start + num6;
         base.InvariantEndPosition = num7;
         tag_end = num7;
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:55,代码来源:File.cs

示例10: File

		public File (File.IFileAbstraction abstraction,
		             ReadStyle propertiesStyle) : base (abstraction)
		{
			Mode = AccessMode.Read;
			try {
				tag = new GroupedComment ();
				Read (propertiesStyle);
				TagTypesOnDisk = TagTypes;
			} finally {
				Mode = AccessMode.Closed;
			}
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:12,代码来源:File.cs

示例11: OggVorbisProperties

		public OggVorbisProperties(OggVorbisFile file, ReadStyle style) : base(style)
		{
			duration = TimeSpan.Zero;
			//bitrate         = 0;
			//sample_rate     = 0;
			//channels        = 0;
			//vorbis_version  = 0;
			//bitrate_maximum = 0;
			//bitrate_nominal = 0;
			//bitrate_minimum = 0;

			Read(file); // the old version of this had style as the second parameter
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:13,代码来源:OggVorbisProperties.cs

示例12: File

        /// <summary>
        ///    Constructs and initializes a new instance of <see
        ///    cref="File" /> for a specified file abstraction and
        ///    specified read style.
        /// </summary>
        /// <param name="abstraction">
        ///    A <see cref="File.IFileAbstraction" /> object to use when
        ///    reading from and writing to the file.
        /// </param>
        /// <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>
        /// <exception cref="ArgumentNullException">
        ///    <paramref name="abstraction" /> is <see langword="null"
        ///    />.
        /// </exception>
        public File(File.IFileAbstraction abstraction,
		             ReadStyle propertiesStyle)
            : base(abstraction)
        {
            ImageTag = new CombinedImageTag (TagTypes.TiffIFD | TagTypes.XMP);

            Mode = AccessMode.Read;
            try {
                Read (propertiesStyle);
                TagTypesOnDisk = TagTypes;
            } finally {
                Mode = AccessMode.Closed;
            }
        }
开发者ID:Sirais,项目名称:taglib-sharp-portable,代码行数:32,代码来源:File.cs

示例13: File

 public File(TagLib.File.IFileAbstraction abstraction, ReadStyle propertiesStyle) : base(abstraction)
 {
     base.Mode = TagLib.File.AccessMode.Read;
     try
     {
         this.tag = new GroupedComment();
         this.Read(propertiesStyle);
         base.TagTypesOnDisk = base.TagTypes;
     }
     finally
     {
         base.Mode = TagLib.File.AccessMode.Closed;
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:14,代码来源:File.cs

示例14: File

		/// <summary>
		///    Constructs and initializes a new instance of <see
		///    cref="File" /> for a specified path in the local file
		///    system and specified read style.
		/// </summary>
		/// <param name="path">
		///    A <see cref="string" /> object containing the path of the
		///    file to use in the new instance.
		/// </param>
		/// <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>
		/// <exception cref="ArgumentNullException">
		///    <paramref name="path" /> is <see langword="null" />.
		/// </exception>
		public File (string path, ReadStyle propertiesStyle, CUETools.Processor.CUEToolsTagger _tagger)
			: base (path, propertiesStyle)
		{
			tagger = _tagger;
			// Make sure we have a tag.
			switch (tagger)
			{
				case CUETools.Processor.CUEToolsTagger.APEv2:
					GetTag(TagTypes.Ape, true);
					break;
				case CUETools.Processor.CUEToolsTagger.ID3v2:
					GetTag(TagTypes.Id3v2, true);
					break;
			}
		}
开发者ID:androidhacker,项目名称:DotNetProjs,代码行数:32,代码来源:UserDefined.cs

示例15: MpegProperties

 //////////////////////////////////////////////////////////////////////////
 // public methods
 //////////////////////////////////////////////////////////////////////////
 public MpegProperties (MpegFile file, ReadStyle style) : base (style)
 {
    this.file      = file;
    duration       = TimeSpan.Zero;
    //bitrate        = 0;
    //sample_rate    = 0;
    //channels       = 0;
    version        = MpegVersion.One;
    //layer          = 0;
    channel_mode   = MpegChannelMode.Stereo;
    //is_copyrighted = false;
    //is_original    = false;
    
    Read();
 }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:18,代码来源:MpegProperties.cs


注:本文中的ReadStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。