diff --git a/external/cubicvr2/math/mat4.h b/external/cubicvr2/math/mat4.h index 3744340..2007535 100644 --- a/external/cubicvr2/math/mat4.h +++ b/external/cubicvr2/math/mat4.h @@ -78,11 +78,11 @@ namespace CubicVR { __float A = (right + left) / (right - left); __float B = (top + bottom) / (top - bottom); __float C = - (zFar + zNear) / (zFar - zNear); - __float D = - (-2.0 * zFar * zNear) / (zFar - zNear); + __float D = - (-2.0f * zFar * zNear) / (zFar - zNear); - return mat4((2.0 * zNear) / (right - left), 0, A, 0, - 0, (2.0 * zNear) / (top - bottom), B, 0, + return mat4((2.0f * zNear) / (right - left), 0, A, 0, + 0, (2.0f * zNear) / (top - bottom), B, 0, 0, 0, C, D, 0, 0, -1, 0); }; @@ -313,7 +313,7 @@ namespace CubicVR { }; static vec3 unProject(mat4 pMatrix, mat4 mvMatrix, float width, float height, float winx, float winy, float /* winz */) { - vec4 p(((winx / width) * 2.0) - 1.0, -(((winy / height) * 2.0) - 1.0), 1.0, 1.0); + vec4 p(((winx / width) * 2.0f) - 1.0, -(((winy / height) * 2.0f) - 1.0), 1.0, 1.0); vec4 invp = mat4::vec4_multiply(mat4::vec4_multiply(p, mat4::inverse(pMatrix)), mat4::inverse(mvMatrix)); diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 84200e7..004f32c 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -164,7 +164,7 @@ AppFrame::AppFrame() : deltaLockButton = new ModeSelectorCanvas(demodPanel, attribList); deltaLockButton->addChoice(1, "V"); deltaLockButton->setPadding(-1,-1); - deltaLockButton->setHighlightColor(RGBA4f(0.8,0.8,0.2)); + deltaLockButton->setHighlightColor(RGBA4f(0.8f,0.8f,0.2f)); deltaLockButton->setHelpTip("Delta Lock Toggle (V) - Enable to lock modem relative to center frequency."); deltaLockButton->setToggleMode(true); deltaLockButton->setSelection(-1); @@ -197,7 +197,7 @@ AppFrame::AppFrame() : soloModeButton = new ModeSelectorCanvas(demodPanel, attribList); soloModeButton->addChoice(1, "S"); soloModeButton->setPadding(-1,-1); - soloModeButton->setHighlightColor(RGBA4f(0.8,0.8,0.2)); + soloModeButton->setHighlightColor(RGBA4f(0.8f,0.8f,0.2f)); soloModeButton->setHelpTip("Solo Mode Toggle"); soloModeButton->setToggleMode(true); soloModeButton->setSelection(-1); @@ -210,7 +210,7 @@ AppFrame::AppFrame() : demodMuteButton = new ModeSelectorCanvas(demodPanel, attribList); demodMuteButton->addChoice(1, "M"); demodMuteButton->setPadding(-1,-1); - demodMuteButton->setHighlightColor(RGBA4f(0.8,0.2,0.2)); + demodMuteButton->setHighlightColor(RGBA4f(0.8f,0.2f,0.2f)); demodMuteButton->setHelpTip("Demodulator Mute Toggle"); demodMuteButton->setToggleMode(true); demodMuteButton->setSelection(-1); @@ -245,7 +245,7 @@ AppFrame::AppFrame() : peakHoldButton = new ModeSelectorCanvas(spectrumPanel, attribList); peakHoldButton->addChoice(1, "P"); peakHoldButton->setPadding(-1,-1); - peakHoldButton->setHighlightColor(RGBA4f(0.2,0.8,0.2)); + peakHoldButton->setHighlightColor(RGBA4f(0.2f,0.8f,0.2f)); peakHoldButton->setHelpTip("Peak Hold Toggle"); peakHoldButton->setToggleMode(true); peakHoldButton->setSelection(-1); @@ -257,7 +257,7 @@ AppFrame::AppFrame() : spectrumAvgMeter = new MeterCanvas(spectrumPanel, attribList); spectrumAvgMeter->setHelpTip("Spectrum averaging speed, click or drag to adjust."); spectrumAvgMeter->setMax(1.0); - spectrumAvgMeter->setLevel(0.65); + spectrumAvgMeter->setLevel(0.65f); spectrumAvgMeter->setShowUserInput(false); spectrumAvgMeter->SetMinSize(wxSize(12,24)); @@ -888,8 +888,8 @@ void AppFrame::OnMenu(wxCommandEvent& event) { waterfallDataThread->setLinesPerSecond(DEFAULT_WATERFALL_LPS); waterfallCanvas->setLinesPerSecond(DEFAULT_WATERFALL_LPS); waterfallSpeedMeter->setLevel(sqrt(DEFAULT_WATERFALL_LPS)); - wxGetApp().getSpectrumProcessor()->setFFTAverageRate(0.65); - spectrumAvgMeter->setLevel(0.65); + wxGetApp().getSpectrumProcessor()->setFFTAverageRate(0.65f); + spectrumAvgMeter->setLevel(0.65f); demodModeSelector->Refresh(); demodTuner->Refresh(); SetTitle(CUBICSDR_TITLE); @@ -1427,10 +1427,10 @@ void AppFrame::OnIdle(wxIdleEvent& event) { if (spectrumAvgMeter->inputChanged()) { float val = spectrumAvgMeter->getInputValue(); if (val < 0.01) { - val = 0.01; + val = 0.01f; } if (val > 0.99) { - val = 0.99; + val = 0.99f; } spectrumAvgMeter->setLevel(val); proc->setFFTAverageRate(val); @@ -1518,10 +1518,10 @@ void AppFrame::OnDoubleClickSash(wxSplitterEvent& event) if (event.GetId() == wxID_MAIN_SPLITTER) { w = mainSplitter; - g = 10.0/37.0; + g = 10.0f/37.0f; } else if (event.GetId() == wxID_VIS_SPLITTER) { w = mainVisSplitter; - g = 6.0/25.0; + g = 6.0f/25.0f; } if (w != NULL) { @@ -1627,6 +1627,7 @@ bool AppFrame::loadSession(std::string fileName) { int numDemodulators = 0; DemodulatorInstance *loadedDemod = NULL; DemodulatorInstance *newDemod = NULL; + std::vector demodsLoaded; while (demodulators->hasAnother("demodulator")) { DataNode *demod = demodulators->getNext("demodulator"); @@ -1727,8 +1728,9 @@ bool AppFrame::loadSession(std::string fileName) { } newDemod->run(); - newDemod->setActive(false); - wxGetApp().bindDemodulator(newDemod); + newDemod->setActive(true); + demodsLoaded.push_back(newDemod); +// wxGetApp().bindDemodulator(newDemod); std::cout << "\tAdded demodulator at frequency " << freq << " type " << type << std::endl; std::cout << "\t\tBandwidth: " << bandwidth << std::endl; @@ -1740,9 +1742,7 @@ bool AppFrame::loadSession(std::string fileName) { DemodulatorInstance *focusDemod = loadedDemod?loadedDemod:newDemod; if (focusDemod) { - focusDemod->setActive(true); - focusDemod->setFollow(true); - focusDemod->setTracking(true); + wxGetApp().bindDemodulators(&demodsLoaded); wxGetApp().getDemodMgr().setActiveDemodulator(focusDemod, false); } } catch (DataInvalidChildException &e) { diff --git a/src/CubicSDR.cpp b/src/CubicSDR.cpp index 51e6014..4e6ea4a 100644 --- a/src/CubicSDR.cpp +++ b/src/CubicSDR.cpp @@ -632,6 +632,13 @@ void CubicSDR::bindDemodulator(DemodulatorInstance *demod) { sdrPostThread->bindDemodulator(demod); } +void CubicSDR::bindDemodulators(std::vector *demods) { + if (!demods) { + return; + } + sdrPostThread->bindDemodulators(demods); +} + long long CubicSDR::getSampleRate() { return sampleRate; } diff --git a/src/CubicSDR.h b/src/CubicSDR.h index 58a057f..1641669 100644 --- a/src/CubicSDR.h +++ b/src/CubicSDR.h @@ -115,6 +115,7 @@ public: SDRThread *getSDRThread(); void bindDemodulator(DemodulatorInstance *demod); + void bindDemodulators(std::vector *demods); void removeDemodulator(DemodulatorInstance *demod); void setFrequencySnap(int snap); diff --git a/src/demod/DemodulatorMgr.cpp b/src/demod/DemodulatorMgr.cpp index 8f80829..f6cc40e 100644 --- a/src/demod/DemodulatorMgr.cpp +++ b/src/demod/DemodulatorMgr.cpp @@ -13,9 +13,17 @@ bool demodFreqCompare (DemodulatorInstance *i, DemodulatorInstance *j) { return (i->getFrequency()getFrequency()); } bool inactiveCompare (DemodulatorInstance *i, DemodulatorInstance *j) { return (i->isActive()isActive()); } -DemodulatorMgr::DemodulatorMgr() : - activeDemodulator(NULL), lastActiveDemodulator(NULL), activeVisualDemodulator(NULL), lastBandwidth(DEFAULT_DEMOD_BW), lastDemodType( - DEFAULT_DEMOD_TYPE), lastSquelchEnabled(false), lastSquelch(-100), lastGain(1.0), lastMuted(false), lastDeltaLock(false) { +DemodulatorMgr::DemodulatorMgr() { + activeDemodulator = NULL; + lastActiveDemodulator = NULL; + activeVisualDemodulator = NULL; + lastBandwidth = DEFAULT_DEMOD_BW; + lastDemodType = DEFAULT_DEMOD_TYPE; + lastSquelchEnabled = false; + lastSquelch = -100; + lastGain = 1.0; + lastMuted = false; + lastDeltaLock = false; } DemodulatorMgr::~DemodulatorMgr() { @@ -23,26 +31,35 @@ DemodulatorMgr::~DemodulatorMgr() { } DemodulatorInstance *DemodulatorMgr::newThread() { + garbageCollect(); + + demods_busy.lock(); DemodulatorInstance *newDemod = new DemodulatorInstance; - demods.push_back(newDemod); std::stringstream label; label << demods.size(); newDemod->setLabel(label.str()); - + + demods.push_back(newDemod); + demods_busy.unlock(); + return newDemod; } void DemodulatorMgr::terminateAll() { while (demods.size()) { + demods_busy.lock(); DemodulatorInstance *d = demods.back(); demods.pop_back(); + demods_busy.unlock(); wxGetApp().removeDemodulator(d); deleteThread(d); } } std::vector &DemodulatorMgr::getDemodulators() { + demods_busy.lock(); + demods_busy.unlock(); return demods; } @@ -110,6 +127,8 @@ DemodulatorInstance *DemodulatorMgr::getFirstDemodulator() { } void DemodulatorMgr::deleteThread(DemodulatorInstance *demod) { + demods_busy.lock(); + std::vector::iterator i; i = std::find(demods.begin(), demods.end(), demod); @@ -131,10 +150,13 @@ void DemodulatorMgr::deleteThread(DemodulatorInstance *demod) { demods_deleted.push_back(demod); + demods_busy.unlock(); + garbageCollect(); } std::vector *DemodulatorMgr::getDemodulatorsAt(long long freq, int bandwidth) { + demods_busy.lock(); std::vector *foundDemods = new std::vector(); for (int i = 0, iMax = demods.size(); i < iMax; i++) { @@ -150,12 +172,13 @@ std::vector *DemodulatorMgr::getDemodulatorsAt(long long foundDemods->push_back(testDemod); } } + demods_busy.unlock(); return foundDemods; } bool DemodulatorMgr::anyDemodulatorsAt(long long freq, int bandwidth) { - + demods_busy.lock(); for (int i = 0, iMax = demods.size(); i < iMax; i++) { DemodulatorInstance *testDemod = demods[i]; @@ -166,10 +189,12 @@ bool DemodulatorMgr::anyDemodulatorsAt(long long freq, int bandwidth) { long long halfBuffer = bandwidth / 2; if ((freq <= (freqTest + ((testDemod->getDemodulatorType() != "LSB")?halfBandwidthTest:0) + halfBuffer)) && (freq >= (freqTest - ((testDemod->getDemodulatorType() != "USB")?halfBandwidthTest:0) - halfBuffer))) { + demods_busy.unlock(); return true; } } + demods_busy.unlock(); return false; } @@ -206,7 +231,7 @@ void DemodulatorMgr::setActiveDemodulator(DemodulatorInstance *demod, bool tempo activeDemodulator = demod; - garbageCollect(); +// garbageCollect(); } DemodulatorInstance *DemodulatorMgr::getActiveDemodulator() { @@ -222,6 +247,7 @@ DemodulatorInstance *DemodulatorMgr::getLastActiveDemodulator() { void DemodulatorMgr::garbageCollect() { if (demods_deleted.size()) { + demods_busy.lock(); std::vector::iterator i; for (i = demods_deleted.begin(); i != demods_deleted.end(); i++) { @@ -232,9 +258,12 @@ void DemodulatorMgr::garbageCollect() { std::cout << "Garbage collected demodulator instance " << deleted->getLabel() << std::endl; delete deleted; + + demods_busy.unlock(); return; } } + demods_busy.unlock(); } } @@ -255,7 +284,7 @@ void DemodulatorMgr::updateLastState() { if (lastActiveDemodulator) { lastBandwidth = lastActiveDemodulator->getBandwidth(); lastDemodType = lastActiveDemodulator->getDemodulatorType(); - lastDemodLock = lastActiveDemodulator->getDemodulatorLock(); + lastDemodLock = lastActiveDemodulator->getDemodulatorLock()?true:false; lastSquelchEnabled = lastActiveDemodulator->isSquelchEnabled(); lastSquelch = lastActiveDemodulator->getSquelchLevel(); lastGain = lastActiveDemodulator->getGain(); diff --git a/src/demod/DemodulatorMgr.h b/src/demod/DemodulatorMgr.h index 8d72711..8218045 100644 --- a/src/demod/DemodulatorMgr.h +++ b/src/demod/DemodulatorMgr.h @@ -72,5 +72,7 @@ private: bool lastMuted; bool lastDeltaLock; + std::mutex demods_busy; + std::map lastModemSettings; }; diff --git a/src/demod/DemodulatorThread.cpp b/src/demod/DemodulatorThread.cpp index 6d642dd..a166ced 100644 --- a/src/demod/DemodulatorThread.cpp +++ b/src/demod/DemodulatorThread.cpp @@ -52,7 +52,7 @@ float DemodulatorThread::linearToDb(float linear) { // http://dspguru.com/dsp/tricks/magnitude-estimator #define SMALL 1e-20 if (linear <= SMALL) { - linear = SMALL; + linear = float(SMALL); } return 20.0 * log10(linear); } diff --git a/src/modules/modem/ModemAnalog.cpp b/src/modules/modem/ModemAnalog.cpp index df6b990..29561a3 100644 --- a/src/modules/modem/ModemAnalog.cpp +++ b/src/modules/modem/ModemAnalog.cpp @@ -45,7 +45,7 @@ void ModemAnalog::initOutputBuffers(ModemKitAnalog *akit, ModemIQData *input) { double audio_resample_ratio = akit->audioResampleRatio; - size_t audio_out_size = ceil((double) (bufSize) * audio_resample_ratio) + 512; + size_t audio_out_size = (size_t)ceil((double) (bufSize) * audio_resample_ratio) + 512; if (demodOutputData.size() != bufSize) { if (demodOutputData.capacity() < bufSize) { @@ -65,8 +65,8 @@ void ModemAnalog::buildAudioOutput(ModemKitAnalog *akit, AudioThreadInput *audio unsigned int numAudioWritten; if (autoGain) { - aOutputCeilMA = aOutputCeilMA + (aOutputCeil - aOutputCeilMA) * 0.025; - aOutputCeilMAA = aOutputCeilMAA + (aOutputCeilMA - aOutputCeilMAA) * 0.025; + aOutputCeilMA = aOutputCeilMA + (aOutputCeil - aOutputCeilMA) * 0.025f; + aOutputCeilMAA = aOutputCeilMAA + (aOutputCeilMA - aOutputCeilMAA) * 0.025f; aOutputCeil = 0; for (size_t i = 0; i < bufSize; i++) { @@ -75,7 +75,7 @@ void ModemAnalog::buildAudioOutput(ModemKitAnalog *akit, AudioThreadInput *audio } } - float gain = 0.5 / aOutputCeilMAA; + float gain = 0.5f / aOutputCeilMAA; for (size_t i = 0; i < bufSize; i++) { demodOutputData[i] *= gain; diff --git a/src/modules/modem/analog/ModemFMStereo.cpp b/src/modules/modem/analog/ModemFMStereo.cpp index ae99b1d..d1f5958 100644 --- a/src/modules/modem/analog/ModemFMStereo.cpp +++ b/src/modules/modem/analog/ModemFMStereo.cpp @@ -49,7 +49,7 @@ ModemKit *ModemFMStereo::buildKit(long long sampleRate, int audioSampleRate) { // Stereo filters / shifters double firStereoCutoff = 16000.0 / double(audioSampleRate); // filter transition - float ft = 1000.0 / double(audioSampleRate); + float ft = 1000.0f / double(audioSampleRate); // fractional timing offset float mu = 0.0f; @@ -69,13 +69,13 @@ ModemKit *ModemFMStereo::buildKit(long long sampleRate, int audioSampleRate) { kit->firStereoRight = firfilt_rrrf_create(h, h_len); // stereo pilot filter - float bw = sampleRate; + float bw = float(sampleRate); if (bw < 100000.0) { bw = 100000.0; } unsigned int order = 5; // filter order - float f0 = ((double) 19000 / bw); - float fc = ((double) 19500 / bw); + float f0 = ((float) 19000 / bw); + float fc = ((float) 19500 / bw); float Ap = 1.0f; kit->iirStereoPilot = iirfilt_crcf_create_prototype(LIQUID_IIRDES_CHEBY2, LIQUID_IIRDES_BANDPASS, LIQUID_IIRDES_SOS, order, fc, f0, Ap, As); @@ -117,7 +117,7 @@ void ModemFMStereo::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInp demodOutputData.resize(bufSize); } - size_t audio_out_size = ceil((double) (bufSize) * audio_resample_ratio) + 512; + size_t audio_out_size = (size_t)ceil((double) (bufSize) * audio_resample_ratio) + 512; freqdem_demodulate_block(demodFM, &input->data[0], bufSize, &demodOutputData[0]); @@ -190,10 +190,10 @@ void ModemFMStereo::demodulate(ModemKit *kit, ModemIQData *input, AudioThreadInp for (size_t i = 0; i < numAudioWritten; i++) { float l, r; - firfilt_rrrf_push(fmkit->firStereoLeft, 0.568 * (resampledOutputData[i] - (resampledStereoData[i]))); + firfilt_rrrf_push(fmkit->firStereoLeft, 0.568f * (resampledOutputData[i] - (resampledStereoData[i]))); firfilt_rrrf_execute(fmkit->firStereoLeft, &l); - firfilt_rrrf_push(fmkit->firStereoRight, 0.568 * (resampledOutputData[i] + (resampledStereoData[i]))); + firfilt_rrrf_push(fmkit->firStereoRight, 0.568f * (resampledOutputData[i] + (resampledStereoData[i]))); firfilt_rrrf_execute(fmkit->firStereoRight, &r); audioOut->data[i * 2] = l; diff --git a/src/modules/modem/analog/ModemUSB.cpp b/src/modules/modem/analog/ModemUSB.cpp index 5451e48..e143337 100644 --- a/src/modules/modem/analog/ModemUSB.cpp +++ b/src/modules/modem/analog/ModemUSB.cpp @@ -9,7 +9,7 @@ ModemUSB::ModemUSB() : ModemAnalog() { ssbFilt = iirfilt_crcf_create_lowpass(6, 0.25); #endif ssbShift = nco_crcf_create(LIQUID_NCO); - nco_crcf_set_frequency(ssbShift, (2.0 * M_PI) * 0.25); + nco_crcf_set_frequency(ssbShift, (2.0f * M_PI) * 0.25f); c2rFilt = firhilbf_create(5, 90.0); } diff --git a/src/panel/ScopePanel.cpp b/src/panel/ScopePanel.cpp index 1bc15db..f83e00c 100644 --- a/src/panel/ScopePanel.cpp +++ b/src/panel/ScopePanel.cpp @@ -65,8 +65,8 @@ void ScopePanel::drawPanelContents() { } else if (scopeMode == SCOPE_MODE_XY) { RGBA4f bg1(ThemeMgr::mgr.currentTheme->scopeBackground), bg2(ThemeMgr::mgr.currentTheme->scopeBackground * 2.0); - bg1.a = 0.05; - bg2.a = 0.05; + bg1.a = 0.05f; + bg2.a = 0.05f; bgPanel.setFillColor(bg1, bg2); bgPanel.calcTransform(transform); bgPanel.draw(); diff --git a/src/panel/SpectrumPanel.cpp b/src/panel/SpectrumPanel.cpp index 048c858..0f60984 100644 --- a/src/panel/SpectrumPanel.cpp +++ b/src/panel/SpectrumPanel.cpp @@ -19,11 +19,11 @@ SpectrumPanel::SpectrumPanel() { dbPanelCeil.setMarginPx(0); dbPanelCeil.setFill(GLPanel::GLPANEL_FILL_GRAD_X); - dbPanelCeil.setFillColor(RGBA4f(0.2,0.2,0.2,5.0), RGBA4f(0.2,0.2,0.2,0.0)); + dbPanelCeil.setFillColor(RGBA4f(0.2f,0.2f,0.2f,5.0f), RGBA4f(0.2f,0.2f,0.2f,0.0f)); dbPanelFloor.setMarginPx(0); dbPanelFloor.setFill(GLPanel::GLPANEL_FILL_GRAD_X); - dbPanelFloor.setFillColor(RGBA4f(0.2,0.2,0.2,5.), RGBA4f(0.2,0.2,0.2,0.0)); + dbPanelFloor.setFillColor(RGBA4f(0.2f,0.2f,0.2f,5.0f), RGBA4f(0.2f,0.2f,0.2f,0.0f)); } @@ -124,7 +124,7 @@ void SpectrumPanel::drawPanelContents() { a *= (rangeTrans-(range-(rangeMax-rangeTrans)))/rangeTrans; } - glColor4f(0.12, 0.12, 0.12, a); + glColor4f(0.12f, 0.12f, 0.12f, a); glBegin(GL_LINES); for (double l = floorValue; l<=ceilValue+rangeStep; l+=rangeStep) { p += rangeStep/range; diff --git a/src/process/ScopeVisualProcessor.cpp b/src/process/ScopeVisualProcessor.cpp index 38c3c0a..221bb21 100644 --- a/src/process/ScopeVisualProcessor.cpp +++ b/src/process/ScopeVisualProcessor.cpp @@ -5,7 +5,7 @@ ScopeVisualProcessor::ScopeVisualProcessor(): outputBuffers("ScopeVisualProcessorBuffers") { scopeEnabled.store(true); spectrumEnabled.store(true); - fft_average_rate = 0.65; + fft_average_rate = 0.65f; fft_ceil_ma = fft_ceil_maa = 0; fft_floor_ma = fft_floor_maa = 0; maxScopeSamples = 1024; diff --git a/src/process/SpectrumVisualProcessor.cpp b/src/process/SpectrumVisualProcessor.cpp index da8283f..2a27630 100644 --- a/src/process/SpectrumVisualProcessor.cpp +++ b/src/process/SpectrumVisualProcessor.cpp @@ -35,7 +35,7 @@ SpectrumVisualProcessor::SpectrumVisualProcessor() : outputBuffers("SpectrumVisu fft_ceil_ma = fft_ceil_maa = 100.0; fft_floor_ma = fft_floor_maa = 0.0; desiredInputSize.store(0); - fft_average_rate = 0.65; + fft_average_rate = 0.65f; scaleFactor.store(1.0); fftSizeChanged.store(false); newFFTSize.store(0); diff --git a/src/sdr/SDRPostThread.cpp b/src/sdr/SDRPostThread.cpp index 8ae854a..190eb0e 100644 --- a/src/sdr/SDRPostThread.cpp +++ b/src/sdr/SDRPostThread.cpp @@ -20,7 +20,7 @@ SDRPostThread::SDRPostThread() : IOThread(), buffers("SDRPostThreadBuffers"), vi visBandwidth.store(0); doRefresh.store(false); - dcFilter = iirfilt_crcf_create_dc_blocker(0.0005); + dcFilter = iirfilt_crcf_create_dc_blocker(0.0005f); } SDRPostThread::~SDRPostThread() { @@ -33,6 +33,18 @@ void SDRPostThread::bindDemodulator(DemodulatorInstance *demod) { busy_demod.unlock(); } +void SDRPostThread::bindDemodulators(std::vector *demods) { + if (!demods) { + return; + } + busy_demod.lock(); + for (std::vector::iterator di = demods->begin(); di != demods->end(); di++) { + demodulators.push_back(*di); + doRefresh.store(true); + } + busy_demod.unlock(); +} + void SDRPostThread::removeDemodulator(DemodulatorInstance *demod) { if (!demod) { return; diff --git a/src/sdr/SDRPostThread.h b/src/sdr/SDRPostThread.h index 48c7540..f6634e7 100644 --- a/src/sdr/SDRPostThread.h +++ b/src/sdr/SDRPostThread.h @@ -13,6 +13,7 @@ public: ~SDRPostThread(); void bindDemodulator(DemodulatorInstance *demod); + void bindDemodulators(std::vector *demods); void removeDemodulator(DemodulatorInstance *demod); void run(); diff --git a/src/ui/GLPanel.cpp b/src/ui/GLPanel.cpp index c61d626..ae8ddc7 100644 --- a/src/ui/GLPanel.cpp +++ b/src/ui/GLPanel.cpp @@ -13,9 +13,9 @@ GLPanel::GLPanel() : fillType(GLPANEL_FILL_SOLID), contentsVisible(true), visibl rot[2] = 0.0f; size[0] = 1.0f; size[1] = 1.0f; - fill[0] = RGBA4f(0.5,0.5,0.5); - fill[1] = RGBA4f(0.1,0.1,0.1); - borderColor = RGBA4f(0.8, 0.8, 0.8); + fill[0] = RGBA4f(0.5f,0.5f,0.5f); + fill[1] = RGBA4f(0.1f,0.1f,0.1f); + borderColor = RGBA4f(0.8f, 0.8f, 0.8f); setCoordinateSystem(GLPANEL_Y_UP); setMarginPx(0); setBorderPx(0); diff --git a/src/ui/UITestContext.cpp b/src/ui/UITestContext.cpp index 652bdbe..c31f2e6 100644 --- a/src/ui/UITestContext.cpp +++ b/src/ui/UITestContext.cpp @@ -13,22 +13,22 @@ PrimaryGLContext(canvas, sharedContext) { testChildPanel.setPosition(0.0, 0.0); testChildPanel.setMarginPx(5); - testChildPanel.setSize(1.0, 0.33); + testChildPanel.setSize(1.0f, 0.33f); testChildPanel.setCoordinateSystem(GLPanel::GLPANEL_Y_DOWN_ZERO_ONE); testChildPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_X); testChildPanel.setFillColor(RGBA4f(0.0,0.0,1.0), RGBA4f(0.0,1.0,0.0)); testChildPanel.setBorderPx(1); - testChildPanel2.setPosition(0.0, -0.66); - testChildPanel2.setSize(1.0, 0.33); + testChildPanel2.setPosition(0.0f, -0.66f); + testChildPanel2.setSize(1.0f, 0.33f); testChildPanel2.setMarginPx(5); testChildPanel2.setFill(GLPanel::GLPANEL_FILL_GRAD_X); testChildPanel2.setFillColor(RGBA4f(0.0,0.0,1.0), RGBA4f(0.0,1.0,0.0)); testChildPanel2.setBorderColor(RGBA4f(1.0,0.0,0.0)); testChildPanel2.setBorderPx(1); - testChildPanel3.setPosition(0.0, 0.66); - testChildPanel3.setSize(1.0, 0.33); + testChildPanel3.setPosition(0.0f, 0.66f); + testChildPanel3.setSize(1.0f, 0.33f); testChildPanel3.setMarginPx(5); testChildPanel3.setFill(GLPanel::GLPANEL_FILL_GRAD_X); testChildPanel3.setFillColor(RGBA4f(0.0,0.0,1.0), RGBA4f(0.0,1.0,0.0)); diff --git a/src/util/DataTree.cpp b/src/util/DataTree.cpp index 968d371..306bf18 100755 --- a/src/util/DataTree.cpp +++ b/src/util/DataTree.cpp @@ -164,7 +164,7 @@ DataElementSetNumericVectorDef(DATA_DOUBLE_VECTOR, double) DataElementSetNumericVectorDef(DATA_LONGDOUBLE_VECTOR, long double) -#define DataElementGetNumericDef(enumtype, datatype, ...) void DataElement::get(datatype& val_out) throw (DataTypeMismatchException) { \ +#define DataElementGetNumericDef(enumtype, datatype, ...) void DataElement::get(datatype& val_out) { \ if (!data_type) \ return; \ int _compat[] = {__VA_ARGS__}; \ @@ -207,7 +207,7 @@ DataElementGetNumericDef(DATA_LONG, long, DATA_CHAR, DATA_UCHAR, DATA_UINT, DATA -#define DataElementGetFloatingPointDef(enumtype, datatype, ...) void DataElement::get(datatype& val_out) throw (DataTypeMismatchException) { \ +#define DataElementGetFloatingPointDef(enumtype, datatype, ...) void DataElement::get(datatype& val_out) { \ if (!data_type) \ return; \ int _compat[] = {__VA_ARGS__}; \ @@ -250,14 +250,14 @@ DataElementGetFloatingPointDef(DATA_FLOAT, float, DATA_DOUBLE, DATA_CHAR, DATA_U DataElementGetFloatingPointDef(DATA_DOUBLE, double, DATA_FLOAT, DATA_CHAR, DATA_UCHAR, DATA_UINT, DATA_ULONG, DATA_LONGLONG, DATA_LONGDOUBLE, DATA_INT, DATA_LONG) -void DataElement::get(char **data_in) throw (DataTypeMismatchException) { +void DataElement::get(char **data_in) { if (data_type != DATA_VOID) throw(new DataTypeMismatchException("Type mismatch, not a CHAR*")); *data_in = new char[data_size]; memcpy(*data_in, data_val, data_size); } -void DataElement::get(string &str_in) throw (DataTypeMismatchException) { +void DataElement::get(string &str_in) { if (!data_type) return; @@ -274,7 +274,7 @@ void DataElement::get(string &str_in) throw (DataTypeMismatchException) { } } -void DataElement::get(vector &strvect_in) throw (DataTypeMismatchException) { +void DataElement::get(vector &strvect_in) { size_t ptr; if (!data_type) return; @@ -291,7 +291,7 @@ void DataElement::get(vector &strvect_in) throw (DataTypeMismatchExcepti } -void DataElement::get(std::set &strset_in) throw (DataTypeMismatchException) { +void DataElement::get(std::set &strset_in) { if (!data_type) return; @@ -308,7 +308,7 @@ void DataElement::get(std::set &strset_in) throw (DataTypeMismatchExcept } } -#define DataElementGetNumericVectorDef(enumtype, datatype, ...) void DataElement::get(vector& val_out) throw (DataTypeMismatchException) { \ +#define DataElementGetNumericVectorDef(enumtype, datatype, ...) void DataElement::get(vector& val_out) { \ if (!data_type || !unit_size) return; \ if (data_type != enumtype) { \ int _compat[] = {__VA_ARGS__}; \ @@ -457,7 +457,7 @@ DataNode *DataNode::newChild(const char *name_in) { return children.back(); } -DataNode *DataNode::child(const char *name_in, int index) throw (DataInvalidChildException) { +DataNode *DataNode::child(const char *name_in, int index) { DataNode *child_ret; child_ret = childmap[name_in][index]; @@ -471,7 +471,7 @@ DataNode *DataNode::child(const char *name_in, int index) throw (DataInvalidChil return child_ret; } -DataNode *DataNode::child(int index) throw (DataInvalidChildException) { +DataNode *DataNode::child(int index) { DataNode *child_ret; @@ -502,11 +502,11 @@ bool DataNode::hasAnother(const char *name_in) { return childmap[name_in].size() != childmap_ptr[name_in]; } -DataNode *DataNode::getNext() throw (DataInvalidChildException) { +DataNode *DataNode::getNext() { return child(ptr++); } -DataNode *DataNode::getNext(const char *name_in) throw (DataInvalidChildException) { +DataNode *DataNode::getNext(const char *name_in) { return child(name_in, childmap_ptr[name_in]++); } @@ -1554,7 +1554,7 @@ bool DataTree::SaveToFileXML(const std::string& filename) { */ bool DataTree::SaveToFile(const std::string& filename, bool compress, int /* compress_level */) { - long dataSize, compressedSize, headerSize; + long dataSize, compressedSize = 0, headerSize; char *serialized = nullptr, *hdr_serialized = nullptr, *compressed = nullptr; DataTree dtHeader; diff --git a/src/util/DataTree.h b/src/util/DataTree.h index 6224cab..4a27795 100755 --- a/src/util/DataTree.h +++ b/src/util/DataTree.h @@ -167,45 +167,45 @@ public: /* get overloads */ - void get(char &char_in) throw (DataTypeMismatchException); - void get(unsigned char &uchar_in) throw (DataTypeMismatchException); - void get(int &int_in) throw (DataTypeMismatchException); - void get(unsigned int &uint_in) throw (DataTypeMismatchException); - void get(long &long_in) throw (DataTypeMismatchException); - void get(unsigned long &ulong_in) throw (DataTypeMismatchException); - void get(long long &long_in) throw (DataTypeMismatchException); - void get(float &float_in) throw (DataTypeMismatchException); - void get(double &double_in) throw (DataTypeMismatchException); - void get(long double &ldouble_in) throw (DataTypeMismatchException); + void get(char &char_in); + void get(unsigned char &uchar_in); + void get(int &int_in); + void get(unsigned int &uint_in); + void get(long &long_in); + void get(unsigned long &ulong_in); + void get(long long &long_in); + void get(float &float_in); + void get(double &double_in); + void get(long double &ldouble_in); - void get(char **data_in) throw (DataTypeMismatchException); /* getting a void or string */ - void get(string &str_in) throw (DataTypeMismatchException); - void get(std::set &strset_in) throw (DataTypeMismatchException); + void get(char **data_in); /* getting a void or string */ + void get(string &str_in); + void get(std::set &strset_in); - void get(vector &strvect_in) throw (DataTypeMismatchException); - void get(vector &charvect_in) throw (DataTypeMismatchException); - void get(vector &ucharvect_in) throw (DataTypeMismatchException); - void get(vector &intvect_in) throw (DataTypeMismatchException); - void get(vector &uintvect_in) throw (DataTypeMismatchException); - void get(vector &longvect_in) throw (DataTypeMismatchException); - void get(vector &ulongvect_in) throw (DataTypeMismatchException); - void get(vector &llongvect_in) throw (DataTypeMismatchException); - void get(vector &floatvect_in) throw (DataTypeMismatchException); - void get(vector &doublevect_in) throw (DataTypeMismatchException); - void get(vector &ldoublevect_in) throw (DataTypeMismatchException); + void get(vector &strvect_in); + void get(vector &charvect_in); + void get(vector &ucharvect_in); + void get(vector &intvect_in); + void get(vector &uintvect_in); + void get(vector &longvect_in); + void get(vector &ulongvect_in); + void get(vector &llongvect_in); + void get(vector &floatvect_in); + void get(vector &doublevect_in); + void get(vector &ldoublevect_in); /* special get functions, saves creating unnecessary vars */ - int getChar() throw (DataTypeMismatchException) { char i_get; get(i_get); return i_get; }; - unsigned int getUChar() throw (DataTypeMismatchException) { unsigned char i_get; get(i_get); return i_get; }; - int getInt() throw (DataTypeMismatchException) { int i_get; get(i_get); return i_get; }; - unsigned int getUInt() throw (DataTypeMismatchException) { unsigned int i_get; get(i_get); return i_get; }; - long getLong() throw (DataTypeMismatchException) { long l_get; get(l_get); return l_get; }; - unsigned long getULong() throw (DataTypeMismatchException) { unsigned long l_get; get(l_get); return l_get; }; - long getLongLong() throw (DataTypeMismatchException) { long long l_get; get(l_get); return l_get; }; - float getFloat() throw (DataTypeMismatchException) { float f_get; get(f_get); return f_get; }; - double getDouble() throw (DataTypeMismatchException) { double d_get; get(d_get); return d_get; }; - long double getLongDouble() throw (DataTypeMismatchException) { long double d_get; get(d_get); return d_get; }; + int getChar() { char i_get; get(i_get); return i_get; }; + unsigned int getUChar() { unsigned char i_get; get(i_get); return i_get; }; + int getInt() { int i_get; get(i_get); return i_get; }; + unsigned int getUInt() { unsigned int i_get; get(i_get); return i_get; }; + long getLong() { long l_get; get(l_get); return l_get; }; + unsigned long getULong() { unsigned long l_get; get(l_get); return l_get; }; + long getLongLong() { long long l_get; get(l_get); return l_get; }; + float getFloat() { float f_get; get(f_get); return f_get; }; + double getDouble() { double d_get; get(d_get); return d_get; }; + long double getLongDouble() { long double d_get; get(d_get); return d_get; }; std::string toString(); @@ -248,14 +248,14 @@ public: DataElement *element(); /* DataElement at this node */ DataNode *newChild(const char *name_in); - DataNode *child(const char *name_in, int index = 0) throw (DataInvalidChildException); - DataNode *child(int index) throw (DataInvalidChildException); + DataNode *child(const char *name_in, int index = 0); + DataNode *child(int index); bool hasAnother(const char *name_in); /* useful for while() loops in conjunction with getNext() */ bool hasAnother(); - DataNode *getNext(const char *name_in) throw (DataInvalidChildException); /* get next of specified name */ - DataNode *getNext() throw (DataInvalidChildException); /* get next child */ + DataNode *getNext(const char *name_in); /* get next of specified name */ + DataNode *getNext(); /* get next child */ void rewind(const char *name_in); /* rewind specific */ void rewind(); /* rewind generic */ diff --git a/src/util/Timer.cpp b/src/util/Timer.cpp index bc6de22..aa449e7 100644 --- a/src/util/Timer.cpp +++ b/src/util/Timer.cpp @@ -41,7 +41,7 @@ void Timer::reset(void) void Timer::lockFramerate(float f_rate) { - lock_rate = 1.0/f_rate; + lock_rate = 1.0f/f_rate; lock_state = true; } diff --git a/src/visual/ColorTheme.cpp b/src/visual/ColorTheme.cpp index 3590c83..6180778 100644 --- a/src/visual/ColorTheme.cpp +++ b/src/visual/ColorTheme.cpp @@ -39,226 +39,226 @@ DefaultColorTheme::DefaultColorTheme() { waterfallGradient.addColor(GradientColor(0, 0, 1.0)); waterfallGradient.addColor(GradientColor(0, 1.0, 0)); waterfallGradient.addColor(GradientColor(1.0, 1.0, 0)); - waterfallGradient.addColor(GradientColor(1.0, 0.2, 0.0)); + waterfallGradient.addColor(GradientColor(1.0, 0.2f, 0.0)); waterfallGradient.generate(256); waterfallHighlight = RGBA4f(1, 1, 1); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(0.9, 0.9, 0.9); + fftLine = RGBA4f(0.9f, 0.9f, 0.9f); fftHighlight = RGBA4f(1, 1, 1); - scopeLine = RGBA4f(0.9, 0.9, 0.9); - tuningBarLight = RGBA4f(0.2, 0.2, 0.9); - tuningBarDark = RGBA4f(0.0, 0.0, 0.35); - tuningBarUp = RGBA4f(1.0, 139.0/255.0, 96.0/255.0); - tuningBarDown = RGBA4f(148.0/255.0, 148.0/255.0, 1.0); - meterLevel = RGBA4f(0.1, 0.75, 0.1); - meterValue = RGBA4f(0.75, 0.1, 0.1); + scopeLine = RGBA4f(0.9f, 0.9f, 0.9f); + tuningBarLight = RGBA4f(0.2f, 0.2f, 0.9f); + tuningBarDark = RGBA4f(0.0f, 0.0f, 0.35f); + tuningBarUp = RGBA4f(1.0f, 139.0f/255.0f, 96.0f/255.0f); + tuningBarDown = RGBA4f(148.0f/255.0f, 148.0f/255.0f, 1.0f); + meterLevel = RGBA4f(0.1f, 0.75f, 0.1f); + meterValue = RGBA4f(0.75f, 0.1f, 0.1f); text = RGBA4f(1, 1, 1); freqLine = RGBA4f(1, 1, 1); - button = RGBA4f(0.65, 0.65, 0.65); + button = RGBA4f(0.65f, 0.65f, 0.65f); buttonHighlight = RGBA4f(1, 1, 0); - scopeBackground = RGBA4f(0.1, 0.1, 0.1); - fftBackground = RGBA4f(0.1, 0.1, 0.1); - generalBackground = RGBA4f(0.1, 0.1, 0.1); + scopeBackground = RGBA4f(0.1f, 0.1f, 0.1f); + fftBackground = RGBA4f(0.1f, 0.1f, 0.1f); + generalBackground = RGBA4f(0.1f, 0.1f, 0.1f); } RadarColorTheme::RadarColorTheme() { name = "Rad"; - waterfallGradient.addColor(GradientColor(5.0 / 255.0, 45.0 / 255.0, 10.0 / 255.0)); - waterfallGradient.addColor(GradientColor(30.0 / 255.0, 150.0 / 255.0, 40.0 / 255.0)); - waterfallGradient.addColor(GradientColor(40.0 / 255.0, 240.0 / 255.0, 60.0 / 255.0)); - waterfallGradient.addColor(GradientColor(250.0 / 255.0, 250.0 / 255.0, 250.0 / 255.0)); + waterfallGradient.addColor(GradientColor(5.0f / 255.0f, 45.0f / 255.0f, 10.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(30.0f / 255.0f, 150.0f / 255.0f, 40.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(40.0f / 255.0f, 240.0f / 255.0f, 60.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(250.0f / 255.0f, 250.0f / 255.0f, 250.0f / 255.0f)); waterfallGradient.generate(256); waterfallHighlight = RGBA4f(1, 1, 1); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(0.8, 1.0, 0.8); + fftLine = RGBA4f(0.8f, 1.0f, 0.8f); fftHighlight = RGBA4f(1, 1, 1); - scopeLine = RGBA4f(0.8, 1.0, 0.8); - tuningBarLight = RGBA4f(0.0, 0.45, 0.0); - tuningBarDark = RGBA4f(0.0, 0.1, 0.0); - tuningBarUp = RGBA4f(1.0, 139.0/255.0, 96.0/255.0); - tuningBarDown = RGBA4f(148.0/255.0, 0.0, 0.0); - meterLevel = RGBA4f(0, 0.5, 0); - meterValue = RGBA4f(0, 0.5, 0); - text = RGBA4f(0.8, 1.0, 0.8); + scopeLine = RGBA4f(0.8f, 1.0f, 0.8f); + tuningBarLight = RGBA4f(0.0, 0.45f, 0.0); + tuningBarDark = RGBA4f(0.0, 0.1f, 0.0); + tuningBarUp = RGBA4f(1.0f, 139.0f/255.0f, 96.0f/255.0f); + tuningBarDown = RGBA4f(148.0f/255.0f, 0.0, 0.0); + meterLevel = RGBA4f(0, 0.5f, 0); + meterValue = RGBA4f(0, 0.5f, 0); + text = RGBA4f(0.8f, 1.0, 0.8f); freqLine = RGBA4f(1, 1, 1); - button = RGBA4f(0.65, 0.75, 0.65); - buttonHighlight = RGBA4f(0.65, 1.0, 0.65); + button = RGBA4f(0.65f, 0.75f, 0.65f); + buttonHighlight = RGBA4f(0.65f, 1.0f, 0.65f); - scopeBackground = RGBA4f(0.05, 0.1, 0.05); - fftBackground = RGBA4f(0.05, 0.1, 0.05); - generalBackground = RGBA4f(0.05, 0.1, 0.05); + scopeBackground = RGBA4f(0.05f, 0.1f, 0.05f); + fftBackground = RGBA4f(0.05f, 0.1f, 0.05f); + generalBackground = RGBA4f(0.05f, 0.1f, 0.05f); } BlackAndWhiteColorTheme::BlackAndWhiteColorTheme() { name = "Black & White"; waterfallGradient.addColor(GradientColor(0, 0, 0)); - waterfallGradient.addColor(GradientColor(0.75, 0.75, 0.75)); - waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0)); + waterfallGradient.addColor(GradientColor(0.75f, 0.75f, 0.75f)); + waterfallGradient.addColor(GradientColor(1.0f, 1.0f, 1.0f)); waterfallGradient.generate(256); - waterfallHighlight = RGBA4f(1, 1, 0.9); + waterfallHighlight = RGBA4f(1, 1, 0.9f); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(0.9, 0.9, 0.9); - fftHighlight = RGBA4f(1, 1, 0.9); - scopeLine = RGBA4f(0.9, 0.9, 0.9); - tuningBarLight = RGBA4f(0.4, 0.4, 0.4); - tuningBarDark = RGBA4f(0.1, 0.1, 0.1); - tuningBarUp = RGBA4f(0.8, 0.8, 0.8); - tuningBarDown = RGBA4f(0.4, 0.4, 0.4); - meterLevel = RGBA4f(0.5, 0.5, 0.5); - meterValue = RGBA4f(0.5, 0.5, 0.5); + fftLine = RGBA4f(0.9f, 0.9f, 0.9f); + fftHighlight = RGBA4f(1, 1, 0.9f); + scopeLine = RGBA4f(0.9f, 0.9f, 0.9f); + tuningBarLight = RGBA4f(0.4f, 0.4f, 0.4f); + tuningBarDark = RGBA4f(0.1f, 0.1f, 0.1f); + tuningBarUp = RGBA4f(0.8f, 0.8f, 0.8f); + tuningBarDown = RGBA4f(0.4f, 0.4f, 0.4f); + meterLevel = RGBA4f(0.5f, 0.5f, 0.5f); + meterValue = RGBA4f(0.5f, 0.5f, 0.5f); text = RGBA4f(1, 1, 1); freqLine = RGBA4f(1, 1, 1); - button = RGBA4f(0.65, 0.65, 0.65); + button = RGBA4f(0.65f, 0.65f, 0.65f); buttonHighlight = RGBA4f(1, 1, 1); - scopeBackground = RGBA4f(0.1, 0.1, 0.1); - fftBackground = RGBA4f(0.1, 0.1, 0.1); - generalBackground = RGBA4f(0.1, 0.1, 0.1); + scopeBackground = RGBA4f(0.1f, 0.1f, 0.1f); + fftBackground = RGBA4f(0.1f, 0.1f, 0.1f); + generalBackground = RGBA4f(0.1f, 0.1f, 0.1f); } SharpColorTheme::SharpColorTheme() { name = "Sharp"; waterfallGradient.addColor(GradientColor(0, 0, 0)); - waterfallGradient.addColor(GradientColor(0.0, 0, 0.5)); - waterfallGradient.addColor(GradientColor(0.0, 0.0, 1.0)); - waterfallGradient.addColor(GradientColor(65.0 / 255.0, 161.0 / 255.0, 1.0)); - waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0)); - waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0)); - waterfallGradient.addColor(GradientColor(1.0, 1.0, 0.5)); - waterfallGradient.addColor(GradientColor(1.0, 1.0, 0.0)); - waterfallGradient.addColor(GradientColor(1.0, 0.5, 0.0)); - waterfallGradient.addColor(GradientColor(1.0, 0.25, 0.0)); - waterfallGradient.addColor(GradientColor(0.5, 0.1, 0.0)); + waterfallGradient.addColor(GradientColor(0.0, 0, 0.5f)); + waterfallGradient.addColor(GradientColor(0.0, 0.0, 1.0f)); + waterfallGradient.addColor(GradientColor(65.0f / 255.0f, 161.0f / 255.0f, 1.0f)); + waterfallGradient.addColor(GradientColor(1.0f, 1.0f, 1.0f)); + waterfallGradient.addColor(GradientColor(1.0f, 1.0f, 1.0f)); + waterfallGradient.addColor(GradientColor(1.0f, 1.0f, 0.5f)); + waterfallGradient.addColor(GradientColor(1.0f, 1.0f, 0.0f)); + waterfallGradient.addColor(GradientColor(1.0f, 0.5f, 0.0f)); + waterfallGradient.addColor(GradientColor(1.0f, 0.25f, 0.0f)); + waterfallGradient.addColor(GradientColor(0.5f, 0.1f, 0.0f)); waterfallGradient.generate(256); - waterfallHighlight = RGBA4f(0.9, 0.9, 1.0); + waterfallHighlight = RGBA4f(0.9f, 0.9f, 1.0f); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(0.9, 0.9, 1.0); - fftHighlight = RGBA4f(0.9, 0.9, 1.0); - scopeLine = RGBA4f(0.85, 0.85, 1.0); - tuningBarLight = RGBA4f(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0); - tuningBarDark = RGBA4f(14.0 / 255.0, 53.0 / 255.0, 89.5 / 255.0); - tuningBarUp = RGBA4f(0.7, 0.7, 0.7); - tuningBarDown = RGBA4f(1.0, 0.0, 0.0); - meterLevel = RGBA4f(28.0 / 255.0, 106.0 / 255.0, 179.0 / 255.0); - meterValue = RGBA4f(190.0 / 255.0, 190.0 / 255.0, 60.0 / 255.0); - text = RGBA4f(0.9, 0.9, 1); - freqLine = RGBA4f(0.85, 0.85, 1.0); - button = RGBA4f(217.0 / 255.0, 218.0 / 255.0, 228.0 / 255.0); - buttonHighlight = RGBA4f(208.0 / 255.0, 249.0 / 255.0, 255.0 / 255.0); + fftLine = RGBA4f(0.9f, 0.9f, 1.0); + fftHighlight = RGBA4f(0.9f, 0.9f, 1.0); + scopeLine = RGBA4f(0.85f, 0.85f, 1.0); + tuningBarLight = RGBA4f(28.0f / 255.0f, 106.0f / 255.0f, 179.0f / 255.0f); + tuningBarDark = RGBA4f(14.0f / 255.0f, 53.0f / 255.0f, 89.5f / 255.0f); + tuningBarUp = RGBA4f(0.7f, 0.7f, 0.7f); + tuningBarDown = RGBA4f(1.0f, 0.0, 0.0); + meterLevel = RGBA4f(28.0f / 255.0f, 106.0f / 255.0f, 179.0f / 255.0f); + meterValue = RGBA4f(190.0f / 255.0f, 190.0f / 255.0f, 60.0f / 255.0f); + text = RGBA4f(0.9f, 0.9f, 1); + freqLine = RGBA4f(0.85f, 0.85f, 1.0f); + button = RGBA4f(217.0f / 255.0f, 218.0f / 255.0f, 228.0f / 255.0f); + buttonHighlight = RGBA4f(208.0f / 255.0f, 249.0f / 255.0f, 255.0f / 255.0f); - scopeBackground = RGBA4f(0.05, 0.05, 0.15); - fftBackground = RGBA4f(0.05, 0.05, 0.15); - generalBackground = RGBA4f(0.05, 0.05, 0.15); + scopeBackground = RGBA4f(0.05f, 0.05f, 0.15f); + fftBackground = RGBA4f(0.05f, 0.05f, 0.15f); + generalBackground = RGBA4f(0.05f, 0.05f, 0.15f); } RadColorTheme::RadColorTheme() { name = "Rad"; - waterfallGradient.addColor(GradientColor(0, 0, 0.5)); - waterfallGradient.addColor(GradientColor(25.0 / 255.0, 154.0 / 255.0, 0.0)); - waterfallGradient.addColor(GradientColor(201.0 / 255.0, 115.0 / 255.0, 0.0)); - waterfallGradient.addColor(GradientColor(1.0, 40.0 / 255.0, 40.0 / 255.0)); + waterfallGradient.addColor(GradientColor(0, 0, 0.5f)); + waterfallGradient.addColor(GradientColor(25.0f / 255.0f, 154.0f / 255.0f, 0.0)); + waterfallGradient.addColor(GradientColor(201.0f / 255.0f, 115.0f / 255.0f, 0.0)); + waterfallGradient.addColor(GradientColor(1.0, 40.0f / 255.0f, 40.0f / 255.0f)); waterfallGradient.addColor(GradientColor(1.0, 1.0, 1.0)); waterfallGradient.generate(256); waterfallHighlight = RGBA4f(1, 1, 1); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(1.0, 0.9, 0.9); + fftLine = RGBA4f(1.0, 0.9f, 0.9f); fftHighlight = RGBA4f(1, 1, 1); - scopeLine = RGBA4f(1.0, 0.9, 0.9); - tuningBarLight = RGBA4f(0.0, 0.45, 0.0); - tuningBarDark = RGBA4f(0.0, 0.1, 0.0); + scopeLine = RGBA4f(1.0, 0.9f, 0.9f); + tuningBarLight = RGBA4f(0.0, 0.45f, 0.0); + tuningBarDark = RGBA4f(0.0, 0.1f, 0.0); tuningBarUp = RGBA4f(1.0, 0.0, 0.0); - tuningBarDown = RGBA4f(0.0, 0.5, 1.0); - meterLevel = RGBA4f(0, 0.5, 0); - meterValue = RGBA4f(0.5, 0, 0); + tuningBarDown = RGBA4f(0.0, 0.5f, 1.0); + meterLevel = RGBA4f(0, 0.5f, 0); + meterValue = RGBA4f(0.5f, 0, 0); text = RGBA4f(1, 1, 1); freqLine = RGBA4f(1, 1, 1); - button = RGBA4f(0.65, 0.65, 0.65); - buttonHighlight = RGBA4f(0.76, 0.65, 0); + button = RGBA4f(0.65f, 0.65f, 0.65f); + buttonHighlight = RGBA4f(0.76f, 0.65f, 0); - scopeBackground = RGBA4f(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0); - fftBackground = RGBA4f(0, 0, 50.0 / 255.0); - generalBackground = RGBA4f(13.0 / 255.0, 47.0 / 255.0, 9.0 / 255.0); + scopeBackground = RGBA4f(13.0f / 255.0f, 47.0f / 255.0f, 9.0f / 255.0f); + fftBackground = RGBA4f(0, 0, 50.0f / 255.0f); + generalBackground = RGBA4f(13.0f / 255.0f, 47.0f / 255.0f, 9.0f / 255.0f); } TouchColorTheme::TouchColorTheme() { name = "Touch"; waterfallGradient.addColor(GradientColor(0, 0, 0)); - waterfallGradient.addColor(GradientColor(55.0 / 255.0, 40.0 / 255.0, 55.0 / 255.0)); - waterfallGradient.addColor(GradientColor(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0)); - waterfallGradient.addColor(GradientColor(0.0 / 255.0, 255.0 / 255.0, 255.0 / 255.0)); - waterfallGradient.addColor(GradientColor(10.0 / 255.0, 255.0 / 255.0, 85.0 / 255.0)); - waterfallGradient.addColor(GradientColor(255.0 / 255.0, 255.0 / 255.0, 75.0 / 255.0)); - waterfallGradient.addColor(GradientColor(255.0 / 255.0, 0.0 / 255.0, 0.0 / 255.0)); - waterfallGradient.addColor(GradientColor(255.0 / 255.0, 255.0 / 255.0, 255.0 / 255.0)); + waterfallGradient.addColor(GradientColor(55.0f / 255.0f, 40.0f / 255.0f, 55.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(61.0f / 255.0f, 57.0f / 255.0f, 88.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(0.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(10.0f / 255.0f, 255.0f / 255.0f, 85.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(255.0f / 255.0f, 255.0f / 255.0f, 75.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(255.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(255.0f / 255.0f, 255.0f / 255.0f, 255.0f / 255.0f)); waterfallGradient.generate(256); waterfallHighlight = RGBA4f(1, 1, 1); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0); - fftHighlight = RGBA4f(1.0, 1.0, 1.0); - scopeLine = RGBA4f(234.0 / 255.0, 232.0 / 255.0, 247.0 / 255.0); - tuningBarLight = RGBA4f(0.2, 0.2, 0.7); - tuningBarDark = RGBA4f(0.1, 0.1, 0.45); - tuningBarUp = RGBA4f(0.5, 139.0/255.0, 96.0/255.0); - tuningBarDown = RGBA4f(0.6, 108.0/255.0, 1.0); - meterLevel = RGBA4f(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0); - meterValue = RGBA4f(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0); + fftLine = RGBA4f(234.0f / 255.0f, 232.0f / 255.0f, 247.0f / 255.0f); + fftHighlight = RGBA4f(1.0f, 1.0f, 1.0f); + scopeLine = RGBA4f(234.0f / 255.0f, 232.0f / 255.0f, 247.0f / 255.0f); + tuningBarLight = RGBA4f(0.2f, 0.2f, 0.7f); + tuningBarDark = RGBA4f(0.1f, 0.1f, 0.45f); + tuningBarUp = RGBA4f(0.5f, 139.0f/255.0f, 96.0f/255.0f); + tuningBarDown = RGBA4f(0.6f, 108.0f/255.0f, 1.0f); + meterLevel = RGBA4f(61.0f / 255.0f, 57.0f / 255.0f, 88.0f / 255.0f); + meterValue = RGBA4f(61.0f / 255.0f, 57.0f / 255.0f, 88.0f / 255.0f); text = RGBA4f(1, 1, 1); freqLine = RGBA4f(1, 1, 1); - button = RGBA4f(1.0, 1.0, 1.0); - buttonHighlight = RGBA4f(208.0 / 255.0, 202.0 / 255.0, 247.0 / 255.0); + button = RGBA4f(1.0f, 1.0f, 1.0f); + buttonHighlight = RGBA4f(208.0f / 255.0f, 202.0f / 255.0f, 247.0f / 255.0f); - scopeBackground = RGBA4f(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0); - fftBackground = RGBA4f(39.0 / 255.0, 36.0 / 255.0, 56.0 / 255.0); - generalBackground = RGBA4f(61.0 / 255.0, 57.0 / 255.0, 88.0 / 255.0); + scopeBackground = RGBA4f(39.0f / 255.0f, 36.0f / 255.0f, 56.0f / 255.0f); + fftBackground = RGBA4f(39.0f / 255.0f, 36.0f / 255.0f, 56.0f / 255.0f); + generalBackground = RGBA4f(61.0f / 255.0f, 57.0f / 255.0f, 88.0f / 255.0f); } HDColorTheme::HDColorTheme() { name = "HD"; - waterfallGradient.addColor(GradientColor(5.0 / 255.0, 5.0 / 255.0, 60.0 / 255.0)); - waterfallGradient.addColor(GradientColor(5.0 / 255.0, 20.0 / 255.0, 120.0 / 255.0)); - waterfallGradient.addColor(GradientColor(50.0 / 255.0, 100.0 / 255.0, 200.0 / 255.0)); - waterfallGradient.addColor(GradientColor(75.0 / 255.0, 190.0 / 255.0, 100.0 / 255.0)); - waterfallGradient.addColor(GradientColor(240.0 / 255.0, 55.0 / 255.0, 5.0 / 255.0)); - waterfallGradient.addColor(GradientColor(255.0 / 255.0, 55.0 / 255.0, 100.0 / 255.0)); - waterfallGradient.addColor(GradientColor(255.0 / 255.0, 235.0 / 255.0, 100.0 / 255.0)); - waterfallGradient.addColor(GradientColor(250.0 / 255.0, 250.0 / 255.0, 250.0 / 255.0)); + waterfallGradient.addColor(GradientColor(5.0f / 255.0f, 5.0f / 255.0f, 60.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(5.0f / 255.0f, 20.0f / 255.0f, 120.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(50.0f / 255.0f, 100.0f / 255.0f, 200.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(75.0f / 255.0f, 190.0f / 255.0f, 100.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(240.0f / 255.0f, 55.0f / 255.0f, 5.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(255.0f / 255.0f, 55.0f / 255.0f, 100.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(255.0f / 255.0f, 235.0f / 255.0f, 100.0f / 255.0f)); + waterfallGradient.addColor(GradientColor(250.0f / 255.0f, 250.0f / 255.0f, 250.0f / 255.0f)); waterfallGradient.generate(256); waterfallHighlight = RGBA4f(1, 1, 1); waterfallNew = RGBA4f(0, 1, 0); waterfallHover = RGBA4f(1, 1, 0); waterfallDestroy = RGBA4f(1, 0, 0); - fftLine = RGBA4f(0.9, 0.9, 0.9); + fftLine = RGBA4f(0.9f, 0.9f, 0.9f); fftHighlight = RGBA4f(1, 1, 1); - scopeLine = RGBA4f(0.9, 0.9, 0.9); - tuningBarLight = RGBA4f(0.4, 0.4, 1.0); - tuningBarDark = RGBA4f(0.1, 0.1, 0.45); - tuningBarUp = RGBA4f(1.0, 139.0/255.0, 96.0/255.0); - tuningBarDown = RGBA4f(148.0/255.0, 148.0/255.0, 1.0); - meterLevel = RGBA4f(0, 0.5, 0); + scopeLine = RGBA4f(0.9f, 0.9f, 0.9f); + tuningBarLight = RGBA4f(0.4f, 0.4f, 1.0); + tuningBarDark = RGBA4f(0.1f, 0.1f, 0.45f); + tuningBarUp = RGBA4f(1.0, 139.0f/255.0f, 96.0f/255.0f); + tuningBarDown = RGBA4f(148.0f/255.0f, 148.0f/255.0f, 1.0f); + meterLevel = RGBA4f(0, 0.5f, 0); meterValue = RGBA4f(0.0, 0.0, 1.0); text = RGBA4f(1, 1, 1); freqLine = RGBA4f(1, 1, 1); - button = RGBA4f(0, 0.7, 0.7); + button = RGBA4f(0, 0.7f, 0.7f); buttonHighlight = RGBA4f(1, 1, 1); - scopeBackground = RGBA4f(0.0, 0.0, 48.0 / 255.0); - fftBackground = RGBA4f(0.0, 0.0, 48.0 / 255.0); + scopeBackground = RGBA4f(0.0, 0.0, 48.0f / 255.0f); + fftBackground = RGBA4f(0.0, 0.0, 48.0f / 255.0f); generalBackground = RGBA4f(0.0, 0.0, 0.0); } diff --git a/src/visual/GainCanvas.cpp b/src/visual/GainCanvas.cpp index cb1dce6..f58661b 100644 --- a/src/visual/GainCanvas.cpp +++ b/src/visual/GainCanvas.cpp @@ -36,7 +36,7 @@ GainCanvas::GainCanvas(wxWindow *parent, int *dispAttrs) : spacing = 2.0/numGains; barWidth = (1.0/numGains)*0.8; startPos = spacing/2.0; - barHeight = 0.8; + barHeight = 0.8f; refreshCounter = 0; } @@ -226,7 +226,7 @@ void GainCanvas::updateGainUI() { spacing = 2.0/numGains; barWidth = (1.0/numGains)*0.7; startPos = spacing/2.0; - barHeight = 0.8; + barHeight = 0.8f; RGBA4f c1, c2; @@ -260,7 +260,7 @@ void GainCanvas::updateGainUI() { gInfo->levelPanel.setBorderPx(0); gInfo->levelPanel.setMarginPx(1); - gInfo->levelPanel.setSize(1.0,0.8); + gInfo->levelPanel.setSize(1.0,0.8f); float levelVal = float(gInfo->current-gInfo->low)/float(gInfo->high-gInfo->low); gInfo->levelPanel.setSize(1.0, levelVal); gInfo->levelPanel.setPosition(0.0, (-1.0+(levelVal))); @@ -271,8 +271,8 @@ void GainCanvas::updateGainUI() { gInfo->highlightPanel.setBorderPx(0); gInfo->highlightPanel.setMarginPx(1); - gInfo->highlightPanel.setSize(1.0,0.8); - gInfo->highlightPanel.setPosition(0.0,-0.2); + gInfo->highlightPanel.setSize(1.0,0.8f); + gInfo->highlightPanel.setPosition(0.0,-0.2f); gInfo->highlightPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_X); gInfo->highlightPanel.setBlend(GL_ONE, GL_ONE); gInfo->highlightPanel.visible = false; @@ -326,8 +326,8 @@ void GainCanvas::setThemeColors() { c2.a = 1.0; gInfo->levelPanel.setFillColor(c1, c2); - c1 = RGBA4f(0.3,0.3,0.3,1.0); - c2 = RGBA4f(0.65,0.65,0.65,1.0);; + c1 = RGBA4f(0.3f,0.3f,0.3f,1.0f); + c2 = RGBA4f(0.65f,0.65f,0.65f,1.0f);; gInfo->highlightPanel.setFillColor(c1, c2); } Refresh(); diff --git a/src/visual/MeterCanvas.cpp b/src/visual/MeterCanvas.cpp index d92c571..c1bb2ad 100644 --- a/src/visual/MeterCanvas.cpp +++ b/src/visual/MeterCanvas.cpp @@ -91,7 +91,7 @@ void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { glContext->Draw(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 0.5, 1.0); if (mouseTracker.mouseInView()) { - glContext->Draw(0.4, 0.4, 0.4, 0.5, mouseTracker.getMouseY()); + glContext->Draw(0.4f, 0.4f, 0.4f, 0.5f, mouseTracker.getMouseY()); } glContext->Draw(ThemeMgr::mgr.currentTheme->meterLevel.r, ThemeMgr::mgr.currentTheme->meterLevel.g, ThemeMgr::mgr.currentTheme->meterLevel.b, 0.5, (level-level_min) / (level_max-level_min)); if (showUserInput) { diff --git a/src/visual/PrimaryGLContext.cpp b/src/visual/PrimaryGLContext.cpp index 9cbfd4f..75abef3 100644 --- a/src/visual/PrimaryGLContext.cpp +++ b/src/visual/PrimaryGLContext.cpp @@ -90,7 +90,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(color.r, color.g, color.b, 0.6); + glColor4f(color.r, color.g, color.b, 0.6f); float ofs = ((float) demod->getBandwidth()) / (float) srate; float ofsLeft = (demod->getDemodulatorType()!="USB")?ofs:0, ofsRight = (demod->getDemodulatorType()!="LSB")?ofs:0; @@ -104,13 +104,13 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l bool isSolo = soloMode && demod == wxGetApp().getDemodMgr().getLastActiveDemodulator(); if (isSolo) { - glColor4f(0.8, 0.8, 0, 0.35); + glColor4f(0.8f, 0.8f, 0, 0.35f); } else if (demod->isMuted()) { - glColor4f(0.8, 0, 0, 0.35); + glColor4f(0.8f, 0, 0, 0.35f); } else if (soloMode) { - glColor4f(0.2, 0, 0, 0.35); + glColor4f(0.2f, 0, 0, 0.35f); } else { - glColor4f(0, 0, 0, 0.35); + glColor4f(0, 0, 0, 0.35f); } glBegin(GL_QUADS); @@ -123,7 +123,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glColor4f(color.r, color.g, color.b, 0.2); + glColor4f(color.r, color.g, color.b, 0.2f); glBegin(GL_QUADS); glVertex3f(uxPos - ofsLeft, 1.0, 0.0); glVertex3f(uxPos - ofsLeft, -1.0, 0.0); @@ -133,7 +133,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l glEnd(); if (ofs * 2.0 < 16.0 / viewWidth) { - glColor4f(color.r, color.g, color.b, 0.2); + glColor4f(color.r, color.g, color.b, 0.2f); glBegin(GL_QUADS); glVertex3f(uxPos - ofsLeft, hPos + labelHeight, 0.0); glVertex3f(uxPos - ofsLeft, -1.0, 0.0); @@ -151,7 +151,7 @@ void PrimaryGLContext::DrawDemodInfo(DemodulatorInstance *demod, RGBA4f color, l glEnd(); } - glColor4f(1.0, 1.0, 1.0, 0.8); + glColor4f(1.0, 1.0, 1.0, 0.8f); std::string demodLabel = demod->getLabel(); @@ -207,7 +207,7 @@ void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4f(0, 0, 0, 0.35); + glColor4f(0, 0, 0, 0.35f); glBegin(GL_QUADS); glVertex3f(uxPos - ofsLeft, hPos + labelHeight, 0.0); @@ -219,7 +219,7 @@ void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glColor4f(color.r, color.g, color.b, 0.1); + glColor4f(color.r, color.g, color.b, 0.1f); glBegin(GL_QUADS); glVertex3f(uxPos - ofsLeft, 1.0, 0.0); glVertex3f(uxPos - ofsLeft, -1.0, 0.0); @@ -229,7 +229,7 @@ void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long glEnd(); if (ofs * 2.0 < 16.0 / viewWidth) { - glColor4f(color.r, color.g, color.b, 0.1); + glColor4f(color.r, color.g, color.b, 0.1f); glBegin(GL_QUADS); glVertex3f(uxPos - ofsLeft, hPos + labelHeight, 0.0); glVertex3f(uxPos - ofsLeft, -1.0, 0.0); @@ -247,7 +247,7 @@ void PrimaryGLContext::DrawFreqBwInfo(long long freq, int bw, RGBA4f color, long glEnd(); } - glColor4f(1.0, 1.0, 1.0, 0.8); + glColor4f(1.0, 1.0, 1.0, 0.8f); std::string demodLabel = std::to_string((double)freq/1000000.0); @@ -306,7 +306,7 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, RGBA4f color, long glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glColor4f(color.r, color.g, color.b, 0.6); + glColor4f(color.r, color.g, color.b, 0.6f); float ofs = ((float) demod->getBandwidth()) / (float) srate; float ofsLeft = (demod->getDemodulatorType()!="USB")?ofs:0, ofsRight = (demod->getDemodulatorType()!="LSB")?ofs:0; @@ -410,7 +410,7 @@ void PrimaryGLContext::DrawFreqSelector(float uxPos, RGBA4f color, float w, long glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glColor4f(color.r, color.g, color.b, 0.6); + glColor4f(color.r, color.g, color.b, 0.6f); glBegin(GL_LINES); @@ -453,7 +453,7 @@ void PrimaryGLContext::DrawRangeSelector(float uxPos1, float uxPos2, RGBA4f colo glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glColor4f(color.r, color.g, color.b, 0.6); + glColor4f(color.r, color.g, color.b, 0.6f); glLineWidth((last_type == "USB")?2.0:1.0); diff --git a/src/visual/ScopeCanvas.cpp b/src/visual/ScopeCanvas.cpp index 166ac89..2aa6e22 100644 --- a/src/visual/ScopeCanvas.cpp +++ b/src/visual/ScopeCanvas.cpp @@ -33,9 +33,9 @@ ScopeCanvas::ScopeCanvas(wxWindow *parent, int *dispAttrs) : InteractiveCanvas(p glContext = new ScopeContext(this, &wxGetApp().GetContext(this)); inputData.set_max_num_items(2); bgPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_Y); - bgPanel.setSize(1.0, 0.5); - bgPanel.setPosition(0.0, -0.5); - panelSpacing = 0.4; + bgPanel.setSize(1.0, 0.5f); + bgPanel.setPosition(0.0, -0.5f); + panelSpacing = 0.4f; parentPanel.addChild(&scopePanel); parentPanel.addChild(&spectrumPanel); @@ -147,7 +147,7 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - CubicVR::mat4 modelView = CubicVR::mat4::lookat(0, 0, -1.205, 0, 0, 0, 0, -1, 0); + CubicVR::mat4 modelView = CubicVR::mat4::lookat(0, 0, -1.205f, 0, 0, 0, 0, -1, 0); float panelWidth = 1.0; float panelInterval = (panelWidth * 2.0 + panelSpacing); diff --git a/src/visual/ScopeContext.cpp b/src/visual/ScopeContext.cpp index 89e8a7d..8e1ba91 100644 --- a/src/visual/ScopeContext.cpp +++ b/src/visual/ScopeContext.cpp @@ -33,11 +33,11 @@ void ScopeContext::DrawTunerTitles(bool ppmMode) { float viewHeight = (float) vp[3]; float hPos = (float) (13) / viewHeight; - glColor3f(0.65, 0.65, 0.65); + glColor3f(0.65f, 0.65f, 0.65f); - GLFont::getFont(GLFont::GLFONT_SIZE12).drawString(ppmMode?"Device PPM":"Frequency", -0.66, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true); + GLFont::getFont(GLFont::GLFONT_SIZE12).drawString(ppmMode?"Device PPM":"Frequency", -0.66f, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true); GLFont::getFont(GLFont::GLFONT_SIZE12).drawString("Bandwidth", 0.0, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true); - GLFont::getFont(GLFont::GLFONT_SIZE12).drawString("Center Frequency", 0.66, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true); + GLFont::getFont(GLFont::GLFONT_SIZE12).drawString("Center Frequency", 0.66f, -1.0+hPos, 12, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true); } void ScopeContext::DrawDeviceName(std::string deviceName) { @@ -46,7 +46,7 @@ void ScopeContext::DrawDeviceName(std::string deviceName) { float viewHeight = (float) vp[3]; float hPos = (float) (viewHeight - 20) / viewHeight; - glColor3f(0.65, 0.65, 0.65); + glColor3f(0.65f, 0.65f, 0.65f); GLFont::getFont(GLFont::GLFONT_SIZE12).drawString(deviceName.c_str(), 1.0, hPos, 12, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER, 0, 0, true); } diff --git a/src/visual/TuningCanvas.cpp b/src/visual/TuningCanvas.cpp index 4302cf5..1f20f11 100644 --- a/src/visual/TuningCanvas.cpp +++ b/src/visual/TuningCanvas.cpp @@ -42,13 +42,13 @@ TuningCanvas::TuningCanvas(wxWindow *parent, int *dispAttrs) : dragging = false; freqDP = -1.0; - freqW = (1.0 / 3.0) * 2.0; + freqW = (1.0f / 3.0f) * 2.0f; bwDP = -1.0 + (2.25 / 3.0); bwW = (1.0 / 4.0) * 2.0; - centerDP = -1.0 + (2.0 / 3.0) * 2.0; - centerW = (1.0 / 3.0) * 2.0; + centerDP = -1.0f + (2.0f / 3.0f) * 2.0f; + centerW = (1.0f / 3.0f) * 2.0f; currentPPM = lastPPM = 0; } diff --git a/src/visual/TuningContext.cpp b/src/visual/TuningContext.cpp index 1ce70f8..80b741e 100644 --- a/src/visual/TuningContext.cpp +++ b/src/visual/TuningContext.cpp @@ -98,7 +98,7 @@ void TuningContext::DrawTuner(long long freq, int count, float displayPos, float GLFont::getFont(fontSize).drawString(freqStr.str().substr(i - ofs, 1), xpos, 0, fontHeight, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER); } - glColor4f(0.65, 0.65, 0.65, 0.25); + glColor4f(0.65f, 0.65f, 0.65f, 0.25f); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBegin(GL_LINES); @@ -158,7 +158,7 @@ bool bottom) { float p2 = displayPos + ofs * (float) (count - start + 1); float p1 = displayPos + ofs * (float) (count - end); - float r = color.r, g = color.g, b = color.b, a = 0.6; + float r = color.r, g = color.g, b = color.b, a = 0.6f; glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); @@ -184,8 +184,8 @@ bool bottom) { } void TuningContext::DrawDemodFreqBw(long long freq, unsigned int bw, long long center) { - DrawTuner(freq, 11, -1.0, (1.0 / 3.0) * 2.0); - DrawTuner(bw, 7, -1.0 + (2.25 / 3.0), (1.0 / 4.0) * 2.0); - DrawTuner(center, 11, -1.0 + (2.0 / 3.0) * 2.0, (1.0 / 3.0) * 2.0); + DrawTuner(freq, 11, -1.0, (1.0f / 3.0f) * 2.0f); + DrawTuner(bw, 7, -1.0 + (2.25f / 3.0f), (1.0f / 4.0f) * 2.0f); + DrawTuner(center, 11, -1.0 + (2.0f / 3.0f) * 2.0, (1.0f / 3.0f) * 2.0f); } diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 740efab..51c53b2 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -355,7 +355,7 @@ void WaterfallCanvas::OnKeyUp(wxKeyEvent& event) { scaleMove = 0.0; zoom = 1.0; if (mouseZoom != 1.0) { - mouseZoom = 0.95; + mouseZoom = 0.95f; } break; case WXK_DOWN: @@ -363,7 +363,7 @@ void WaterfallCanvas::OnKeyUp(wxKeyEvent& event) { scaleMove = 0.0; zoom = 1.0; if (mouseZoom != 1.0) { - mouseZoom = 1.05; + mouseZoom = 1.05f; } break; case WXK_LEFT: @@ -388,7 +388,7 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) { case WXK_NUMPAD_UP: if (!shiftDown) { mouseZoom = 1.0; - zoom = 0.95; + zoom = 0.95f; } else { scaleMove = 1.0; } @@ -397,7 +397,7 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) { case WXK_NUMPAD_DOWN: if (!shiftDown) { mouseZoom = 1.0; - zoom = 1.05; + zoom = 1.05f; } else { scaleMove = -1.0; }