LABEL: first attempt, <user_label> is read from session XML, apparently also saved.

This commit is contained in:
vsonnier
2016-06-11 07:46:07 +02:00
parent 02034a8817
commit 00e241a784
6 changed files with 70 additions and 24 deletions
+28 -9
View File
@@ -351,10 +351,9 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long
glEnable(GL_BLEND);
std::string demodStr = "";
GLFont::Align demodAlign = GLFont::GLFONT_ALIGN_CENTER;
demodStr = demod->getDemodulatorType();
std::string demodStr = demod->getDemodulatorType();
demodAlign = GLFont::GLFONT_ALIGN_CENTER;
@@ -373,22 +372,42 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long
// add lock to string if we have an lock
if(demod->getDemodulatorLock()) {
demodStr = demodStr + " Lock";
}
demodStr += " Lock";
}
// else {
// demodStr = demodStr + " UnLock";
// }
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, 0, 0, true);
glColor3f(1, 1, 1);
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5), -1.0 + hPos, 16, demodAlign, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
//demodulator user label if present: type is displayed above the label, which is at the bottom of the screen.
if (!demod->getDemodulatorUserLabel().empty()) {
hPos += 2 * labelHeight;
}
drawSingleDemodLabel(demodStr, uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
//revert...
if (!demod->getDemodulatorUserLabel().empty()) {
hPos -= 2 * labelHeight;
drawSingleDemodLabel(demod->getDemodulatorUserLabel(), uxPos, hPos, xOfs, yOfs, GLFont::GLFONT_ALIGN_CENTER);
}
glDisable(GL_BLEND);
}
void PrimaryGLContext::drawSingleDemodLabel(std::string demodStr, float uxPos, float hPos, float xOfs, float yOfs, GLFont::Align demodAlign) {
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, 0, 0, true);
glColor3f(1, 1, 1);
GLFont::getFont(GLFont::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5),
-1.0 + hPos, 16, demodAlign,
GLFont::GLFONT_ALIGN_CENTER, 0, 0, true);
}
void PrimaryGLContext::DrawFreqSelector(float uxPos, RGBA4f color, float w, long long /* center_freq */, long long srate) {
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
+2
View File
@@ -24,6 +24,7 @@ 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, 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);
@@ -31,4 +32,5 @@ public:
private:
float hoverAlpha;
void drawSingleDemodLabel(std::string demodStr, float uxPos, float hPos, float xOfs, float yOfs, GLFont::Align demodAlign);
};