private EnttecProController()
 {
     busLength = Settings.Default.DMXChannelCount;
     if (bufferToUsb == null)
     {
         bufferToUsb = BufferExtensions.ZeroBuffer(busLength);  // can be any length up to 512. The shorter the faster.
         nextBuffer  = BufferExtensions.ZeroBuffer(busLength);
     }
 }
 public void StopConnection()
 {
     bufferToUsb = BufferExtensions.ZeroBuffer(bufferToUsb.Length);
     newData     = true;
     Thread.Sleep(500);
     FTDI_ClosePort();
     FT_Close(handle);
     Connected = false;
     done      = true;
 }
Пример #3
0
        public byte?[] Buffer()
        {
            if (Frames == null ||
                Frames.Count == 0 ||
                Pause)
            {
                return(BufferExtensions.EmptyNullableBuffer(this.BufferSize));
            }

            if (currentFrame < Frames.Count)
            {
                return(Frames[currentFrame++]);
            }

            //Else if currentFrame has surpassed frameCount...
            if (RepeatTimes > 0)
            {
                RepeatTimes -= (RepeatForever? 0:1); //If we are repeating forever, don't decrement RepeatTimes.
                currentFrame = 0;
                return(Frames[currentFrame]);
            }
            Pause = true;
            return(BufferExtensions.EmptyNullableBuffer(this.BufferSize));
        }