[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:
Denny
2018-02-04 06:30:25 -05:00
parent 85691edacb
commit 96d9d6f750
14 changed files with 3271 additions and 3031 deletions

View File

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