Fixes #635, round 4, Bookmarkview : always have Start/Stop Recording button irrespective of the actual demod active state

This commit is contained in:
vsonnier 2018-03-24 09:48:18 +01:00
parent a25253e745
commit c9d38ab363
2 changed files with 11 additions and 11 deletions

View File

@ -2971,19 +2971,21 @@ void AppFrame::toggleAllActiveDemodRecording() {
return;
}
auto activeDemods = wxGetApp().getDemodMgr().getDemodulators();
// All demods, irrespective of their active state:
// recording will start eventually when a demod come in range.
auto allDemods = wxGetApp().getDemodMgr().getDemodulators();
//by default, do a false => true for all:
bool stateToSet = true;
for (auto i : activeDemods) {
for (auto i : allDemods) {
if (i->isRecording()) {
stateToSet = false;
break;
}
}
for (auto i : activeDemods) {
for (auto i : allDemods) {
i->setRecording(stateToSet);
}

View File

@ -845,14 +845,12 @@ void BookmarkView::activeSelection(DemodulatorInstancePtr dsel) {
addBookmarkChoice(m_buttonPanel);
if (dsel->isActive()) {
if (!(dsel->isRecording())) {
addButton(m_buttonPanel, "Start Recording", wxCommandEventHandler(BookmarkView::onStartRecording));
} else {
addButton(m_buttonPanel, "Stop Recording", wxCommandEventHandler(BookmarkView::onStopRecording));
}
}
if (!(dsel->isRecording())) {
addButton(m_buttonPanel, "Start Recording", wxCommandEventHandler(BookmarkView::onStartRecording));
} else {
addButton(m_buttonPanel, "Stop Recording", wxCommandEventHandler(BookmarkView::onStopRecording));
}
addButton(m_buttonPanel, "Remove Active", wxCommandEventHandler( BookmarkView::onRemoveActive ));
showProps();