public AudioPluginBase() { SaveStateData = new AudioPluginSaveState(); InputPorts = new AudioIOPort[0]; OutputPorts = new AudioIOPort[0]; SampleFormatsSupported = EAudioBitsPerSample.Bits32 | EAudioBitsPerSample.Bits64; HasUserInterface = false; EditorWidth = 400; EditorHeight = 200; }
/// <summary> /// Pass through unmanaged data from this buffer to another buffer /// </summary> /// <param name="destinationPort">The port to copy data to</param> public unsafe void PassThroughTo(AudioIOPort destinationPort) { if (destinationPort.CurrentBufferSize != CurrentBufferSize) { throw new InvalidOperationException("Destination port does not have the same size"); } void **ptrs = (void **)audioBufferPtrs; void **destPtrs = (void **)destinationPort.GetAudioBufferPtrs(); uint length = currentBufferSize * (uint)((bitsPerSample == EAudioBitsPerSample.Bits32) ? 4 : 8); for (int channel = 0; channel < numChannels; channel++) { Buffer.MemoryCopy(ptrs[channel], destPtrs[channel], length, length); } }