Exemple #1
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            if (FPackets.Channel != FPinInChannel[0])
            {
                FPackets = new SRComms.Queue(FPinInChannel[0]);
            }

            lock (FLockPackets)
            {
                int count = FPackets.Count;
                FPinOutOutput.SliceCount = count;
                if (count > 0)
                {
                    int i = 0;
                    foreach (var p in FPackets)
                    {
                        FPinOutOutput[i++] = p;
                    }
                    FPackets.Clear();
                }
                else
                {
                    FPinOutOutput.SliceCount = 1;
                    FPinOutOutput[0]         = null;
                }
            }
        }
Exemple #2
0
        //called when data for any output pin is requested
        public void Evaluate(int SpreadMax)
        {
            if (FPackets.Channel != FPinInChannel[0])
            {
                FPackets = new SRComms.Queue(FPinInChannel[0]);
            }


            if (FConfigMode[0] == SendMode.Auto)
            {
                if (FPinInAddress.IsChanged || FInput.IsChanged)
                {
                    for (int i = 0; i < SpreadMax; i++)
                    {
                        if (FPinInAddress[i] == "")
                        {
                            continue;
                        }

                        OSCMessage p = new OSCMessage(FPinInAddress[i]);
                        for (int j = 0; j < FInput[i].SliceCount; j++)
                        {
                            p.Append((T)FInput[i][j]);
                        }
                        FPackets.Add(p);
                    }
                }
            }
            else
            {
                for (int i = 0; i < SpreadMax; i++)
                {
                    if (FPinInSend[i])
                    {
                        OSCMessage p = new OSCMessage(FPinInAddress[i]);
                        for (int j = 0; j < FInput[i].SliceCount; j++)
                        {
                            p.Append((T)FInput[i][j]);
                        }
                        FPackets.Add(p);
                    }
                }
            }
            if (FPackets.Count > 0)
            {
                SRComms.OnMessageSent(FPackets);
            }
            FPackets.Clear();
        }