mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 01:27:34 -05:00
Resolves #64 Persist last tuned frequency to tuner configurations
Task-Url: http://github.com/DSheirer/sdrtrunk/issues/issue/64
This commit is contained in:
@@ -31,6 +31,7 @@ public abstract class TunerConfiguration
|
||||
protected String mName;
|
||||
protected String mUniqueID;
|
||||
protected boolean mAssigned;
|
||||
protected long mFrequency;
|
||||
|
||||
/**
|
||||
* Default constructor to support JAXB
|
||||
@@ -86,6 +87,17 @@ public abstract class TunerConfiguration
|
||||
mAssigned = assigned;
|
||||
}
|
||||
|
||||
@XmlAttribute( name = "frequency" )
|
||||
public long getFrequency()
|
||||
{
|
||||
return mFrequency;
|
||||
}
|
||||
|
||||
public void setFrequency( long frequency )
|
||||
{
|
||||
mFrequency = frequency;
|
||||
}
|
||||
|
||||
@XmlAttribute( name = "tuner_type" )
|
||||
public abstract TunerType getTunerType();
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import sample.Listener;
|
||||
import source.tuner.Tuner;
|
||||
import source.tuner.TunerType;
|
||||
import source.tuner.configuration.TunerConfigurationEvent.Event;
|
||||
|
||||
@@ -368,4 +369,16 @@ public class TunerConfigurationModel extends AbstractTableModel
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores the latest tuned frequency for the tuner in the currently assigned configuration
|
||||
*/
|
||||
public void tunerFrequencyChanged( Tuner tuner )
|
||||
{
|
||||
TunerConfiguration assigned = getTunerConfiguration( tuner.getTunerType(), tuner.getUniqueID() );
|
||||
|
||||
assigned.setFrequency( tuner.getTunerController().getFrequency() );
|
||||
|
||||
broadcast( new TunerConfigurationEvent( assigned, Event.CHANGE ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user