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:
GTR8000
2026-10-30 03:43:36 -04:00
committed by GitHub
parent 248fe3e4f7
commit d86fba6945
6 changed files with 117 additions and 0 deletions

View File

@@ -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());
}
}

View File

@@ -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;