Changed FrequencyChangeListener interface to an event so that I could describe what event was causing the frequency change and to broadcast frequency and sample rate error values.

R820T - added a couple more sample rate settings to the enum and modified the periodic sample rate info logger.
This commit is contained in:
dennis.sheirer
2014-09-27 09:46:18 +00:00
parent e441ebf0c9
commit 550aed79d4
28 changed files with 600 additions and 500 deletions

View File

@@ -46,6 +46,7 @@ import source.FloatSource;
import source.Source;
import source.SourceException;
import source.config.SourceConfigMixer;
import source.tuner.FrequencyChangeListener;
import source.tuner.Tuner;
import source.tuner.TunerChannelSource;
import alias.AliasList;
@@ -61,7 +62,6 @@ import controller.state.ChannelState.State;
import decode.Decoder;
import decode.DecoderFactory;
import dsp.afc.AutomaticFrequencyControl;
import dsp.afc.FrequencyErrorListener;
import eventlog.EventLogType;
import eventlog.EventLogger;
@@ -403,16 +403,15 @@ public class ProcessingChain implements Listener<Message>
mAFC = null;
}
if( mSource instanceof FrequencyErrorListener &&
if( mSource instanceof TunerChannelSource &&
mChannel.getDecodeConfiguration().isAFCEnabled() )
{
FrequencyErrorListener listener =
(FrequencyErrorListener)mSource;
TunerChannelSource tcs = (TunerChannelSource)mSource;
mAFC = new AutomaticFrequencyControl( listener );
mAFC = new AutomaticFrequencyControl( tcs );
/* Register AFC to receive frequency change events */
listener.addListener( mAFC );
tcs.addListener( mAFC );
/* Add AFC as listener to the decoder */
mDecoder.addUnfilteredFloatListener( mAFC );