public bool ReadTo(int n)
{
if (n < _samples.Count)
{
return true;
}
if (_input == null)
{
_moreSamples = false;
return _moreSamples;
}
if (_inputEnum == null)
{
_inputEnum = _input.GetBufferedEnumerator() as ISampleBuffer;
}
int nn = n - _samples.Count;
if (nn > 0 && _moreSamples)
{
if (n<int.MaxValue && _samples.Capacity < n) _samples.Capacity = n;
int tot = 0;
int nnn;
while (_moreSamples && tot < nn)
{
ISample[] tmp = _inputEnum.Read(DSPUtil.BUFSIZE, out nnn, out _moreSamples);
for (int j = 0; j < nnn; j++)
{
_samples.Add(tmp[j]);
}
tot += nnn;
}
}
return nn < 0 || _moreSamples;
}