mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-11 03:07:55 -04:00
Demod visual activation when entering/leaving view
This commit is contained in:
parent
b78b4e1b96
commit
4218fb73a0
@ -34,7 +34,7 @@ EVT_IDLE(AppFrame::OnIdle)
|
|||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
AppFrame::AppFrame() :
|
AppFrame::AppFrame() :
|
||||||
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
|
||||||
|
|
||||||
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
|
||||||
wxBoxSizer *demodOpts = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *demodOpts = new wxBoxSizer(wxVERTICAL);
|
||||||
@ -405,6 +405,11 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
|
|||||||
mgr->setLastGain(demodGainMeter->getInputValue());
|
mgr->setLastGain(demodGainMeter->getInputValue());
|
||||||
demodGainMeter->setLevel(demodGainMeter->getInputValue());
|
demodGainMeter->setLevel(demodGainMeter->getInputValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wxGetApp().getFrequency() != demodWaterfallCanvas->getCenterFrequency()) {
|
||||||
|
demodWaterfallCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
||||||
|
demodSpectrumCanvas->setCenterFrequency(wxGetApp().getFrequency());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!waterfallCanvas->HasFocus()) {
|
if (!waterfallCanvas->HasFocus()) {
|
||||||
|
@ -115,6 +115,9 @@ void DemodulatorMgr::setActiveDemodulator(DemodulatorInstance *demod, bool tempo
|
|||||||
}
|
}
|
||||||
|
|
||||||
DemodulatorInstance *DemodulatorMgr::getActiveDemodulator() {
|
DemodulatorInstance *DemodulatorMgr::getActiveDemodulator() {
|
||||||
|
if (activeDemodulator && !activeDemodulator->isActive()) {
|
||||||
|
activeDemodulator = getLastActiveDemodulator();
|
||||||
|
}
|
||||||
return activeDemodulator;
|
return activeDemodulator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +147,16 @@ void DemodulatorMgr::garbageCollect() {
|
|||||||
|
|
||||||
void DemodulatorMgr::updateLastState() {
|
void DemodulatorMgr::updateLastState() {
|
||||||
if (std::find(demods.begin(), demods.end(), lastActiveDemodulator) == demods.end()) {
|
if (std::find(demods.begin(), demods.end(), lastActiveDemodulator) == demods.end()) {
|
||||||
lastActiveDemodulator = activeDemodulator;
|
if (activeDemodulator && activeDemodulator->isActive()) {
|
||||||
|
lastActiveDemodulator = activeDemodulator;
|
||||||
|
} else if (activeDemodulator && !activeDemodulator->isActive()){
|
||||||
|
activeDemodulator = NULL;
|
||||||
|
lastActiveDemodulator = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastActiveDemodulator && !lastActiveDemodulator->isActive()) {
|
||||||
|
lastActiveDemodulator = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastActiveDemodulator) {
|
if (lastActiveDemodulator) {
|
||||||
|
@ -196,6 +196,9 @@ void SDRPostThread::threadMain() {
|
|||||||
}
|
}
|
||||||
} else if (!demod->isActive()) {
|
} else if (!demod->isActive()) {
|
||||||
demod->setActive(true);
|
demod->setActive(true);
|
||||||
|
if (wxGetApp().getDemodMgr().getLastActiveDemodulator() == NULL) {
|
||||||
|
wxGetApp().getDemodMgr().setActiveDemodulator(demod);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!demod->isActive()) {
|
if (!demod->isActive()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user