Fix Digital scope

This commit is contained in:
Charles J. Cliffe 2016-07-24 17:24:29 -04:00
parent 0090838070
commit 0f5b891b20
3 changed files with 16 additions and 11 deletions

View File

@ -209,7 +209,7 @@ bool DemodulatorInstance::isActive() {
void DemodulatorInstance::setActive(bool state) {
if (active && !state) {
#if ENABLE_DIGITAL_LAB
if (activeOutput && !isTerminated()) {
if (activeOutput) {
activeOutput->Hide();
}
#endif

View File

@ -183,7 +183,7 @@ void DemodulatorThread::run() {
localAudioVisOutputQueue = audioVisOutputQueue;
}
if (ati && localAudioVisOutputQueue != nullptr && localAudioVisOutputQueue->empty()) {
if ((ati || modemDigital) && localAudioVisOutputQueue != nullptr && localAudioVisOutputQueue->empty()) {
AudioThreadInput *ati_vis = new AudioThreadInput;
ati_vis->sampleRate = inp->sampleRate;
@ -191,6 +191,10 @@ void DemodulatorThread::run() {
size_t num_vis = DEMOD_VIS_SIZE;
if (modemDigital) {
if (ati) { // TODO: handle digital modems with audio output
ati->setRefCount(0);
ati = nullptr;
}
ati_vis->data.resize(inputData->size());
ati_vis->channels = 2;
for (int i = 0, iMax = inputData->size() / 2; i < iMax; i++) {

View File

@ -128,17 +128,18 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glViewport(0, 0, ClientSize.x, ClientSize.y);
if (scopePanel.getMode() == ScopePanel::SCOPE_MODE_XY && !spectrumVisible()) {
glDrawBuffer(GL_FRONT);
glContext->DrawBegin(false);
} else {
glDrawBuffer(GL_BACK);
// TODO: find out why frontbuffer drawing has stopped working in wx 3.1.0?
// if (scopePanel.getMode() == ScopePanel::SCOPE_MODE_XY && !spectrumVisible()) {
// glDrawBuffer(GL_FRONT);
// glContext->DrawBegin(false);
// } else {
// glDrawBuffer(GL_BACK);
glContext->DrawBegin();
bgPanel.setFillColor(ThemeMgr::mgr.currentTheme->scopeBackground * 3.0, RGBA4f(0,0,0,1));
bgPanel.calcTransform(CubicVR::mat4::identity());
bgPanel.draw();
}
// }
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@ -216,9 +217,9 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glContext->DrawTunerTitles(ppmMode);
glContext->DrawEnd();
if (scopePanel.getMode() != ScopePanel::SCOPE_MODE_XY || spectrumVisible()) {
// if (scopePanel.getMode() != ScopePanel::SCOPE_MODE_XY || spectrumVisible()) {
SwapBuffers();
}
// }
}