diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index e873400..7588521 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -6,7 +6,7 @@ DemodulatorThread::DemodulatorThread(DemodulatorThreadInputQueue* pQueue) : inputQueue(pQueue), visOutQueue(NULL), terminated(false), initialized(false), audio_resampler(NULL), resample_ratio(1), audio_resample_ratio( 1), resampler(NULL), commandQueue(NULL), fir_filter(NULL) { - float kf = 0.75; // modulation factor + float kf = 0.5; // modulation factor fdem = freqdem_create(kf); // freqdem_print(fdem); diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 971daa0..d763541 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -71,7 +71,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { } if (mTracker.mouseInView()) { - glContext->DrawFreqSelector(mTracker.getMouseX()); + glContext->DrawFreqSelector(mTracker.getMouseX(),0,1,0); } glContext->EndDraw(); diff --git a/src/visual/WaterfallContext.cpp b/src/visual/WaterfallContext.cpp index 7c10522..e7fd6f3 100644 --- a/src/visual/WaterfallContext.cpp +++ b/src/visual/WaterfallContext.cpp @@ -92,7 +92,9 @@ void WaterfallContext::DrawDemod(DemodulatorInstance *demod) { glDisable(GL_DEPTH_TEST); glDisable(GL_TEXTURE_2D); - glColor3f(1.0, 1.0, 1.0); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR); + glColor4f(1.0, 1.0, 1.0, 0.6); glBegin(GL_LINES); glVertex3f((uxPos - 0.5) * 2.0, 1.0, 0.0); @@ -107,11 +109,23 @@ void WaterfallContext::DrawDemod(DemodulatorInstance *demod) { glVertex3f((uxPos - 0.5) * 2.0 + ofs, -1.0, 0.0); glEnd(); + + glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR); + glColor4f(1.0, 1.0, 1.0, 0.2); + glBegin(GL_QUADS); + glVertex3f((uxPos - 0.5) * 2.0 - ofs, 1.0, 0.0); + glVertex3f((uxPos - 0.5) * 2.0 - ofs, -1.0, 0.0); + + glVertex3f((uxPos - 0.5) * 2.0 + ofs, -1.0, 0.0); + glVertex3f((uxPos - 0.5) * 2.0 + ofs, 1.0, 0.0); + glEnd(); + + glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); } -void WaterfallContext::DrawFreqSelector(float uxPos) { +void WaterfallContext::DrawFreqSelector(float uxPos, float r = 1, float g = 1, float b = 1) { DemodulatorInstance *demod = wxGetApp().getDemodTest(); if (!demod) { @@ -121,7 +135,9 @@ void WaterfallContext::DrawFreqSelector(float uxPos) { glDisable(GL_DEPTH_TEST); glDisable(GL_TEXTURE_2D); - glColor3f(1.0, 1.0, 1.0); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_DST_COLOR); + glColor4f(r, g, b, 0.6); glBegin(GL_LINES); glVertex3f((uxPos - 0.5) * 2.0, 1.0, 0.0); @@ -136,6 +152,7 @@ void WaterfallContext::DrawFreqSelector(float uxPos) { glVertex3f((uxPos - 0.5) * 2.0 + ofs, -1.0, 0.0); glEnd(); + glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); } diff --git a/src/visual/WaterfallContext.h b/src/visual/WaterfallContext.h index 176a420..74db958 100644 --- a/src/visual/WaterfallContext.h +++ b/src/visual/WaterfallContext.h @@ -14,7 +14,7 @@ public: void BeginDraw(); void Draw(std::vector &points); - void DrawFreqSelector(float uxPos); + void DrawFreqSelector(float uxPos, float r, float g, float b); void DrawDemod(DemodulatorInstance *demod); void EndDraw();