mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-01 21:54:39 -04:00
Manage B key correctly activated for spectrum, not waterfall. Add another independent B (dB) key for audio scope
This commit is contained in:
@@ -45,7 +45,10 @@ ScopeCanvas::ScopeCanvas(wxWindow *parent, int *dispAttrs) : InteractiveCanvas(p
|
||||
parentPanel.setFill(GLPanel::GLPANEL_FILL_NONE);
|
||||
scopePanel.setSize(1.0,-1.0);
|
||||
spectrumPanel.setSize(1.0,-1.0);
|
||||
spectrumPanel.setShowDb(true);
|
||||
showDb = true;
|
||||
spectrumPanel.setShowDb(showDb);
|
||||
//dB offset is a RF value, has no meaning in audio, disable it.
|
||||
spectrumPanel.setUseDBOffset(false);
|
||||
}
|
||||
|
||||
ScopeCanvas::~ScopeCanvas() {
|
||||
@@ -89,8 +92,8 @@ bool ScopeCanvas::getPPMMode() {
|
||||
return ppmMode;
|
||||
}
|
||||
|
||||
void ScopeCanvas::setShowDb(bool showDb) {
|
||||
this->showDb = showDb;
|
||||
void ScopeCanvas::setShowDb(bool show) {
|
||||
this->showDb = show;
|
||||
}
|
||||
|
||||
bool ScopeCanvas::getShowDb() {
|
||||
@@ -275,3 +278,20 @@ void ScopeCanvas::setHelpTip(std::string tip) {
|
||||
helpTip = tip;
|
||||
}
|
||||
|
||||
void ScopeCanvas::OnKeyDown(wxKeyEvent& event) {
|
||||
InteractiveCanvas::OnKeyDown(event);
|
||||
|
||||
switch (event.GetKeyCode()) {
|
||||
|
||||
case 'B':
|
||||
setShowDb(!getShowDb());
|
||||
break;
|
||||
default:
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void ScopeCanvas::OnKeyUp(wxKeyEvent& event) {
|
||||
InteractiveCanvas::OnKeyUp(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,16 @@ public:
|
||||
ScopeCanvas(wxWindow *parent, int *dispAttrs);
|
||||
~ScopeCanvas();
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
//AppFrame::OnGlobalKeyDown, because global key handler intercepts
|
||||
//calls in all windows.
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
//AppFrame::OnGlobalKeyUp, because global key handler intercepts
|
||||
//calls in all windows.
|
||||
void OnKeyUp(wxKeyEvent& event);
|
||||
|
||||
void setDeviceName(std::string device_name);
|
||||
void setPPMMode(bool ppmMode);
|
||||
bool getPPMMode();
|
||||
|
||||
@@ -310,3 +310,20 @@ void SpectrumCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||
}
|
||||
mouseTracker.OnMouseRightReleased(event);
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnKeyDown(wxKeyEvent& event) {
|
||||
InteractiveCanvas::OnKeyDown(event);
|
||||
|
||||
switch (event.GetKeyCode()) {
|
||||
|
||||
case 'B':
|
||||
setShowDb(!getShowDb());
|
||||
break;
|
||||
default:
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void SpectrumCanvas::OnKeyUp(wxKeyEvent& event) {
|
||||
InteractiveCanvas::OnKeyUp(event);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,16 @@ public:
|
||||
SpectrumCanvas(wxWindow *parent, int *dispAttrs);
|
||||
~SpectrumCanvas();
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
//AppFrame::OnGlobalKeyDown, because global key handler intercepts
|
||||
//calls in all windows.
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
//AppFrame::OnGlobalKeyUp, because global key handler intercepts
|
||||
//calls in all windows.
|
||||
void OnKeyUp(wxKeyEvent& event);
|
||||
|
||||
void attachWaterfallCanvas(WaterfallCanvas *canvas_in);
|
||||
void moveCenterFrequency(long long freqChange);
|
||||
|
||||
@@ -50,6 +60,7 @@ private:
|
||||
void OnMouseRightDown(wxMouseEvent& event);
|
||||
void OnMouseRightReleased(wxMouseEvent& event);
|
||||
|
||||
|
||||
void updateScaleFactor(float factor);
|
||||
|
||||
PrimaryGLContext *glContext;
|
||||
|
||||
@@ -440,11 +440,6 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
||||
wxGetApp().removeDemodulator(activeDemod);
|
||||
wxGetApp().getDemodMgr().deleteThread(activeDemod);
|
||||
break;
|
||||
case 'B':
|
||||
if (spectrumCanvas) {
|
||||
spectrumCanvas->setShowDb(!spectrumCanvas->getShowDb());
|
||||
}
|
||||
break;
|
||||
case WXK_SPACE:
|
||||
wxGetApp().showFrequencyInput();
|
||||
break;
|
||||
|
||||
@@ -36,10 +36,21 @@ public:
|
||||
void setLinesPerSecond(int lps);
|
||||
void setMinBandwidth(int min);
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
//AppFrame::OnGlobalKeyDown, because global key handler intercepts
|
||||
//calls in all windows.
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
|
||||
//This is public because it is indeed forwarded from
|
||||
//AppFrame::OnGlobalKeyUp, because global key handler intercepts
|
||||
//calls in all windows.
|
||||
void OnKeyUp(wxKeyEvent& event);
|
||||
|
||||
//public because called by SpectrumCanvas.
|
||||
void OnMouseWheelMoved(wxMouseEvent& event);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnIdle(wxIdleEvent &event);
|
||||
|
||||
Reference in New Issue
Block a user