Resolved #370 Tuner Editor Lock State

Resolves an issue with the previous implementation where the tuner
editor was being refreshed repeatedly to update the lock state for the
tuner, rendering the editor almost completely unusable.

Now updates only the frequency control and the sample rate control to
reflect the tuner's lock state.
This commit is contained in:
Denny
2018-07-15 05:55:28 -04:00
parent b3d5daea8b
commit 0d69f11e65
9 changed files with 75 additions and 5 deletions

View File

@@ -100,12 +100,20 @@ public class TunerViewPanel extends JPanel
switch(tunerEvent.getEvent())
{
case LOCK_STATE_CHANGE:
int row = mTunerTable.getSelectedRow();
if(row >= 0)
if(tunerEvent.getTuner() != null)
{
int modelRow = mTunerTable.convertRowIndexToModel(row);
mTunerEditor.setItem(mTunerModel.getTuner(modelRow));
int row = mTunerTable.getSelectedRow();
if(row >= 0)
{
int modelRow = mTunerTable.convertRowIndexToModel(row);
Tuner selectedTuner = mTunerModel.getTuner(modelRow);
if(selectedTuner == tunerEvent.getTuner())
{
mTunerEditor.setTunerLockState(selectedTuner.getTunerController().isLocked());
}
}
}
break;
}