2025-01-02 17:55:16 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Essgee.EventArguments
|
|
|
|
|
{
|
2025-01-07 17:01:37 +08:00
|
|
|
|
public class EnqueueSamplesEventArgs : EventArgs
|
2025-01-02 17:55:16 +08:00
|
|
|
|
{
|
|
|
|
|
public int NumChannels { get; set; }
|
|
|
|
|
public short[][] ChannelSamples { get; set; }
|
|
|
|
|
public bool[] IsChannelMuted { get; set; }
|
|
|
|
|
public short[] MixedSamples { get; set; }
|
|
|
|
|
|
2025-01-07 17:01:37 +08:00
|
|
|
|
//public EnqueueSamplesEventArgs(int numChannels, short[][] channelSamples, bool[] isMuted, short[] mixedSamples)
|
|
|
|
|
//{
|
|
|
|
|
// NumChannels = numChannels;
|
|
|
|
|
// ChannelSamples = channelSamples;
|
|
|
|
|
// IsChannelMuted = isMuted;
|
|
|
|
|
// MixedSamples = mixedSamples;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
public static EnqueueSamplesEventArgs Create(int numChannels, short[][] channelSamples, bool[] isMuted, short[] mixedSamples)
|
|
|
|
|
{
|
|
|
|
|
var eventArgs = ObjectPoolAuto.Acquire<EnqueueSamplesEventArgs>();
|
|
|
|
|
eventArgs.NumChannels = numChannels;
|
|
|
|
|
eventArgs.ChannelSamples = channelSamples;
|
|
|
|
|
eventArgs.IsChannelMuted = isMuted;
|
|
|
|
|
eventArgs.MixedSamples = mixedSamples;
|
|
|
|
|
return eventArgs;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static class EnqueueSamplesEventArgsEx
|
|
|
|
|
{
|
|
|
|
|
public static void Release(this EnqueueSamplesEventArgs eventArgs)
|
|
|
|
|
{
|
|
|
|
|
eventArgs.NumChannels = 1;
|
|
|
|
|
eventArgs.ChannelSamples = null;
|
|
|
|
|
eventArgs.IsChannelMuted = null;
|
|
|
|
|
eventArgs.MixedSamples = null;
|
|
|
|
|
ObjectPoolAuto.Release(eventArgs);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-02 17:55:16 +08:00
|
|
|
|
}
|