mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-22 21:29:26 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
33 lines
681 B
C#
33 lines
681 B
C#
|
|
namespace Sandbox.Audio;
|
|
|
|
/// <summary>
|
|
/// An instance of a DspPreset. The actual processor creates one of these from
|
|
/// a DspPreset, and then uses it to process the audio buffers.
|
|
/// </summary>
|
|
class DspInstance
|
|
{
|
|
global::DspInstance _native;
|
|
|
|
internal DspInstance( DspPreset source, int channels )
|
|
{
|
|
_native = source.GetNative().Instantiate( channels );
|
|
}
|
|
|
|
~DspInstance()
|
|
{
|
|
MainThread.QueueDispose( _native );
|
|
}
|
|
|
|
public void Process( MixBuffer input, MixBuffer output, int channel )
|
|
{
|
|
_native.ProcessChannel( input._native, output._native, channel );
|
|
}
|
|
|
|
internal void Dispose()
|
|
{
|
|
GC.SuppressFinalize( this );
|
|
MainThread.QueueDispose( _native );
|
|
}
|
|
}
|