mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-19 12:07:27 -05:00
Merge pull request #416 from DSheirer/415-overflow-state
415 Buffer Overflow State Listener Registration
This commit is contained in:
@@ -19,6 +19,7 @@ import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate;
|
|||||||
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
||||||
import io.github.dsheirer.dsp.mixer.IOscillator;
|
import io.github.dsheirer.dsp.mixer.IOscillator;
|
||||||
import io.github.dsheirer.dsp.mixer.LowPhaseNoiseOscillator;
|
import io.github.dsheirer.dsp.mixer.LowPhaseNoiseOscillator;
|
||||||
|
import io.github.dsheirer.sample.IOverflowListener;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue;
|
import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue;
|
||||||
import io.github.dsheirer.sample.buffer.ReusableComplexBuffer;
|
import io.github.dsheirer.sample.buffer.ReusableComplexBuffer;
|
||||||
@@ -74,6 +75,7 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
|
|||||||
channelSpecification.getStopFrequency());
|
channelSpecification.getStopFrequency());
|
||||||
|
|
||||||
mBuffer = new OverflowableReusableBufferTransferQueue<>(BUFFER_MAX_CAPACITY, BUFFER_OVERFLOW_RESET_THRESHOLD);
|
mBuffer = new OverflowableReusableBufferTransferQueue<>(BUFFER_MAX_CAPACITY, BUFFER_OVERFLOW_RESET_THRESHOLD);
|
||||||
|
|
||||||
//Setup the frequency mixer to the current source frequency
|
//Setup the frequency mixer to the current source frequency
|
||||||
mChannelSampleRate = sampleRate / (double)decimation;
|
mChannelSampleRate = sampleRate / (double)decimation;
|
||||||
mTunerFrequency = tunerChannel.getFrequency();
|
mTunerFrequency = tunerChannel.getFrequency();
|
||||||
@@ -82,6 +84,18 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
|
|||||||
mFrequencyCorrectionMixer = new LowPhaseNoiseOscillator(frequencyOffset, sampleRate);
|
mFrequencyCorrectionMixer = new LowPhaseNoiseOscillator(frequencyOffset, sampleRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers an overflow listener to be notified in the internal buffer is in an
|
||||||
|
* overflow state.
|
||||||
|
*
|
||||||
|
* @param listener to receiver updates to the source overflow state
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setOverflowListener(IOverflowListener listener)
|
||||||
|
{
|
||||||
|
mBuffer.setOverflowListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user