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

C# IDecoder类代码示例

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

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



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

示例1: Deserialize

        public override void Deserialize(IDecoder inStream)
        {
            base.Deserialize(inStream);

            IsMore = inStream.ReadBoolFromInt();
            Value = inStream.ReadString();
        }
开发者ID:gyantal,项目名称:SQLab,代码行数:7,代码来源:OperatorCondition.cs


示例2: Deserialize

        public override void Deserialize(IDecoder inStream)
        {
            base.Deserialize(inStream);

            ConId = inStream.ReadInt();
            Exchange = inStream.ReadString();
        }
开发者ID:gyantal,项目名称:SQLab,代码行数:7,代码来源:ContractCondition.cs


示例3: StreamedAudioBuffer

        public StreamedAudioBuffer(IDecoder decoder)
        {
            if (decoder == null)
                throw new ArgumentNullException("decoder");

            Decoder = decoder;
        }
开发者ID:johang88,项目名称:triton,代码行数:7,代码来源:StreamedAudioBuffer.cs


示例4: Deserialize

        public override void Deserialize(IDecoder inStream)
        {
            base.Deserialize(inStream);

            SecType = inStream.ReadString();
            Exchange = inStream.ReadString();
            Symbol = inStream.ReadString();
        }
开发者ID:gyantal,项目名称:SQLab,代码行数:8,代码来源:ExecutionCondition.cs


示例5: ClassKey

		public ClassKey(IDecoder dec) {
			PackageName = dec.ReadStr8() ;
			ClassName = dec.ReadStr8() ;
			Hash[0] = dec.ReadUint32() ;
			Hash[1] = dec.ReadUint32() ;	
			Hash[2] = dec.ReadUint32() ;
			Hash[3] = dec.ReadUint32() ;
			
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:9,代码来源:ClassKey.cs


示例6: ExecutionUnitTests

        public ExecutionUnitTests()
        {
            _defaultStack = new Mock<Stack>(10).Object;

            var stopDecoderMock = new Mock<IDecoder>();
            stopDecoderMock.Setup(m => m.Decode(It.IsAny<UInt64>()))
                .Returns(new Instruction { Type = InstructionType.Stop });
            _stopDecoder = stopDecoderMock.Object;
        }
开发者ID:hkra,项目名称:Computer,代码行数:9,代码来源:ExecutionUnitTests.cs


示例7: SchemaArgument

		public SchemaArgument(IDecoder dec, bool methodArg)
		{
			Dictionary<string, Object> map = dec.ReadMap() ;	
			base.PopulateData(map) ;					
				
			if (map.ContainsKey("dir")) {
				Direction = (string) map["dir"] ;			
			}	
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:9,代码来源:SchemaArgument.cs


示例8: SchemaStatistic

		public SchemaStatistic(IDecoder dec)
		{
			Dictionary<string, Object> map = dec.ReadMap() ;							
			Name = (string)  map["name"] ;
			Type = (short) short.Parse(""+map["type"]) ;
				
			if (map.ContainsKey("unit")) {
				Unit = (string) map["unit"] ;			
			}
			if (map.ContainsKey("description")) {			
				Description = (string) map["description"] ;			
			}			
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:13,代码来源:SchemaStatistic.cs


示例9: SocketServer

 /// <summary>
 /// 使用默认配置参数的构造函数
 /// </summary>
 /// <param name="handler"></param>
 public SocketServer(IServerHandler handler,IEncoder encoder, IDecoder decoder)
     : base(DefaultConfigure.SocketBufferSize, DefaultConfigure.MessageBufferSize)
 {
     if (handler == null) throw new ArgumentNullException("handler");
     if (encoder == null) throw new ArgumentNullException("encoder");
     if (decoder == null) throw new ArgumentNullException("decoder");
     this._handler = handler;
     this._protocol = new DefaultBinaryProtocol();
     this._encoder = encoder;
     this._decoder = decoder;
     this._maxMessageSize = DefaultConfigure.MaxMessageSize;
     this._maxConnections = DefaultConfigure.MaxConnections;
 }
开发者ID:zhujunxxxxx,项目名称:FastNetwork,代码行数:17,代码来源:SocketServer.cs


示例10: QMFEvent

		public QMFEvent(Session session, IDecoder dec)
		{
			Session = session ;
			ClassKey = new ClassKey(dec) ;
			Timestamp = dec.ReadInt64() ;
			Severity = (EventSeverity) dec.ReadUint8() ;
			SchemaClass sClass = Session.GetSchema(ClassKey) ;
			Arguments = new Dictionary<string, object>() ;
			
			if (sClass != null) {
				foreach (SchemaArgument arg in sClass.Arguments) {
					Arguments[arg.Name] = Session.DecodeValue(dec, arg.Type) ;	
				}
			}	
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:15,代码来源:QMFEvent.cs


示例11: ComputeSpectrogram

        /// <summary>
        /// Computes the spectogram of an audio file.
        /// </summary>
        /// <param name="decoder">The <see cref="IDecoder"/> instance.</param>
        /// <returns>Chroma image.</returns>
        public static Image ComputeSpectrogram(IDecoder decoder)
        {
            int numBands = 72;

            var image = new Image(numBands);
            var image_builder = new ImageBuilder(image);

            var chroma = new Spectrum(numBands, MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, image_builder);

            var fft = new FFT(FRAME_SIZE, OVERLAP, chroma, new LomontFFTService());
            var processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            return image;
        }
开发者ID:wo80,项目名称:AcoustID.NET,代码行数:23,代码来源:ImageGenerator.cs


示例12: ComputeChromagram

        /// <summary>
        /// Computes the chromagram of an audio file.
        /// </summary>
        /// <param name="decoder">The <see cref="IDecoder"/> instance.</param>
        /// <returns>Chroma image.</returns>
        public static Image ComputeChromagram(IDecoder decoder)
        {
            var image = new Image(12);
            var image_builder = new ImageBuilder(image);

            var chroma_normalizer = new ChromaNormalizer(image_builder);
            var chroma_filter = new ChromaFilter(ChromaFilterCoefficients, chroma_normalizer);
            var chroma = new Chroma(MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, chroma_filter);

            var fft = new FFT(FRAME_SIZE, OVERLAP, chroma, new LomontFFTService());
            var processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            return image;
        }
开发者ID:wo80,项目名称:AcoustID.NET,代码行数:23,代码来源:ImageGenerator.cs


示例13: Compute

        //static int MAX_FILTER_WIDTH = 20;

        public static Image Compute(string file, IDecoder decoder)
        {
            int numBands = 72;

            Image image = new Image(numBands);
            ImageBuilder image_builder = new ImageBuilder(image);
            Spectrum chroma = new Spectrum(numBands, MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, image_builder);
            FFT fft = new FFT(FRAME_SIZE, OVERLAP, chroma);
            AudioProcessor processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            //ExportImage(image, name, 0.5);

            return image;
        }
开发者ID:gaborp,项目名称:AcoustID.NET,代码行数:20,代码来源:Spectrogram.cs


示例14: Compute

        public static Image Compute(string file, IDecoder decoder)
        {
            Image image = new Image(12);
            ImageBuilder image_builder = new ImageBuilder(image);
            ChromaNormalizer chroma_normalizer = new ChromaNormalizer(image_builder);
            ChromaFilter chroma_filter = new ChromaFilter(ChromaFilterCoefficients, chroma_normalizer);
            //Chroma chroma = new Chroma(MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, &chroma_normalizer);
            Chroma chroma = new Chroma(MIN_FREQ, MAX_FREQ, FRAME_SIZE, SAMPLE_RATE, chroma_filter);
            FFT fft = new FFT(FRAME_SIZE, OVERLAP, chroma);
            AudioProcessor processor = new AudioProcessor(SAMPLE_RATE, fft);

            processor.Reset(decoder.SampleRate, decoder.Channels);
            decoder.Decode(processor, 120);
            processor.Flush();

            //ExportImage(image, name);

            return image;
        }
开发者ID:gaborp,项目名称:AcoustID.NET,代码行数:19,代码来源:Chromagram.cs


示例15: SchemaProperty

		public SchemaProperty(IDecoder dec)
		{
			Dictionary<string, Object> map = dec.ReadMap() ;
			base.PopulateData(map) ;
			Name = (string)  map["name"] ;
			
			if (map.ContainsKey("optional")) {
				//System.Console.WriteLine("optional") ;
				Optional = (int)map["optional"] != 0 ;		
			} 
			if (map.ContainsKey("index")) {
				//System.Console.WriteLine("index") ;			
				Index = (int)map["index"] != 0 ;		
			}
			if (map.ContainsKey("access")) {
				//System.Console.WriteLine("access") ;			
				Access = (int) map["access"] ;			
			}
		
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:20,代码来源:SchemaProperty.cs


示例16: ExecutionUnit

        /// <summary>
        /// Initializes a new instance of the <see cref="Computer"/> class.
        /// </summary>
        /// <param name="stack">The stack.</param>
        /// <param name="encoder">The instruction encoder.</param>
        /// <param name="decoder">The instruction decoder.</param>
        public ExecutionUnit(IStack stack, IEncoder encoder, IDecoder decoder, IArithmeticLogicUnit alu)
        {
            _context = new ExecutionContext
            {
                Stack = stack,
                Encoder = encoder,
                Decoder = decoder,
                Alu = alu,
                Executing = true
            };

            _dispatcher = new Dictionary<InstructionType, Action<ExecutionContext, Instruction>>
            {
                { InstructionType.Mult, Multiply.GetAction() },
                { InstructionType.Call, Call.GetAction() },
                { InstructionType.Ret, Return.GetAction() },
                { InstructionType.Stop, Stop.GetAction() },
                { InstructionType.Print, Print.GetAction() },
                { InstructionType.Push, Push.GetAction() }
            };
        }
开发者ID:hkra,项目名称:Computer,代码行数:27,代码来源:ExecutionUnit.cs


示例17: SchemaMethod

		public SchemaMethod(IDecoder dec)
		{
			Dictionary<string, Object> map = dec.ReadMap() ;
			Name = (string)  map["name"] ;
			ArgCount = (int) map["argCount"] ;
			if (map.ContainsKey("desc")) {
				Description = (string) map["desc"] ;
			}
			for (int x = 0 ; x < ArgCount ; x++) {
				SchemaArgument arg = new SchemaArgument(dec, true) ; 
				Arguments.Add(arg) ;
				if (arg.IsInput()) {
					InputArgCount += 1 ;
				}
				if (arg.IsOutput()) {
					OutputArgCount += 1 ;
				}			
				if (arg.IsBidirectional()) {
					BidirectionalArgCount += 1 ;
				}	
			}
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:22,代码来源:SchemaMethod.cs


示例18: SchemaClass

		public SchemaClass(int kind, ClassKey key, IDecoder dec, Session session)
		{
			log.Debug(String.Format("New schema class {0}", key)) ;
		    Kind = kind ;
		    Session = session ;
		    this.Key = key ;   
		    bool hasSupertype = false ;
		 
		 	if (kind == CLASS_KIND_TABLE) {
				int propCount = dec.ReadUint16() ;
				int statCount = dec.ReadUint16() ;
				int methodCount = dec.ReadUint16() ;
				
				if (hasSupertype) {		
			 		SuperType = new ClassKey(dec) ;
			 	}
				
				for(int x = 0 ; x < propCount ; x++) {
					Properties.Add(new SchemaProperty(dec)) ;
				}
				for(int x = 0 ; x < statCount ; x++) {
					Statistics.Add(new SchemaStatistic(dec)) ;
				}	
				for(int x = 0 ; x < methodCount ; x++) {
					Methods.Add(new SchemaMethod(dec)) ;
				}	
			}
			
			if (kind == CLASS_KIND_EVENT) {			
				int argCount = dec.ReadUint16() ;		
				if (hasSupertype) {
			 		SuperType = new ClassKey(dec) ;
			 	}				
				for(int x = 0 ; x < argCount ; x++) {
					Arguments.Add(new SchemaArgument(dec, false)) ;
				}	
			}
		}
开发者ID:drzo,项目名称:opensim4opencog,代码行数:38,代码来源:SchemaClass.cs


示例19: AudioBuffer

        public AudioBuffer(IDecoder decoder)
        {
            if (decoder == null)
                throw new ArgumentNullException("decoder");

            Buffer = AL.GenBuffer();
            Util.CheckOpenAlErrors();

            var data = new float[decoder.TotalSamples];
            var castData = new short[decoder.TotalSamples];

            int read = 0;
            while (read < data.Length)
            {
                read += decoder.ReadSamples(data, read, data.Length - read);
            }

            Util.CastBuffer(data, castData, data.Length);

            AL.BufferData(Buffer, Util.ToOpenAL(decoder.Format), castData, castData.Length * sizeof(short), decoder.Frequency);
            Util.CheckOpenAlErrors();

            decoder.Dispose();
        }
开发者ID:johang88,项目名称:triton,代码行数:24,代码来源:AudioBuffer.cs


示例20: Deserialize

        public override void Deserialize(IDecoder inStream)
        {
            base.Deserialize(inStream);

            TriggerMethod = (TriggerMethod)inStream.ReadInt();
        }
开发者ID:gyantal,项目名称:SQLab,代码行数:6,代码来源:PriceCondition.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IDecompiler类代码示例发布时间:2022-05-24
下一篇:
C# IDeclaredElement类代码示例发布时间: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