mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 01:27:34 -05:00
Channel Spectral Display
- Adds Channel Spectrum tab to display FFT of the audio output of the currently selected channel - Upgrades to JTransforms 3.0 FFT library - Adds three new context menus to main and channel spectral displays: -- Baseline - affects the vertical rendering baseline of the FFT -- Amplification - affects the vertical height of each FFT bin -- Averaging - affects how many FFTs are averaged to produce the display
This commit is contained in:
30
src/settings/IntegerSetting.java
Normal file
30
src/settings/IntegerSetting.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package settings;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
public class IntegerSetting extends Setting
|
||||
{
|
||||
private int mValue;
|
||||
|
||||
public IntegerSetting()
|
||||
{
|
||||
}
|
||||
|
||||
public IntegerSetting( String name, int value )
|
||||
{
|
||||
super( name );
|
||||
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
@XmlAttribute
|
||||
public int getValue()
|
||||
{
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public void setValue( int value )
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ import source.tuner.rtl.r820t.R820TTunerConfiguration;
|
||||
FCD1TunerConfiguration.class,
|
||||
FCD2TunerConfiguration.class,
|
||||
FileSetting.class,
|
||||
IntegerSetting.class,
|
||||
MapViewSetting.class,
|
||||
MapIcon.class,
|
||||
R820TTunerConfiguration.class,
|
||||
@@ -177,6 +178,20 @@ public class Settings
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public IntegerSetting getIntegerSetting( String name )
|
||||
{
|
||||
for( Setting setting: mSettings )
|
||||
{
|
||||
if( setting instanceof IntegerSetting &&
|
||||
((IntegerSetting)setting).getName().contentEquals( name ) )
|
||||
{
|
||||
return (IntegerSetting)setting;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ColorSetting getColorSetting( ColorSettingName name )
|
||||
{
|
||||
|
||||
@@ -143,6 +143,33 @@ public class SettingsManager
|
||||
return mSettings.getSetting( name );
|
||||
}
|
||||
|
||||
public IntegerSetting getIntegerSetting( String name, int defaultValue )
|
||||
{
|
||||
IntegerSetting setting = mSettings.getIntegerSetting( name );
|
||||
|
||||
if( setting == null )
|
||||
{
|
||||
setting = new IntegerSetting( name, defaultValue );
|
||||
|
||||
mSettings.addSetting( setting );
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
return setting;
|
||||
}
|
||||
|
||||
public void setIntegerSetting( String name, int value )
|
||||
{
|
||||
IntegerSetting setting = getIntegerSetting( name, value );
|
||||
|
||||
setting.setValue( value );
|
||||
|
||||
save();
|
||||
|
||||
broadcastSettingChange( setting );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current setting, or if the setting doesn't exist
|
||||
* returns a newly created setting with the specified parameters
|
||||
|
||||
Reference in New Issue
Block a user