Exemplo n.º 1
0
        private void SendDmx()
        {
            while (Streaming)
            {
                foreach (DmxUniverse universe in universes.Values)
                {
                    if (universe.AliveTime > 0 || universe.KeepAliveTime > 36)
                    {
                        socket.SendDmx(universe.Universe, universe.DmxData, (byte)Priority);

                        universe.KeepAliveTime = 0;
                        universe.AliveTime     = Math.Max(0, universe.AliveTime - 1);
                    }
                    else
                    {
                        universe.KeepAliveTime++;
                    }
                }

                //If we are in sync mode then wait for the sync delay and then send a sync message.
                if (socket.SynchronizationAddress > 0)
                {
                    Thread.Sleep(SynchonizationLatency);
                    socket.SendSynchronize();
                }

                //At the discovery interval, periodically send a discovery message so clients know what universes we are sending.
                if (DiscoveryInterval != TimeSpan.Zero && DateTime.Now.Subtract(lastDiscovery) > DiscoveryInterval)
                {
                    SendDiscovery();
                }

                Thread.Sleep(25);
            }
        }
Exemplo n.º 2
0
        private void SendDmx()
        {
            while (Streaming)
            {
                foreach (DmxUniverse universe in universes.Values)
                {
                    if (universe.AliveTime > 0 || universe.KeepAliveTime > 36)
                    {
                        socket.SendDmx(universe.Universe, 0, universe.DmxData, (byte)Priority);

                        universe.KeepAliveTime = 0;
                        universe.AliveTime     = Math.Max(0, universe.AliveTime - 1);
                    }
                    else
                    {
                        universe.KeepAliveTime++;
                    }
                }
                Thread.Sleep(25);
            }
        }