Exemplo n.º 1
0
        private void Emulator_InsideInterruptChanged(object sender, EventArgs e)
        {
            if (!_device.Emulator.InsideInterrupt && Frames.Count == 0 && Possibilities.Count > 0 &&
                !_receivingData && (_receivedData == null || _dataReceiveComplete))
            {
                Task.Factory.StartNew(() =>
                {
                    _dataReceiveComplete = false;
                    var bytes            = Possibilities.Peek();

                    var sb = new StringBuilder();
                    foreach (var b in bytes)
                    {
                        sb.Append(string.Format("{0} ", b.ToString("X02")));
                    }

                    Console.WriteLine("PCM receiving bytes: " + sb.ToString().Trim());

                    if (_receivedData == null)
                    {
                        _receivedData = new List <byte>();
                    }

                    Thread.Sleep(2000);
                    var clone = new List <byte>();
                    foreach (var b in bytes)
                    {
                        clone.Add(b);
                    }

                    Frames.Enqueue(clone);
                    _device.Emulator.Interrupt          = (0x1C0 / 4) - 0x18;
                    _device.Emulator.InterruptMaskLevel = _device.Emulator.Interrupt - 1;
                });
            }
        }
        public void Add(MediaFrameReference frame)
        {
            if (frame == null)
            {
                FailureReasons.Enqueue(ExampleMediaFrameCollectionFailureReason.NullMediaFrameReference);
                return;
            }

            if (frame.VideoMediaFrame == null)
            {
                FailureReasons.Enqueue(ExampleMediaFrameCollectionFailureReason.NullVideoMediaFrame);
                return;
            }

            if (frame.SystemRelativeTime == null)
            {
                FailureReasons.Enqueue(ExampleMediaFrameCollectionFailureReason.NullSystemRelativeTime);
                return;
            }

            Frames.Enqueue(new ExampleMediaFrame(frame.VideoMediaFrame));

            Update(frame.SystemRelativeTime.Value);
        }
Exemplo n.º 3
0
 public void AddFrame(PoolEntry <ushort> depth, PoolEntry <byte> color)
 {
     Frames.Enqueue(depth);
     ColorFrames.Enqueue(color);
 }
Exemplo n.º 4
0
 public void Add(ImportedSkeleton skel, int maxSize)
 {
     windowFixedSize = maxSize;
     Frames.Enqueue(skel);
     FixFramesLenght();
 }