mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-23 20:28:40 -05:00
Move mute handler to global keys; now works with selected + hovered
This commit is contained in:
parent
c33a359153
commit
8f2ce9f6dc
@ -1916,6 +1916,7 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
|
|||||||
case 'U':
|
case 'U':
|
||||||
case 'S':
|
case 'S':
|
||||||
case 'P':
|
case 'P':
|
||||||
|
case 'M':
|
||||||
return 1;
|
return 1;
|
||||||
case '0':
|
case '0':
|
||||||
case '1':
|
case '1':
|
||||||
@ -1966,6 +1967,7 @@ int AppFrame::OnGlobalKeyUp(wxKeyEvent &event) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||||
DemodulatorInstance *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
DemodulatorInstance *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
|
||||||
|
|
||||||
#ifdef wxHAS_RAW_KEY_CODES
|
#ifdef wxHAS_RAW_KEY_CODES
|
||||||
@ -1995,8 +1997,8 @@ int AppFrame::OnGlobalKeyUp(wxKeyEvent &event) {
|
|||||||
waterfallCanvas->OnKeyUp(event);
|
waterfallCanvas->OnKeyUp(event);
|
||||||
return 1;
|
return 1;
|
||||||
case 'V':
|
case 'V':
|
||||||
if (wxGetApp().getDemodMgr().getActiveDemodulator()) {
|
if (activeDemod) {
|
||||||
lastDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
lastDemod = activeDemod;
|
||||||
}
|
}
|
||||||
if (lastDemod && lastDemod->isDeltaLock()) {
|
if (lastDemod && lastDemod->isDeltaLock()) {
|
||||||
lastDemod->setDeltaLock(false);
|
lastDemod->setDeltaLock(false);
|
||||||
@ -2040,6 +2042,14 @@ int AppFrame::OnGlobalKeyUp(wxKeyEvent &event) {
|
|||||||
case ']':
|
case ']':
|
||||||
case '[':
|
case '[':
|
||||||
return 1;
|
return 1;
|
||||||
|
case 'M':
|
||||||
|
if (activeDemod) {
|
||||||
|
lastDemod = activeDemod;
|
||||||
|
}
|
||||||
|
if (lastDemod) {
|
||||||
|
lastDemod->setMuted(!lastDemod->isMuted());
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -437,12 +437,6 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
|||||||
wxGetApp().removeDemodulator(activeDemod);
|
wxGetApp().removeDemodulator(activeDemod);
|
||||||
wxGetApp().getDemodMgr().deleteThread(activeDemod);
|
wxGetApp().getDemodMgr().deleteThread(activeDemod);
|
||||||
break;
|
break;
|
||||||
case 'M':
|
|
||||||
if (!activeDemod) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
activeDemod->setMuted(!activeDemod->isMuted());
|
|
||||||
break;
|
|
||||||
case 'B':
|
case 'B':
|
||||||
if (spectrumCanvas) {
|
if (spectrumCanvas) {
|
||||||
spectrumCanvas->setShowDb(!spectrumCanvas->getShowDb());
|
spectrumCanvas->setShowDb(!spectrumCanvas->getShowDb());
|
||||||
|
Loading…
Reference in New Issue
Block a user