mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-12 23:26:10 -05:00
Add center line for hovered/new/move state modems
This commit is contained in:
parent
b250825595
commit
29d411cead
@ -59,7 +59,7 @@ PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContex
|
||||
//#endif
|
||||
}
|
||||
|
||||
void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, long long center_freq, long long srate) {
|
||||
void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, long long center_freq, long long srate, bool centerline) {
|
||||
if (!demod) {
|
||||
return;
|
||||
}
|
||||
@ -143,6 +143,13 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l
|
||||
glEnd();
|
||||
}
|
||||
|
||||
if (centerline) {
|
||||
glColor4f(color.r, color.g, color.b, 0.5);
|
||||
glBegin(GL_LINES);
|
||||
glVertex3f(uxPos, 1.0, 0.0);
|
||||
glVertex3f(uxPos, -1.0, 0.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glColor4f(1.0, 1.0, 1.0, 0.8);
|
||||
|
||||
@ -170,7 +177,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l
|
||||
|
||||
}
|
||||
|
||||
void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long long center_freq, long long srate, bool stack) {
|
||||
void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long long center_freq, long long srate, bool stack, bool centerline) {
|
||||
if (!srate) {
|
||||
srate = wxGetApp().getSampleRate();
|
||||
}
|
||||
@ -231,6 +238,14 @@ void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long
|
||||
glVertex3f(uxPos + ofsRight, hPos + labelHeight, 0.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
if (centerline) {
|
||||
glColor4f(color.r, color.g, color.b, 0.5);
|
||||
glBegin(GL_LINES);
|
||||
glVertex3f(uxPos, 1.0, 0.0);
|
||||
glVertex3f(uxPos, -1.0, 0.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glColor4f(1.0, 1.0, 1.0, 0.8);
|
||||
|
||||
|
@ -24,8 +24,8 @@ public:
|
||||
void DrawFreqSelector(float uxPos, RGBA4f color, float w = 0, long long center_freq = -1, long long srate = 0);
|
||||
void DrawRangeSelector(float uxPos1, float uxPos2, RGBA4f color);
|
||||
void DrawDemod(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0);
|
||||
void DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0);
|
||||
void DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long long center_freq = - 1, long long srate = 0, bool stack = false);
|
||||
void DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, long long center_freq = -1, long long srate = 0, bool centerline = false);
|
||||
void DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long long center_freq = - 1, long long srate = 0, bool stack = false, bool centerline = false);
|
||||
|
||||
void setHoverAlpha(float hoverAlpha);
|
||||
|
||||
|
@ -92,13 +92,18 @@ void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
|
||||
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();
|
||||
|
||||
DemodulatorInstance *activeDemodulator = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||
|
||||
for (int i = 0, iMax = demods.size(); i < iMax; i++) {
|
||||
glContext->DrawDemodInfo(demods[i], ThemeMgr::mgr.currentTheme->fftHighlight, getCenterFrequency(), getBandwidth());
|
||||
if (!demods[i]->isActive()) {
|
||||
continue;
|
||||
}
|
||||
glContext->DrawDemodInfo(demods[i], ThemeMgr::mgr.currentTheme->fftHighlight, getCenterFrequency(), getBandwidth(), activeDemodulator==demods[i]);
|
||||
}
|
||||
|
||||
if (waterfallCanvas) {
|
||||
if (waterfallCanvas && !activeDemodulator) {
|
||||
MouseTracker *wfmt = waterfallCanvas->getMouseTracker();
|
||||
if (wfmt->mouseInView() && !wxGetApp().getDemodMgr().getActiveDemodulator()) {
|
||||
if (wfmt->mouseInView()) {
|
||||
int snap = wxGetApp().getFrequencySnap();
|
||||
|
||||
long long freq = getFrequencyAt(wfmt->getMouseX());
|
||||
@ -111,7 +116,7 @@ void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
|
||||
bool isNew = (((waterfallCanvas->isShiftDown() || (lastActiveDemodulator && !lastActiveDemodulator->isActive())) && lastActiveDemodulator) || (!lastActiveDemodulator));
|
||||
|
||||
glContext->DrawFreqBwInfo(freq, wxGetApp().getDemodMgr().getLastBandwidth(), isNew?ThemeMgr::mgr.currentTheme->waterfallNew:ThemeMgr::mgr.currentTheme->waterfallHover, getCenterFrequency(), getBandwidth(), true);
|
||||
glContext->DrawFreqBwInfo(freq, wxGetApp().getDemodMgr().getLastBandwidth(), isNew?ThemeMgr::mgr.currentTheme->waterfallNew:ThemeMgr::mgr.currentTheme->waterfallHover, getCenterFrequency(), getBandwidth(), true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -329,6 +329,9 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
glContext->setHoverAlpha(0);
|
||||
|
||||
for (int i = 0, iMax = demods.size(); i < iMax; i++) {
|
||||
if (!demods[i]->isActive()) {
|
||||
continue;
|
||||
}
|
||||
if (activeDemodulator == demods[i] || lastActiveDemodulator == demods[i]) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user