diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 88f29a4..f907b84 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -330,7 +330,6 @@ AppFrame::AppFrame() : #ifdef _WIN32 SetIcon(wxICON(frame_icon)); #endif - GetStatusBar()->SetStatusText(wxString::Format(wxT("Set center frequency: %ll"), wxGetApp().getConfig()->getCenterFreq())); wxAcceleratorEntry entries[3]; entries[0].Set(wxACCEL_CTRL, (int) 'O', wxID_OPEN); diff --git a/src/audio/AudioThread.cpp b/src/audio/AudioThread.cpp index b173123..384b28d 100644 --- a/src/audio/AudioThread.cpp +++ b/src/audio/AudioThread.cpp @@ -12,8 +12,15 @@ std::map AudioThread::deviceSampleRate; std::map AudioThread::deviceThread; AudioThread::AudioThread(AudioThreadInputQueue *inputQueue, DemodulatorThreadCommandQueue* threadQueueNotify) : - currentInput(NULL), inputQueue(inputQueue), audioQueuePtr(0), underflowCount(0), terminated(false), active(false), outputDevice(-1), gain( + currentInput(NULL), inputQueue(inputQueue), gain( 1.0), threadQueueNotify(threadQueueNotify), sampleRate(0), nBufferFrames(1024) { + + audioQueuePtr.store(0); + underflowCount.store(0); + terminated.store(false); + active.store(false); + outputDevice.store(-1); + boundThreads = new std::vector; } diff --git a/src/demod/DemodulatorInstance.cpp b/src/demod/DemodulatorInstance.cpp index ba58e7c..38f1bb4 100644 --- a/src/demod/DemodulatorInstance.cpp +++ b/src/demod/DemodulatorInstance.cpp @@ -1,8 +1,22 @@ #include "DemodulatorInstance.h" 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), tracking(false), follow(false), currentAudioSampleRate(0), currentFrequency(0), currentBandwidth(0), currentOutputDevice(-1), currentAudioGain(1.0) { + t_Demod(NULL), t_PreDemod(NULL), t_Audio(NULL), threadQueueDemod(NULL), demodulatorThread(NULL), currentAudioGain(1.0) { + + terminated.store(true); + audioTerminated.store(true); + demodTerminated.store(true); + preDemodTerminated.store(true); + active.store(false); + squelch.store(false); + stereo.store(false); + tracking.store(false); + follow.store(false); + currentAudioSampleRate.store(0); + currentFrequency.store(0); + currentBandwidth.store(0); + currentOutputDevice.store(-1); + label = new std::string("Unnamed"); threadQueueDemod = new DemodulatorThreadInputQueue; diff --git a/src/demod/DemodulatorPreThread.cpp b/src/demod/DemodulatorPreThread.cpp index 0283b86..03ea87d 100644 --- a/src/demod/DemodulatorPreThread.cpp +++ b/src/demod/DemodulatorPreThread.cpp @@ -10,9 +10,11 @@ DemodulatorPreThread::DemodulatorPreThread(DemodulatorThreadInputQueue* iqInputQueue, DemodulatorThreadPostInputQueue* iqOutputQueue, DemodulatorThreadControlCommandQueue *threadQueueControl, DemodulatorThreadCommandQueue* threadQueueNotify) : - iqInputQueue(iqInputQueue), iqOutputQueue(iqOutputQueue), terminated(false), initialized(false), audioResampler(NULL), stereoResampler(NULL), iqResampleRatio( + iqInputQueue(iqInputQueue), iqOutputQueue(iqOutputQueue), audioResampler(NULL), stereoResampler(NULL), iqResampleRatio( 1), audioResampleRatio(1), firStereoRight(NULL), firStereoLeft(NULL), iirStereoPilot(NULL), iqResampler(NULL), commandQueue(NULL), threadQueueNotify(threadQueueNotify), threadQueueControl( threadQueueControl) { + terminated.store(false); + initialized.store(false); freqShifter = nco_crcf_create(LIQUID_VCO); shiftFrequency = 0; diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 00df8a7..86ce709 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -14,10 +14,14 @@ DemodulatorThread::DemodulatorThread(DemodulatorThreadPostInputQueue* iqInputQueue, DemodulatorThreadControlCommandQueue *threadQueueControl, DemodulatorThreadCommandQueue* threadQueueNotify) : iqInputQueue(iqInputQueue), audioVisOutputQueue(NULL), audioOutputQueue(NULL), iqAutoGain(NULL), amOutputCeil(1), amOutputCeilMA(1), amOutputCeilMAA( - 1), stereo(false), agcEnabled(true), terminated( - false), demodulatorType(DEMOD_TYPE_FM), threadQueueNotify(threadQueueNotify), threadQueueControl(threadQueueControl), squelchLevel(0), signalLevel( + 1), threadQueueNotify(threadQueueNotify), threadQueueControl(threadQueueControl), squelchLevel(0), signalLevel( 0), squelchEnabled(false), audioSampleRate(0) { + stereo.store(false); + agcEnabled.store(false); + terminated.store(false); + demodulatorType.store(DEMOD_TYPE_FM); + demodFM = freqdem_create(0.5); demodAM_USB = ampmodem_create(0.5, 0.0, LIQUID_AMPMODEM_USB, 1); demodAM_LSB = ampmodem_create(0.5, 0.0, LIQUID_AMPMODEM_LSB, 1); diff --git a/src/demod/DemodulatorWorkerThread.cpp b/src/demod/DemodulatorWorkerThread.cpp index 8725a94..a3d13cf 100644 --- a/src/demod/DemodulatorWorkerThread.cpp +++ b/src/demod/DemodulatorWorkerThread.cpp @@ -3,8 +3,8 @@ #include DemodulatorWorkerThread::DemodulatorWorkerThread(DemodulatorThreadWorkerCommandQueue* in, DemodulatorThreadWorkerResultQueue* out) : - terminated(false), commandQueue(in), resultQueue(out) { - + commandQueue(in), resultQueue(out) { + terminated.store(false); } DemodulatorWorkerThread::~DemodulatorWorkerThread() { diff --git a/src/sdr/SDRPostThread.cpp b/src/sdr/SDRPostThread.cpp index 6d94074..5a22aab 100644 --- a/src/sdr/SDRPostThread.cpp +++ b/src/sdr/SDRPostThread.cpp @@ -6,7 +6,10 @@ #include SDRPostThread::SDRPostThread() : - iqDataInQueue(NULL), iqDataOutQueue(NULL), iqVisualQueue(NULL), terminated(false), dcFilter(NULL), num_vis_samples(16384*2), swapIQ(false) { + iqDataInQueue(NULL), iqDataOutQueue(NULL), iqVisualQueue(NULL), dcFilter(NULL), num_vis_samples(16384*2) { + + terminated.store(false); + swapIQ.store(false); // create a lookup table for (unsigned int i = 0; i <= 0xffff; i++) { diff --git a/src/sdr/SDRThread.cpp b/src/sdr/SDRThread.cpp index ebfb0aa..6f1a66e 100644 --- a/src/sdr/SDRThread.cpp +++ b/src/sdr/SDRThread.cpp @@ -4,7 +4,10 @@ #include "CubicSDR.h" SDRThread::SDRThread(SDRThreadCommandQueue* pQueue) : - commandQueue(pQueue), iqDataOutQueue(NULL), terminated(false), offset(0), deviceId(-1) { + commandQueue(pQueue), iqDataOutQueue(NULL) { + terminated.store(false); + offset.store(0); + deviceId.store(-1); dev = NULL; sampleRate.store(DEFAULT_SAMPLE_RATE); }