mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
P25 Phase 2 Decoder implementation.
This commit is contained in:
@@ -46,39 +46,52 @@ public abstract class Tuner implements ISourceEventProcessor
|
||||
private TunerFrequencyErrorMonitor mTunerFrequencyErrorMonitor;
|
||||
private String mName;
|
||||
|
||||
/**
|
||||
* Abstract tuner class.
|
||||
* @param name of the tuner
|
||||
* @param tunerController for the tuner
|
||||
*/
|
||||
public Tuner(String name, TunerController tunerController, UserPreferences userPreferences)
|
||||
public Tuner(String name, TunerController tunerController)
|
||||
{
|
||||
mName = name;
|
||||
mTunerController = tunerController;
|
||||
//Register to receive frequency and sample rate change notifications
|
||||
mTunerController.addListener(this::process);
|
||||
|
||||
ChannelizerType channelizerType = userPreferences.getTunerPreference().getChannelizerType();
|
||||
mTunerFrequencyErrorMonitor = new TunerFrequencyErrorMonitor(this);
|
||||
mTunerFrequencyErrorMonitor.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract tuner class.
|
||||
* @param name of the tuner
|
||||
* @param tunerController for the tuner
|
||||
* @param userPreferences to discover preferred channelizer type
|
||||
*/
|
||||
public Tuner(String name, TunerController tunerController, UserPreferences userPreferences)
|
||||
{
|
||||
this(name, tunerController);
|
||||
|
||||
ChannelizerType channelizerType = userPreferences.getTunerPreference().getChannelizerType();
|
||||
if(channelizerType == ChannelizerType.POLYPHASE)
|
||||
{
|
||||
mChannelSourceManager = new PolyphaseChannelSourceManager(mTunerController);
|
||||
setChannelSourceManager(new PolyphaseChannelSourceManager(mTunerController));
|
||||
}
|
||||
else if(channelizerType == ChannelizerType.HETERODYNE)
|
||||
{
|
||||
mChannelSourceManager = new HeterodyneChannelSourceManager(mTunerController);
|
||||
setChannelSourceManager(new HeterodyneChannelSourceManager(mTunerController));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("Unrecognized channelizer type: " + channelizerType);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the channel source manager
|
||||
* @param manager to use
|
||||
*/
|
||||
protected void setChannelSourceManager(ChannelSourceManager manager)
|
||||
{
|
||||
mChannelSourceManager = manager;
|
||||
|
||||
//Register to receive channel count change notifications
|
||||
mChannelSourceManager.addSourceEventListener(this::process);
|
||||
|
||||
mTunerFrequencyErrorMonitor = new TunerFrequencyErrorMonitor(this);
|
||||
mTunerFrequencyErrorMonitor.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,6 +118,9 @@ public abstract class Tuner implements ISourceEventProcessor
|
||||
case NOTIFICATION_MEASURED_FREQUENCY_ERROR_SYNC_LOCKED:
|
||||
mTunerFrequencyErrorMonitor.receive(event);
|
||||
break;
|
||||
case NOTIFICATION_RECORDING_FILE_LOADED:
|
||||
//ignore
|
||||
break;
|
||||
default:
|
||||
mLog.debug("Unrecognized Source Event: " + event.toString());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user