• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ReadStyle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GeoInfo

 private GeoInfo()
 {
     this.m_CurrentReadStyle = ReadStyle.ClosestResolution;
     this.m_ClutterlayerIndex = 0;
     this.m_geoClutterCalcBound = null;
     this.m_HeightlayerIndex = 0;
     this.m_geoHeightCalcBound = null;
     this.m_BuildinglayerIndex = 0;
     this.m_geoBuildingCalcBound = null;
     this.pointThreadTag = new object();
     this.lineThreadTag = new object();
     this.boundThreadTag = new object();
     this.m_IsGeoXYLinePointCalc = false;
     this.m_ClutterIDInLine = null;
     this.m_PointListOfClutterID = null;
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:16,代码来源:GeoInfo.cs


示例17: OggVorbisFile

      //////////////////////////////////////////////////////////////////////////
      // public methods
      //////////////////////////////////////////////////////////////////////////
		public OggVorbisFile (string file, ReadStyle properties_style) : base (file)
		{
			//comment = null;
			//properties = null;
         
			try
			{
				Mode = FileAccessMode.Read;
			}
			catch (TagLibException)
			{
				return;
			}
         
			Read(properties_style);
         
			Mode = FileAccessMode.Closed;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:21,代码来源:OggVorbisFile.cs


示例18: AsfFile

		public AsfFile(string file, ReadStyle propertiesStyle) : base(file)
		{
			//asfTag = null;
			//properties = null;

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

			Read(propertiesStyle);

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


示例19: WavPackFile

		public WavPackFile(string file, ReadStyle propertiesStyle) : base(file)
		{
			//apeTag        = null;
			//id3v1Tag      = null;
			tag = new CombinedTag();
			//properties     = null;

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

			Read(propertiesStyle);

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


示例20: File

		public File (File.IFileAbstraction abstraction,
		             ReadStyle propertiesStyle) : base (abstraction)
		{
			uint riff_size;
			long tag_start, tag_end;

			Mode = AccessMode.Read;
			try {
				Read (true, propertiesStyle, out riff_size,
					out tag_start, out tag_end);
			} finally {
				Mode = AccessMode.Closed;
			}

			TagTypesOnDisk = TagTypes;

			GetTag (TagTypes.Id3v2, true);
			GetTag (TagTypes.RiffInfo, true);
			GetTag (TagTypes.MovieId, true);
			GetTag (TagTypes.DivX, true);
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:21,代码来源:File.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ReadType类代码示例发布时间:2022-05-24
下一篇:
C# ReadState类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap