mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-26 05:23:26 -04:00
Add mute button and 'M' to toggle mute on waterfall hover
This commit is contained in:
@@ -94,7 +94,12 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGB3f color, lo
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
glColor4f(0, 0, 0, 0.35);
|
||||
if (demod->isMuted()) {
|
||||
glColor4f(0.8, 0, 0, 0.35);
|
||||
} else {
|
||||
glColor4f(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glVertex3f(uxPos - ofsLeft, hPos + labelHeight, 0.0);
|
||||
glVertex3f(uxPos - ofsLeft, -1.0, 0.0);
|
||||
@@ -128,12 +133,18 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGB3f color, lo
|
||||
|
||||
glColor4f(1.0, 1.0, 1.0, 0.8);
|
||||
|
||||
std::string demodLabel = demod->getLabel();
|
||||
|
||||
if (demod->isMuted()) {
|
||||
demodLabel.append("[M]");
|
||||
}
|
||||
|
||||
if (demod->getDemodulatorType() == DEMOD_TYPE_USB) {
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demod->getLabel(), uxPos, hPos, 16, GLFont::GLFONT_ALIGN_LEFT, GLFont::GLFONT_ALIGN_CENTER);
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodLabel, uxPos, hPos, 16, GLFont::GLFONT_ALIGN_LEFT, GLFont::GLFONT_ALIGN_CENTER);
|
||||
} else if (demod->getDemodulatorType() == DEMOD_TYPE_LSB) {
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demod->getLabel(), uxPos, hPos, 16, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER);
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodLabel, uxPos, hPos, 16, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER);
|
||||
} else {
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demod->getLabel(), uxPos, hPos, 16, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodLabel, uxPos, hPos, 16, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
@@ -230,7 +241,11 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGB3f color, long l
|
||||
glColor3f(0, 0, 0);
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5) + xOfs, -1.0 + hPos - yOfs, 16, demodAlign,
|
||||
GLFont::GLFONT_ALIGN_CENTER);
|
||||
glColor3f(0.8, 0.8, 0.8);
|
||||
if (demod->isMuted()) {
|
||||
glColor3f(0.8, 0.2, 0.2);
|
||||
} else {
|
||||
glColor3f(0.8, 0.2, 0.2);
|
||||
}
|
||||
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5), -1.0 + hPos, 16, demodAlign, GLFont::GLFONT_ALIGN_CENTER);
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
Reference in New Issue
Block a user