mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-09-06 07:07:48 -04:00
Transparent demod overlay on waterfall
This commit is contained in:
parent
874746b1d4
commit
0bc31eed6c
@ -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(
|
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) {
|
1), resampler(NULL), commandQueue(NULL), fir_filter(NULL) {
|
||||||
|
|
||||||
float kf = 0.75; // modulation factor
|
float kf = 0.5; // modulation factor
|
||||||
fdem = freqdem_create(kf);
|
fdem = freqdem_create(kf);
|
||||||
// freqdem_print(fdem);
|
// freqdem_print(fdem);
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mTracker.mouseInView()) {
|
if (mTracker.mouseInView()) {
|
||||||
glContext->DrawFreqSelector(mTracker.getMouseX());
|
glContext->DrawFreqSelector(mTracker.getMouseX(),0,1,0);
|
||||||
}
|
}
|
||||||
glContext->EndDraw();
|
glContext->EndDraw();
|
||||||
|
|
||||||
|
@ -92,7 +92,9 @@ void WaterfallContext::DrawDemod(DemodulatorInstance *demod) {
|
|||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_TEXTURE_2D);
|
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);
|
glBegin(GL_LINES);
|
||||||
glVertex3f((uxPos - 0.5) * 2.0, 1.0, 0.0);
|
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);
|
glVertex3f((uxPos - 0.5) * 2.0 + ofs, -1.0, 0.0);
|
||||||
|
|
||||||
glEnd();
|
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);
|
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();
|
DemodulatorInstance *demod = wxGetApp().getDemodTest();
|
||||||
|
|
||||||
if (!demod) {
|
if (!demod) {
|
||||||
@ -121,7 +135,9 @@ void WaterfallContext::DrawFreqSelector(float uxPos) {
|
|||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_TEXTURE_2D);
|
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);
|
glBegin(GL_LINES);
|
||||||
glVertex3f((uxPos - 0.5) * 2.0, 1.0, 0.0);
|
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);
|
glVertex3f((uxPos - 0.5) * 2.0 + ofs, -1.0, 0.0);
|
||||||
|
|
||||||
glEnd();
|
glEnd();
|
||||||
|
glDisable(GL_BLEND);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public:
|
|||||||
|
|
||||||
void BeginDraw();
|
void BeginDraw();
|
||||||
void Draw(std::vector<float> &points);
|
void Draw(std::vector<float> &points);
|
||||||
void DrawFreqSelector(float uxPos);
|
void DrawFreqSelector(float uxPos, float r, float g, float b);
|
||||||
void DrawDemod(DemodulatorInstance *demod);
|
void DrawDemod(DemodulatorInstance *demod);
|
||||||
void EndDraw();
|
void EndDraw();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user