From 43b30367d93547c751689c2713717a23e16891f5 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Wed, 9 Sep 2015 23:46:05 -0400 Subject: [PATCH] Visual queue smoothing tweak --- src/process/FFTDataDistributor.cpp | 4 ++-- src/visual/WaterfallCanvas.cpp | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/process/FFTDataDistributor.cpp b/src/process/FFTDataDistributor.cpp index 2f78953..99bb38f 100644 --- a/src/process/FFTDataDistributor.cpp +++ b/src/process/FFTDataDistributor.cpp @@ -16,7 +16,7 @@ int FFTDataDistributor::getLinesPerSecond() { } void FFTDataDistributor::process() { - if (!input->empty()) { + while (!input->empty()) { if (!isAnyOutputEmpty()) { return; } @@ -33,7 +33,7 @@ void FFTDataDistributor::process() { } inp->decRefCount(); } else { - return; + continue; } // number of seconds contained in input diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 1ae983f..84c450e 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -113,7 +113,7 @@ void WaterfallCanvas::processInputQueue() { } } if (processed) { -// Refresh(); + Refresh(); } } @@ -427,11 +427,11 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) { } void WaterfallCanvas::OnIdle(wxIdleEvent &event) { - Refresh(); +// Refresh(); // processInputQueue(); // Refresh(); - event.RequestMore(); -// event.Skip(); +// event.RequestMore(); + event.Skip(); } void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) { @@ -821,6 +821,15 @@ void WaterfallCanvas::updateCenterFrequency(long long freq) { void WaterfallCanvas::setLinesPerSecond(int lps) { linesPerSecond = lps; + while (!visualDataQueue.empty()) { + SpectrumVisualData *vData; + visualDataQueue.pop(vData); + + if (vData) { + vData->decRefCount(); + } + } + }