/// <summary>
        /// Recorder callback.
        /// </summary>
        /// <param name="data">Data to fill in.</param>
        /// <param name="size">Buffer size.</param>
        private void _RecordData(IntPtr data, uint size)
        {
            if (_recodingBuffer == null)
            {
                _recodingBuffer = new byte[size];
            }
            else
            {
                Array.Resize(ref _recodingBuffer, (int)size);
            }

            Marshal.Copy(data, _recodingBuffer, 0, (int)size);

            // Process byte stream.
            ProcessCallback ps = new ProcessCallback(_soundProcessing);

            Dispatcher.CurrentDispatcher.Invoke(ps, new object[] { _recodingBuffer.ToList(), data });

            _streamMemory.Write(_recodingBuffer, 0, _recodingBuffer.Length);

            // Update labels.
            PositionChangedCallback pc = new PositionChangedCallback(_PositionChange);

            Dispatcher.CurrentDispatcher.Invoke(pc, new object[] { });
        }
Exemple #2
0
 internal Position(PositionChangedCallback cb, float x, float y, float z) : this(Interop.Vector3.new_Vector3__SWIG_1(x, y, z), true)
 {
     callback = cb;
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        /// <summary>
        /// Recorder callback.
        /// </summary>
        /// <param name="data">Data to fill in.</param>
        /// <param name="size">Buffer size.</param>
        private void _RecordData(IntPtr data, uint size)
        {
            if (_recodingBuffer == null)
                _recodingBuffer = new byte[size];
            else
                Array.Resize(ref _recodingBuffer, (int)size);

            Marshal.Copy(data, _recodingBuffer, 0, (int)size);

            // Process byte stream.
            ProcessCallback ps = new ProcessCallback(_soundProcessing);
                Dispatcher.CurrentDispatcher.Invoke(ps, new object[] { _recodingBuffer.ToList(), data });

            _streamMemory.Write(_recodingBuffer, 0, _recodingBuffer.Length);

            // Update labels.
            PositionChangedCallback pc = new PositionChangedCallback(_PositionChange);
            Dispatcher.CurrentDispatcher.Invoke(pc, new object[] { });
        }