From c9d38ab363d2062c82f372a63f9e633fba2430f3 Mon Sep 17 00:00:00 2001 From: vsonnier Date: Sat, 24 Mar 2018 09:48:18 +0100 Subject: [PATCH] Fixes #635, round 4, Bookmarkview : always have Start/Stop Recording button irrespective of the actual demod active state --- src/AppFrame.cpp | 8 +++++--- src/forms/Bookmark/BookmarkView.cpp | 14 ++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index d2fa90f..eb116d3 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -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); } diff --git a/src/forms/Bookmark/BookmarkView.cpp b/src/forms/Bookmark/BookmarkView.cpp index d13741c..f60ebeb 100644 --- a/src/forms/Bookmark/BookmarkView.cpp +++ b/src/forms/Bookmark/BookmarkView.cpp @@ -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();