Table of Contents

GetAdjacentSamples

Methods
public SampleBuffer<T>.AdjecentSamplesResult GetAdjacentSamples(double time, bool ignoreVirtualSamples)

Searches the buffer for the two samples adjacent to the given time. Returns (default, default, -1) if the buffer is empty. Returns (sample[0], sample[0], 0) if the buffer contains less than two samples - or if time pre-dates the first sample. Otherwise, it returns the sample before (or equal to) the given time, and the next sample in the buffer. IsLastSample is true if the second returned sample is the last sample in the buffer.

Parameters
Type Name Description
double time

The time used to compare with sample times in the buffer.

bool ignoreVirtualSamples

If false and virtual samples are present, it will return them as sample1 and sample2, else it will ignore virtual samples and return only real.

Returns
Type Description
SampleBuffer<T>.AdjecentSamplesResult