mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-07 07:38:00 -04:00
Prevent solo-squelch focus from interrupting user actions; acts as temporary hold as well
This commit is contained in:
parent
ad7779de53
commit
6ede20c3e8
@ -1928,6 +1928,16 @@ void AppFrame::refreshGainUI() {
|
|||||||
gainCanvas->Refresh();
|
gainCanvas->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AppFrame::isUserDemodBusy() {
|
||||||
|
return (modemProps && modemProps->isMouseInView())
|
||||||
|
|| (waterfallCanvas->isMouseInView() && waterfallCanvas->isMouseDown())
|
||||||
|
|| (demodWaterfallCanvas->isMouseInView() && demodWaterfallCanvas->isMouseDown())
|
||||||
|
|| (wxGetApp().getDemodMgr().getLastActiveDemodulator() &&
|
||||||
|
wxGetApp().getDemodMgr().getActiveDemodulator() &&
|
||||||
|
wxGetApp().getDemodMgr().getLastActiveDemodulator() != wxGetApp().getDemodMgr().getActiveDemodulator());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bool AppFrame::canFocus() {
|
bool AppFrame::canFocus() {
|
||||||
return (!wxGetApp().isDeviceSelectorOpen() && (!modemProps || !modemProps->isMouseInView()));
|
return (!wxGetApp().isDeviceSelectorOpen() && (!modemProps || !modemProps->isMouseInView()));
|
||||||
|
@ -101,6 +101,8 @@ public:
|
|||||||
void setViewState(long long center_freq, int bandwidth);
|
void setViewState(long long center_freq, int bandwidth);
|
||||||
void setViewState(long long center_freq);
|
void setViewState(long long center_freq);
|
||||||
|
|
||||||
|
bool isUserDemodBusy();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
bool canFocus();
|
bool canFocus();
|
||||||
#endif
|
#endif
|
||||||
|
@ -192,7 +192,7 @@ void DemodulatorThread::run() {
|
|||||||
|
|
||||||
if (squelchEnabled) {
|
if (squelchEnabled) {
|
||||||
if (!squelched && !squelchBreak) {
|
if (!squelched && !squelchBreak) {
|
||||||
if (wxGetApp().getSoloMode()) {
|
if (wxGetApp().getSoloMode() && !wxGetApp().getAppFrame()->isUserDemodBusy()) {
|
||||||
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
||||||
if (squelchLock.load() == nullptr) {
|
if (squelchLock.load() == nullptr) {
|
||||||
squelchLock.store(demodInstance);
|
squelchLock.store(demodInstance);
|
||||||
@ -406,7 +406,7 @@ bool DemodulatorThread::getSquelchBreak() {
|
|||||||
|
|
||||||
void DemodulatorThread::releaseSquelchLock(DemodulatorInstance *inst) {
|
void DemodulatorThread::releaseSquelchLock(DemodulatorInstance *inst) {
|
||||||
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
std::lock_guard < std::mutex > lock(squelchLockMutex);
|
||||||
if (squelchLock.load() == inst) {
|
if (inst == nullptr || squelchLock.load() == inst) {
|
||||||
squelchLock.store(nullptr);
|
squelchLock.store(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -183,3 +183,11 @@ void InteractiveCanvas::OnMouseRightDown(wxMouseEvent& event) {
|
|||||||
void InteractiveCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
void InteractiveCanvas::OnMouseRightReleased(wxMouseEvent& event) {
|
||||||
mouseTracker.OnMouseRightReleased(event);
|
mouseTracker.OnMouseRightReleased(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InteractiveCanvas::isMouseInView() {
|
||||||
|
return mouseTracker.mouseInView();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool InteractiveCanvas::isMouseDown() {
|
||||||
|
return mouseTracker.mouseInView() && mouseTracker.mouseDown();
|
||||||
|
}
|
||||||
|
@ -25,7 +25,9 @@ public:
|
|||||||
unsigned int getBandwidth();
|
unsigned int getBandwidth();
|
||||||
|
|
||||||
MouseTracker *getMouseTracker();
|
MouseTracker *getMouseTracker();
|
||||||
|
bool isMouseInView();
|
||||||
|
bool isMouseDown();
|
||||||
|
|
||||||
bool isAltDown();
|
bool isAltDown();
|
||||||
bool isCtrlDown();
|
bool isCtrlDown();
|
||||||
bool isShiftDown();
|
bool isShiftDown();
|
||||||
|
@ -730,6 +730,7 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
|||||||
demod->run();
|
demod->run();
|
||||||
|
|
||||||
wxGetApp().bindDemodulator(demod);
|
wxGetApp().bindDemodulator(demod);
|
||||||
|
DemodulatorThread::releaseSquelchLock(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!demod) {
|
if (!demod) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user