mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
1772 Adds preference for patch group streaming to stream patch group calls as either a)patch group, or b)each individual talkgroup or radio that forms the patch group.
This commit is contained in:
@@ -24,7 +24,7 @@ import io.github.dsheirer.preference.application.ApplicationPreference;
|
||||
import io.github.dsheirer.preference.calibration.VectorCalibrationPreference;
|
||||
import io.github.dsheirer.preference.decoder.JmbeLibraryPreference;
|
||||
import io.github.dsheirer.preference.directory.DirectoryPreference;
|
||||
import io.github.dsheirer.preference.duplicate.DuplicateCallDetectionPreference;
|
||||
import io.github.dsheirer.preference.duplicate.CallManagementPreference;
|
||||
import io.github.dsheirer.preference.event.DecodeEventPreference;
|
||||
import io.github.dsheirer.preference.identifier.TalkgroupFormatPreference;
|
||||
import io.github.dsheirer.preference.javafx.JavaFxPreferences;
|
||||
@@ -60,7 +60,7 @@ public class UserPreferences implements Listener<PreferenceType>
|
||||
private ChannelMultiFrequencyPreference mChannelMultiFrequencyPreference;
|
||||
private DecodeEventPreference mDecodeEventPreference;
|
||||
private DirectoryPreference mDirectoryPreference;
|
||||
private DuplicateCallDetectionPreference mDuplicateCallDetectionPreference;
|
||||
private CallManagementPreference mDuplicateCallDetectionPreference;
|
||||
private JmbeLibraryPreference mJmbeLibraryPreference;
|
||||
private MP3Preference mMP3Preference;
|
||||
private PlaybackPreference mPlaybackPreference;
|
||||
@@ -208,7 +208,7 @@ public class UserPreferences implements Listener<PreferenceType>
|
||||
/**
|
||||
* Duplicate call detection preferences
|
||||
*/
|
||||
public DuplicateCallDetectionPreference getDuplicateCallDetectionPreference()
|
||||
public CallManagementPreference getDuplicateCallDetectionPreference()
|
||||
{
|
||||
return mDuplicateCallDetectionPreference;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class UserPreferences implements Listener<PreferenceType>
|
||||
mChannelMultiFrequencyPreference = new ChannelMultiFrequencyPreference(this::receive);
|
||||
mDecodeEventPreference = new DecodeEventPreference(this::receive);
|
||||
mDirectoryPreference = new DirectoryPreference(this::receive);
|
||||
mDuplicateCallDetectionPreference = new DuplicateCallDetectionPreference(this::receive);
|
||||
mDuplicateCallDetectionPreference = new CallManagementPreference(this::receive);
|
||||
mJmbeLibraryPreference = new JmbeLibraryPreference(this::receive);
|
||||
mMP3Preference = new MP3Preference(this::receive);
|
||||
mPlaybackPreference = new PlaybackPreference(this::receive);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2020 Dennis Sheirer
|
||||
* Copyright (C) 2014-2023 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
|
||||
@@ -19,38 +19,40 @@
|
||||
|
||||
package io.github.dsheirer.preference.duplicate;
|
||||
|
||||
import io.github.dsheirer.audio.broadcast.PatchGroupStreamingOption;
|
||||
import io.github.dsheirer.preference.Preference;
|
||||
import io.github.dsheirer.preference.PreferenceType;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import java.util.prefs.Preferences;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
/**
|
||||
* User preferences for duplicate call detection
|
||||
* User preferences for call management
|
||||
*/
|
||||
public class DuplicateCallDetectionPreference extends Preference
|
||||
public class CallManagementPreference extends Preference
|
||||
{
|
||||
private static final String PREFERENCE_KEY_DETECT_DUPLICATE_TALKGROUP = "duplicate.call.detect.talkgroup";
|
||||
private static final String PREFERENCE_KEY_DETECT_DUPLICATE_RADIO = "duplicate.call.detect.radio";
|
||||
private static final String PREFERENCE_KEY_SUPPRESS_DUPLICATE_PLAYBACK = "suppress.duplicate.audio.playback";
|
||||
private static final String PREFERENCE_KEY_SUPPRESS_DUPLICATE_RECORDING = "suppress.duplicate.audio.recording";
|
||||
private static final String PREFERENCE_KEY_SUPPRESS_DUPLICATE_STREAMING = "suppress.duplicate.audio.streaming";
|
||||
private static final String PREFERENCE_KEY_PATCHGROUP_STREAMING = "patchgroup.streaming";
|
||||
|
||||
private final static Logger mLog = LoggerFactory.getLogger(DuplicateCallDetectionPreference.class);
|
||||
private Preferences mPreferences = Preferences.userNodeForPackage(DuplicateCallDetectionPreference.class);
|
||||
private final static Logger mLog = LoggerFactory.getLogger(CallManagementPreference.class);
|
||||
private Preferences mPreferences = Preferences.userNodeForPackage(CallManagementPreference.class);
|
||||
private Boolean mDuplicateCallDetectionByTalkgroupEnabled;
|
||||
private Boolean mDuplicateCallDetectionByRadioEnabled;
|
||||
private Boolean mDuplicatePlaybackSuppressionEnabled;
|
||||
private Boolean mDuplicateRecordingSuppressionEnabled;
|
||||
private Boolean mDuplicateStreamingSuppressionEnabled;
|
||||
private PatchGroupStreamingOption mPatchGroupStreamingOption;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
* @param updateListener to receive notifications that a preference has been updated
|
||||
*/
|
||||
public DuplicateCallDetectionPreference(Listener<PreferenceType> updateListener)
|
||||
public CallManagementPreference(Listener<PreferenceType> updateListener)
|
||||
{
|
||||
super(updateListener);
|
||||
}
|
||||
@@ -182,6 +184,51 @@ public class DuplicateCallDetectionPreference extends Preference
|
||||
{
|
||||
mPreferences.putBoolean(PREFERENCE_KEY_SUPPRESS_DUPLICATE_STREAMING, enabled);
|
||||
mDuplicateStreamingSuppressionEnabled = enabled;
|
||||
notifyPreferenceUpdated();;
|
||||
notifyPreferenceUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch group streaming option preference.
|
||||
* @return option.
|
||||
*/
|
||||
public PatchGroupStreamingOption getPatchGroupStreamingOption()
|
||||
{
|
||||
if(mPatchGroupStreamingOption == null)
|
||||
{
|
||||
String option = mPreferences.get(PREFERENCE_KEY_PATCHGROUP_STREAMING, PatchGroupStreamingOption.PATCH_GROUP.name());
|
||||
|
||||
if(option != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
mPatchGroupStreamingOption = PatchGroupStreamingOption.valueOf(option);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
//Ignore ... we'll use the default value.
|
||||
}
|
||||
}
|
||||
|
||||
if(mPatchGroupStreamingOption == null)
|
||||
{
|
||||
mPatchGroupStreamingOption = PatchGroupStreamingOption.PATCH_GROUP;
|
||||
}
|
||||
}
|
||||
|
||||
return mPatchGroupStreamingOption;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the patch group streaming option preference.
|
||||
* @param patchGroupStreamingOption preference
|
||||
*/
|
||||
public void setPatchGroupStreamingOption(PatchGroupStreamingOption patchGroupStreamingOption)
|
||||
{
|
||||
if(patchGroupStreamingOption != null)
|
||||
{
|
||||
mPreferences.put(PREFERENCE_KEY_PATCHGROUP_STREAMING, patchGroupStreamingOption.name());
|
||||
mPatchGroupStreamingOption = patchGroupStreamingOption;
|
||||
notifyPreferenceUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user