Skip to content

Commit

Permalink
Don't show tuner on spectral display while disabled (#1236)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-hoffman committed May 7, 2022
1 parent 925353d commit 36de812
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public ClearTunerMenuItem(SpectralDisplayPanel spectralDisplayPanel)
@Override
public void actionPerformed(ActionEvent e)
{
mSpectralDisplayPanel.clearTuner();
SystemProperties properties = SystemProperties.getInstance();
properties.set(SpectralDisplayPanel.SPECTRAL_DISPLAY_ENABLED, false);
mSpectralDisplayPanel.clearTuner();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public void actionPerformed(ActionEvent e)
@Override
public void run()
{
mDiscoveredTunerModel.broadcast(new TunerEvent(mTuner, TunerEvent.Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
SystemProperties properties = SystemProperties.getInstance();
properties.set(SpectralDisplayPanel.SPECTRAL_DISPLAY_ENABLED, true);
mDiscoveredTunerModel.broadcast(new TunerEvent(mTuner, TunerEvent.Event.REQUEST_MAIN_SPECTRAL_DISPLAY));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ public void process(SourceEvent event)
public void showTuner(Tuner tuner)
{
clearTuner();
if(!SystemProperties.getInstance().get(SpectralDisplayPanel.SPECTRAL_DISPLAY_ENABLED, true))
{
//Spectral display is disabled, stop
return;
}

mComplexDftProcessor.clearBuffer();

Expand Down

0 comments on commit 36de812

Please sign in to comment.