MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / processInputQueue

Method processInputQueue

src/visual/WaterfallCanvas.cpp:89–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void WaterfallCanvas::processInputQueue() {
90 std::lock_guard < std::mutex > lock(tex_update);
91
92 gTimer.update();
93
94 double targetVis = 1.0 / (double)linesPerSecond;
95 lpsIndex += gTimer.lastUpdateSeconds();
96
97 bool updated = false;
98 if (linesPerSecond) {
99 if (lpsIndex >= targetVis) {
100 while (lpsIndex >= targetVis) {
101 SpectrumVisualDataPtr vData;
102
103 if (visualDataQueue->try_pop(vData)) {
104
105 if (vData) {
106 if (vData->spectrum_points.size() == fft_size * 2) {
107 waterfallPanel.setPoints(vData->spectrum_points);
108 }
109 waterfallPanel.step();
110
111 updated = true;
112 }
113 lpsIndex-=targetVis;
114 } else {
115 break;
116 }
117 }
118 }
119 }
120 if (updated) {
121 wxClientDC(this);
122 glContext->SetCurrent(*this);
123 waterfallPanel.update();
124 }
125
126}
127
128void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
129 std::lock_guard < std::mutex > lock(tex_update);

Callers

nothing calls this directly

Calls 6

lastUpdateSecondsMethod · 0.80
try_popMethod · 0.80
updateMethod · 0.45
sizeMethod · 0.45
setPointsMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected