soundvision/UnityProject/Assets/Scripts/PdConnection/SpectrumArrayContainer.cs
2019-10-05 05:53:09 +02:00

30 lines
No EOL
695 B
C#

namespace cylvester
{
public interface ISpectrumArrayContainer
{
IPdArray this[int index] { get; }
void Update();
}
public class SpectrumArrayContainer : ISpectrumArrayContainer
{
private readonly IPdArray[] arrays_;
public SpectrumArrayContainer()
{
arrays_ = new IPdArray[16];
for(var i = 0; i < 16; ++i)
arrays_[i] = new PdArray("fft_" + i, 512);
}
public void Update()
{
foreach (var array in arrays_)
{
array.Update();
}
}
public IPdArray this[int index] => arrays_[index];
}
}