mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
[WIP] Adds locking mechanism to tuner controllers so that the
polyphase channel manager can block users from changing frequency and/or sample rate when polyphase channels are allocated.
This commit is contained in:
@@ -104,6 +104,37 @@ public abstract class TunerController implements Tunable, ISourceEventProcessor,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the frequency and sample rate controls are locked by another process. User interface controls
|
||||
* should monitor source events and check the locked state via this method to correctly render the enabled state
|
||||
* of the frequency and sample rate controls.
|
||||
*
|
||||
* @return true if the tuner controller is locked.
|
||||
*/
|
||||
public boolean isLocked()
|
||||
{
|
||||
return mFrequencyController.isLocked();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frequency and sample rate locked state to the locked argument value. This should only be changed
|
||||
* by a downstream consumer of samples to prevent users or other processes from modifying the center frequency
|
||||
* and/or sample rate of the tuner while processing samples.
|
||||
*
|
||||
* @param locked true to indicate the tuner controller is in a locked state, otherwise false.
|
||||
*/
|
||||
public void setLocked(boolean locked)
|
||||
{
|
||||
try
|
||||
{
|
||||
mFrequencyController.setLocked(locked);
|
||||
}
|
||||
catch(SourceException se)
|
||||
{
|
||||
mLog.error("Couldn't set frequency controller locked state to: " + locked);
|
||||
}
|
||||
}
|
||||
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mFrequencyController.getBandwidth();
|
||||
|
||||
Reference in New Issue
Block a user