mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Add optional legacy JMBE tone levels to digital channel editors (#2511)
Persist the per-channel selection, preserve it when copying configurations, and transfer it to mixed-phase P25 traffic channels. Apply only when the loaded codec advertises support. Calibrated levels remain the default.
This commit is contained in:
@@ -571,6 +571,12 @@ public class DecoderFactory
|
||||
{
|
||||
List<String> features = audioModule.getFeatures();
|
||||
|
||||
String legacyToneFeature = "feature_legacy_tone_levels";
|
||||
if(features.contains(legacyToneFeature))
|
||||
{
|
||||
audioModule.setFeature(legacyToneFeature, config.isLegacyToneLevels());
|
||||
}
|
||||
|
||||
if(features.contains(IAudioCodecV2.FEATURE_AUTOMATIC_GAIN_CONTROL))
|
||||
{
|
||||
audioModule.setFeature(IAudioCodecV2.FEATURE_AUTOMATIC_GAIN_CONTROL, config.isAGC());
|
||||
@@ -952,5 +958,6 @@ public class DecoderFactory
|
||||
to.setAGC(from.isAGC());
|
||||
to.setNoiseGain(from.getNoiseGain());
|
||||
to.setToneGain(from.getToneGain());
|
||||
to.setLegacyToneLevels(from.isLegacyToneLevels());
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,22 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
public abstract class DecodeConfigJMBE extends DecodeConfiguration
|
||||
{
|
||||
private boolean mAGC = true;
|
||||
private boolean mLegacyToneLevels;
|
||||
|
||||
/**
|
||||
* Optional legacy AMBE tone amplitude mapping. Disabled by default.
|
||||
* Requires a JMBE library supporting feature_legacy_tone_levels.
|
||||
*/
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "jmbeLegacyToneLevels", namespace = "http://www.w3.org/2001/XMLSchema-instance")
|
||||
public boolean isLegacyToneLevels()
|
||||
{
|
||||
return mLegacyToneLevels;
|
||||
}
|
||||
|
||||
public void setLegacyToneLevels(boolean enabled)
|
||||
{
|
||||
mLegacyToneLevels = enabled;
|
||||
}
|
||||
private float mToneGain = 1.0f;
|
||||
private float mNoiseGain = 1.0f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user