Adds support to MPT1327 decoder for rotating control channels. (#477)

This commit is contained in:
Denny Sheirer
2019-01-06 07:47:08 -05:00
committed by GitHub
parent 7510664e00
commit d90e149021

View File

@@ -190,7 +190,8 @@ public class DecoderFactory
Sync sync = mptConfig.getSync(); Sync sync = mptConfig.getSync();
modules.add(new MPT1327Decoder(sync)); modules.add(new MPT1327Decoder(sync));
modules.add(new AudioModule()); modules.add(new AudioModule());
if(channel.getSourceConfiguration().getSourceType() == SourceType.TUNER) SourceType sourceType = channel.getSourceConfiguration().getSourceType();
if(sourceType == SourceType.TUNER || sourceType == SourceType.TUNER_MULTIPLE_FREQUENCIES)
{ {
modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH, DEMODULATED_AUDIO_SAMPLE_RATE)); modules.add(new FMDemodulatorModule(FM_CHANNEL_BANDWIDTH, DEMODULATED_AUDIO_SAMPLE_RATE));
} }
@@ -207,6 +208,15 @@ public class DecoderFactory
{ {
modules.add(new MPT1327DecoderState(channelType, timeout)); modules.add(new MPT1327DecoderState(channelType, timeout));
} }
//Add a channel rotation monitor when we have multiple control channel frequencies specified
if(channel.getSourceConfiguration() instanceof SourceConfigTunerMultipleFrequency &&
((SourceConfigTunerMultipleFrequency)channel.getSourceConfiguration()).hasMultipleFrequencies())
{
List<State> activeStates = new ArrayList<>();
activeStates.add(State.CONTROL);
modules.add(new ChannelRotationMonitor(activeStates, userPreferences));
}
break; break;
case PASSPORT: case PASSPORT:
modules.add(new PassportDecoder(decodeConfig)); modules.add(new PassportDecoder(decodeConfig));