From e504f4f28281675282d42a29e9c1a03885d32707 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Sun, 25 Jan 2015 21:03:17 -0500 Subject: [PATCH] Fix demodulator selection menu radio and display --- src/demod/DemodulatorInstance.cpp | 9 +++++++-- src/demod/DemodulatorInstance.h | 1 + src/visual/ScopeCanvas.cpp | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/demod/DemodulatorInstance.cpp b/src/demod/DemodulatorInstance.cpp index ccbb3d1..62e009a 100644 --- a/src/demod/DemodulatorInstance.cpp +++ b/src/demod/DemodulatorInstance.cpp @@ -2,7 +2,7 @@ DemodulatorInstance::DemodulatorInstance() : t_Demod(NULL), t_PreDemod(NULL), t_Audio(NULL), threadQueueDemod(NULL), demodulatorThread(NULL), terminated(true), audioTerminated(true), demodTerminated( - true), preDemodTerminated(true), active(false), squelch(false), stereo(false), currentFrequency(0), currentBandwidth(0) { + true), preDemodTerminated(true), active(false), squelch(false), stereo(false), currentFrequency(0), currentBandwidth(0), currentOutputDevice(-1) { label = new std::string("Unnamed"); threadQueueDemod = new DemodulatorThreadInputQueue; @@ -224,10 +224,15 @@ void DemodulatorInstance::setOutputDevice(int device_id) { command.int_value = device_id; audioThread->getCommandQueue()->push(command); } + currentOutputDevice = device_id; } int DemodulatorInstance::getOutputDevice() { - return audioThread->getOutputDevice(); + if (currentOutputDevice == -1) { + return audioThread->getOutputDevice(); + } else { + return currentOutputDevice; + } } void DemodulatorInstance::checkBandwidth() { diff --git a/src/demod/DemodulatorInstance.h b/src/demod/DemodulatorInstance.h index bd2576a..f4c28ad 100644 --- a/src/demod/DemodulatorInstance.h +++ b/src/demod/DemodulatorInstance.h @@ -90,4 +90,5 @@ private: long long currentFrequency; int currentBandwidth; int currentDemodType; + int currentOutputDevice; }; diff --git a/src/visual/ScopeCanvas.cpp b/src/visual/ScopeCanvas.cpp index 03db708..ca6ae50 100644 --- a/src/visual/ScopeCanvas.cpp +++ b/src/visual/ScopeCanvas.cpp @@ -70,10 +70,10 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { glViewport(0, 0, ClientSize.x, ClientSize.y); glContext->DrawBegin(); + glContext->Plot(waveform_points, stereo); if (!deviceName.empty()) { glContext->DrawDeviceName(deviceName); } - glContext->Plot(waveform_points, stereo); glContext->DrawEnd();