本文整理汇总了C#中IDecoder类的典型用法代码示例。如果您正苦于以下问题:C# IDecoder类的具体用法?C# IDecoder怎么用?C# IDecoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDecoder类属于命名空间,在下文中一共展示了IDecoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize(IDecoder inStream)
{
base.Deserialize(inStream);
IsMore = inStream.ReadBoolFromInt();
Value = inStream.ReadString();
}
示例2: Deserialize
public override void Deserialize(IDecoder inStream)
{
base.Deserialize(inStream);
ConId = inStream.ReadInt();
Exchange = inStream.ReadString();
}
示例3: StreamedAudioBuffer
public StreamedAudioBuffer(IDecoder decoder)
{
if (decoder == null)
throw new ArgumentNullException("decoder");
Decoder = decoder;
}
示例4: Deserialize
public override void Deserialize(IDecoder inStream)
{
base.Deserialize(inStream);
SecType = inStream.ReadString();
Exchange = inStream.ReadString();
Symbol = inStream.ReadString();
}
示例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() ;
}
示例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;
}
示例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"] ;
}
}
示例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"] ;
}
}
示例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;
}
示例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) ;
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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"] ;
}
}