Beispiel #1
0
        public void RaiseBufferReady(RoutingEventArgs e)
        {
            if (sinks.Count == 0) return;

            for (int i = 0; i < sinks.Count; i++)
            {
                float[] buffer;
                if (i == 0)
                {
                    // The first (or only) receiver can just reuse the buffer
                    // so there is no need to clone it
                    buffer = e.Buffer;
                }
                else
                {
                    sinkBuffers[i] = BufferHelpers.Ensure(sinkBuffers[i], e.Count);
                    Buffer.BlockCopy(e.Buffer, 0, sinkBuffers[i], 0, e.Count * sizeof(float));

                    buffer = sinkBuffers[i];
                }

                sinks[i].ReceiveDataFromSource(
                    new RoutingEventArgs
                    {
                        Buffer = buffer,
                        Count = e.Count,
                        Format = e.Format,
                        Index = i
                    });
            }
        }
Beispiel #2
0
        public void RaiseBufferReady(RoutingEventArgs e)
        {
            if (sinks.Count == 0)
            {
                return;
            }

            for (int i = 0; i < sinks.Count; i++)
            {
                float[] buffer;
                if (i == 0)
                {
                    // The first (or only) receiver can just reuse the buffer
                    // so there is no need to clone it
                    buffer = e.Buffer;
                }
                else
                {
                    sinkBuffers[i] = BufferHelpers.Ensure(sinkBuffers[i], e.Count);
                    Buffer.BlockCopy(e.Buffer, 0, sinkBuffers[i], 0, e.Count * sizeof(float));

                    buffer = sinkBuffers[i];
                }

                sinks[i].ReceiveDataFromSource(
                    new RoutingEventArgs
                {
                    Buffer = buffer,
                    Count  = e.Count,
                    Format = e.Format,
                    Index  = i
                });
            }
        }
Beispiel #3
0
        private void RightIn_ReceivedData(object sender, RoutingEventArgs e)
        {
            rightData = e.Buffer;

            if (leftData != null || !LeftIn.IsMapped)
            {
                processFrame(e.Count, e.Format);
            }
        }
Beispiel #4
0
 public void ReceiveDataFromSource(RoutingEventArgs e)
 {
     if (ReceivedData != null)
     {
         ReceivedData.Invoke(this, new RoutingEventArgs
         {
             Buffer = e.Buffer,
             Count  = e.Count,
             Format = e.Format,
             Index  = index
         });
     }
 }
Beispiel #5
0
 public void ReceiveDataFromSource(RoutingEventArgs e)
 {
     if (ReceivedData != null)
     {
         ReceivedData.Invoke(this, new RoutingEventArgs
         {
             Buffer = e.Buffer,
             Count = e.Count,
             Format = e.Format,
             Index = index
         });
     }
 }
Beispiel #6
0
        private void input_ReceivedData(object sender, RoutingEventArgs e)
        {
            if (!Bypass)
            {
                SignalProcess.Process(new float[][] { e.Buffer }, e.Count);
            }

            if (CentreOut != null)
            {
                CentreOut.RaiseBufferReady(new RoutingEventArgs
                {
                    Buffer = e.Buffer,
                    Count  = e.Count,
                    Format = format,
                    Index  = 0
                });
            }
        }
Beispiel #7
0
        private void output_ReceivedData(object sender, RoutingEventArgs e)
        {
            if (e.Index < 0 || e.Index > device.Buffers.Length)
            {
                throw new ArgumentOutOfRangeException("e", "Output index exceeds number of outputs on the Asio device");
            }

            device.Buffers[e.Index] = e.Buffer;

            if (isAllDataReceived())
            {
                processFrame();
            }
        }
Beispiel #8
0
        private void RightIn_ReceivedData(object sender, RoutingEventArgs e)
        {
            rightData = e.Buffer;

            if (leftData != null || !LeftIn.IsMapped)
            {
                processFrame(e.Count, e.Format);
            }
        }
Beispiel #9
0
        private void input_ReceivedData(object sender, RoutingEventArgs e)
        {
            if (!Bypass)
            {
                SignalProcess.Process(new float[][] { e.Buffer }, e.Count);
            }

            if (CentreOut != null)
            {
                CentreOut.RaiseBufferReady(new RoutingEventArgs
                {
                    Buffer = e.Buffer,
                    Count = e.Count,
                    Format = format,
                    Index = 0
                });
            }
        }