mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-17 02:57:35 -05:00
Closes #7 NXDN Decoder * Implements: NXDN4800, NXDN9600, Type-C and Type-D decoding and trunk tracking. * Redesigns tuner and channel frequency error management.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2023 Dennis Sheirer
|
||||
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,21 +40,18 @@ public abstract class Tuner implements ISourceEventProcessor, ITunerErrorListene
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(Tuner.class);
|
||||
|
||||
private Broadcaster<TunerEvent> mTunerEventBroadcaster = new Broadcaster<>();
|
||||
private final Broadcaster<TunerEvent> mTunerEventBroadcaster = new Broadcaster<>();
|
||||
private ChannelSourceManager mChannelSourceManager;
|
||||
private TunerController mTunerController;
|
||||
private TunerFrequencyErrorMonitor mTunerFrequencyErrorMonitor;
|
||||
private final TunerController mTunerController;
|
||||
private ITunerErrorListener mTunerErrorListener;
|
||||
private AtomicBoolean mRunning = new AtomicBoolean();
|
||||
private final AtomicBoolean mRunning = new AtomicBoolean();
|
||||
|
||||
public Tuner(TunerController tunerController, ITunerErrorListener tunerErrorListener)
|
||||
{
|
||||
mTunerController = tunerController;
|
||||
mTunerErrorListener = tunerErrorListener;
|
||||
//Register to receive frequency and sample rate change notifications
|
||||
mTunerController.addListener(this::process);
|
||||
mTunerFrequencyErrorMonitor = new TunerFrequencyErrorMonitor(this);
|
||||
mTunerFrequencyErrorMonitor.start();
|
||||
mTunerController.addListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +126,6 @@ public abstract class Tuner implements ISourceEventProcessor, ITunerErrorListene
|
||||
getTunerController().dispose();
|
||||
|
||||
mTunerEventBroadcaster.clear();
|
||||
mTunerFrequencyErrorMonitor = null;
|
||||
mTunerErrorListener = null;
|
||||
}
|
||||
}
|
||||
@@ -195,6 +191,9 @@ public abstract class Tuner implements ISourceEventProcessor, ITunerErrorListene
|
||||
case NOTIFICATION_FREQUENCY_CORRECTION_CHANGE:
|
||||
broadcast(new TunerEvent(Tuner.this, Event.UPDATE_FREQUENCY_ERROR));
|
||||
break;
|
||||
case NOTIFICATION_MEASURED_FREQUENCY_ERROR:
|
||||
broadcast(new TunerEvent(Tuner.this, Event.UPDATE_MEASURED_FREQUENCY_ERROR));
|
||||
break;
|
||||
case NOTIFICATION_SAMPLE_RATE_CHANGE:
|
||||
broadcast(new TunerEvent(Tuner.this, Event.UPDATE_SAMPLE_RATE));
|
||||
break;
|
||||
@@ -202,9 +201,6 @@ public abstract class Tuner implements ISourceEventProcessor, ITunerErrorListene
|
||||
case NOTIFICATION_FREQUENCY_AND_SAMPLE_RATE_UNLOCKED:
|
||||
broadcast(new TunerEvent(Tuner.this, Event.UPDATE_LOCK_STATE));
|
||||
break;
|
||||
case NOTIFICATION_MEASURED_FREQUENCY_ERROR_SYNC_LOCKED:
|
||||
mTunerFrequencyErrorMonitor.receive(event);
|
||||
break;
|
||||
case NOTIFICATION_RECORDING_FILE_LOADED:
|
||||
//ignore
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user