From b64d813cfc4b8b3e50fb4f29acbfa75c5f70d9ac Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 19 Apr 2020 06:13:32 +0200 Subject: [PATCH] Fixed some warnings from Mac ports compilation --- plugins/channelrx/demodatv/atvdemodgui.cpp | 4 ++-- plugins/channelrx/demoddatv/leansdr/bch.h | 4 ++-- .../channelrx/demoddatv/leansdr/discrmath.h | 2 +- plugins/channelrx/demodssb/ssbdemodsink.cpp | 2 +- plugins/channelrx/localsink/localsinkgui.cpp | 2 -- plugins/channelrx/localsink/localsinkgui.h | 2 -- .../channelrx/remotesink/remotesinkgui.cpp | 2 -- plugins/channelrx/remotesink/remotesinkgui.h | 2 -- .../channeltx/filesource/filesourcegui.cpp | 2 -- plugins/channeltx/filesource/filesourcegui.h | 3 --- .../channeltx/localsource/localsourcegui.cpp | 2 -- .../channeltx/localsource/localsourcegui.h | 2 -- plugins/channeltx/modatv/atvmodbaseband.cpp | 11 ++++++++++ .../samplesink/testsink/testsinkplugin.cpp | 2 +- .../samplesource/localinput/localinputgui.cpp | 2 -- .../samplesource/localinput/localinputgui.h | 1 - .../samplesource/remoteinput/remoteinputgui.h | 3 ++- sdrbase/device/deviceapi.cpp | 10 ++++----- sdrbase/dsp/fftwengine.cpp | 21 +++++++++++++++++-- sdrbase/dsp/fftwengine.h | 17 +++++++++++++++ sdrbase/dsp/samplesinkfifo.h | 4 ++-- sdrbase/plugin/pluginmanager.cpp | 3 ++- sdrbase/settings/mainsettings.cpp | 6 ++++-- sdrgui/device/deviceuiset.cpp | 8 ++++--- sdrgui/gui/levelmeter.h | 5 +++-- sdrgui/mainwindow.cpp | 4 ++-- sdrsrv/device/deviceset.cpp | 8 ++++--- 27 files changed, 84 insertions(+), 50 deletions(-) diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 01c0d4386..fa7ed094f 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -153,11 +153,11 @@ void ATVDemodGUI::displayStreamIndex() void ATVDemodGUI::displayRFBandwidths() { int sliderPosition = m_settings.m_fftBandwidth / m_rfSliderDivisor; - sliderPosition < 1 ? 1 : sliderPosition > 100 ? 100 : sliderPosition; + sliderPosition = sliderPosition < 1 ? 1 : sliderPosition > 100 ? 100 : sliderPosition; ui->rfBW->setValue(sliderPosition); ui->rfBWText->setText(QString("%1k").arg((sliderPosition * m_rfSliderDivisor) / 1000.0, 0, 'f', 0)); sliderPosition = m_settings.m_fftOppBandwidth / m_rfSliderDivisor; - sliderPosition < 0 ? 0 : sliderPosition > 100 ? 100 : sliderPosition; + sliderPosition = sliderPosition < 0 ? 0 : sliderPosition > 100 ? 100 : sliderPosition; ui->rfOppBW->setValue(sliderPosition); ui->rfOppBWText->setText(QString("%1k").arg((sliderPosition * m_rfSliderDivisor) / 1000.0, 0, 'f', 0)); } diff --git a/plugins/channelrx/demoddatv/leansdr/bch.h b/plugins/channelrx/demoddatv/leansdr/bch.h index 8fb4c11db..5462a7681 100644 --- a/plugins/channelrx/demoddatv/leansdr/bch.h +++ b/plugins/channelrx/demoddatv/leansdr/bch.h @@ -151,11 +151,11 @@ struct bch_engine : bch_interface if (2 * L <= n) { TGF *tmp = new TGF[NN]; // replaced crap code - memcpy(tmp, C, sizeof(tmp)); + std::copy(C, C+NN, tmp); //memcpy(tmp, C, sizeof(tmp)); for (int i = 0; i < NN - m; ++i) C[m + i] = GF.sub(C[m + i], GF.mul(d_div_b, B[i])); L = n + 1 - L; - memcpy(B, tmp, sizeof(B)); + std::copy(tmp, tmp+NN, B); //memcpy(B, tmp, sizeof(B)); b = d; m = 1; delete[] tmp; diff --git a/plugins/channelrx/demoddatv/leansdr/discrmath.h b/plugins/channelrx/demoddatv/leansdr/discrmath.h index 541f4ae53..285e6b0d5 100644 --- a/plugins/channelrx/demoddatv/leansdr/discrmath.h +++ b/plugins/channelrx/demoddatv/leansdr/discrmath.h @@ -231,7 +231,7 @@ struct gf2n lut_exp[((1 << N) - 1) + i] = alpha_i; // Wrap to avoid modulo 2^N-1 lut_log[alpha_i] = i; bool overflow = alpha_i & (1 << (N - 1)); - alpha_i <<= 1; // Multiply by alpha=[X] i.e. increase degrees + alpha_i *= 2; // Multiply by alpha=[X] i.e. increase degrees alpha_i &= ~((~(Te)0) << N); // In case Te is wider than N bits if (overflow) alpha_i ^= TRUNCP; // Modulo P iteratively diff --git a/plugins/channelrx/demodssb/ssbdemodsink.cpp b/plugins/channelrx/demodssb/ssbdemodsink.cpp index 60db0ff8c..ba140707f 100644 --- a/plugins/channelrx/demodssb/ssbdemodsink.cpp +++ b/plugins/channelrx/demodssb/ssbdemodsink.cpp @@ -31,7 +31,7 @@ #include "ssbdemodsink.h" const int SSBDemodSink::m_ssbFftLen = 1024; -const int SSBDemodSink::m_agcTarget = 3276.8; // -10 dB amplitude => -20 dB power: center of normal signal +const int SSBDemodSink::m_agcTarget = 3276; // 32768/10 -10 dB amplitude => -20 dB power: center of normal signal SSBDemodSink::SSBDemodSink() : m_audioBinaual(false), diff --git a/plugins/channelrx/localsink/localsinkgui.cpp b/plugins/channelrx/localsink/localsinkgui.cpp index 8c0bfc902..bcf5a0d0c 100644 --- a/plugins/channelrx/localsink/localsinkgui.cpp +++ b/plugins/channelrx/localsink/localsinkgui.cpp @@ -143,8 +143,6 @@ LocalSinkGUI::LocalSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); //connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); - m_time.start(); - updateLocalDevices(); displaySettings(); applySettings(true); diff --git a/plugins/channelrx/localsink/localsinkgui.h b/plugins/channelrx/localsink/localsinkgui.h index 7de6502b0..f6607aae3 100644 --- a/plugins/channelrx/localsink/localsinkgui.h +++ b/plugins/channelrx/localsink/localsinkgui.h @@ -21,7 +21,6 @@ #include #include -#include #include "plugin/plugininstancegui.h" #include "dsp/channelmarker.h" @@ -69,7 +68,6 @@ private: LocalSink* m_localSink; MessageQueue m_inputMessageQueue; - QTime m_time; uint32_t m_tickCount; explicit LocalSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); diff --git a/plugins/channelrx/remotesink/remotesinkgui.cpp b/plugins/channelrx/remotesink/remotesinkgui.cpp index 2447a1a19..13f248097 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.cpp +++ b/plugins/channelrx/remotesink/remotesinkgui.cpp @@ -143,8 +143,6 @@ RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); //connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); - m_time.start(); - displaySettings(); applySettings(true); } diff --git a/plugins/channelrx/remotesink/remotesinkgui.h b/plugins/channelrx/remotesink/remotesinkgui.h index 295d5471a..7ba48fc0c 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.h +++ b/plugins/channelrx/remotesink/remotesinkgui.h @@ -21,7 +21,6 @@ #include #include -#include #include "plugin/plugininstancegui.h" #include "dsp/channelmarker.h" @@ -70,7 +69,6 @@ private: RemoteSink* m_remoteSink; MessageQueue m_inputMessageQueue; - QTime m_time; uint32_t m_tickCount; explicit RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); diff --git a/plugins/channeltx/filesource/filesourcegui.cpp b/plugins/channeltx/filesource/filesourcegui.cpp index 40809c71a..2e1957ae2 100644 --- a/plugins/channeltx/filesource/filesourcegui.cpp +++ b/plugins/channeltx/filesource/filesourcegui.cpp @@ -230,8 +230,6 @@ FileSourceGUI::FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor())); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); - m_time.start(); - displaySettings(); applySettings(true); } diff --git a/plugins/channeltx/filesource/filesourcegui.h b/plugins/channeltx/filesource/filesourcegui.h index e696d0456..ffd2820e0 100644 --- a/plugins/channeltx/filesource/filesourcegui.h +++ b/plugins/channeltx/filesource/filesourcegui.h @@ -18,8 +18,6 @@ #ifndef PLUGINS_CHANNELTX_FILESOURCE_FILESOURCEGUI_H_ #define PLUGINS_CHANNELTX_FILESOURCE_FILESOURCEGUI_H_ -#include - #include "plugin/plugininstancegui.h" #include "dsp/channelmarker.h" #include "gui/rollupwidget.h" @@ -78,7 +76,6 @@ private: FileSource* m_fileSource; MessageQueue m_inputMessageQueue; - QTime m_time; uint32_t m_tickCount; explicit FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget* parent = nullptr); diff --git a/plugins/channeltx/localsource/localsourcegui.cpp b/plugins/channeltx/localsource/localsourcegui.cpp index aaf1f18ac..65106f036 100644 --- a/plugins/channeltx/localsource/localsourcegui.cpp +++ b/plugins/channeltx/localsource/localsourcegui.cpp @@ -138,8 +138,6 @@ LocalSourceGUI::LocalSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); //connect(&(m_deviceUISet->m_deviceSourceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); - m_time.start(); - updateLocalDevices(); displaySettings(); applySettings(true); diff --git a/plugins/channeltx/localsource/localsourcegui.h b/plugins/channeltx/localsource/localsourcegui.h index f9ebbbe7b..3b0ea0d89 100644 --- a/plugins/channeltx/localsource/localsourcegui.h +++ b/plugins/channeltx/localsource/localsourcegui.h @@ -21,7 +21,6 @@ #include #include -#include #include "plugin/plugininstancegui.h" #include "dsp/channelmarker.h" @@ -70,7 +69,6 @@ private: LocalSource* m_localSource; MessageQueue m_inputMessageQueue; - QTime m_time; uint32_t m_tickCount; explicit LocalSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel, QWidget* parent = 0); diff --git a/plugins/channeltx/modatv/atvmodbaseband.cpp b/plugins/channeltx/modatv/atvmodbaseband.cpp index fff64b1a6..ade9e01cc 100644 --- a/plugins/channeltx/modatv/atvmodbaseband.cpp +++ b/plugins/channeltx/modatv/atvmodbaseband.cpp @@ -179,6 +179,8 @@ bool ATVModBaseband::handleMessage(const Message& cmd) MsgConfigureImageFileName& cfg = (MsgConfigureImageFileName&) cmd; qDebug() << "ATVModBaseband::handleMessage: MsgConfigureImageFileName: fileNaem: " << cfg.getFileName(); m_source.openImage(cfg.getFileName()); + + return true; } else if (MsgConfigureVideoFileName::match(cmd)) { @@ -186,6 +188,8 @@ bool ATVModBaseband::handleMessage(const Message& cmd) MsgConfigureVideoFileName& cfg = (MsgConfigureVideoFileName&) cmd; qDebug() << "ATVModBaseband::handleMessage: MsgConfigureVideoFileName: fileName: " << cfg.getFileName(); m_source.openVideo( cfg.getFileName()); + + return true; } else if (MsgConfigureVideoFileSourceSeek::match(cmd)) { @@ -193,10 +197,13 @@ bool ATVModBaseband::handleMessage(const Message& cmd) MsgConfigureVideoFileSourceSeek& cfg = (MsgConfigureVideoFileSourceSeek&) cmd; qDebug() << "ATVModBaseband::handleMessage: MsgConfigureVideoFileName: precnetage: " << cfg.getPercentage(); m_source.seekVideoFileStream(cfg.getPercentage()); + + return true; } else if (MsgConfigureVideoFileSourceStreamTiming::match(cmd)) { m_source.reportVideoFileSourceStreamTiming(); + return true; } else if (MsgConfigureCameraIndex::match(cmd)) { @@ -204,12 +211,16 @@ bool ATVModBaseband::handleMessage(const Message& cmd) MsgConfigureCameraIndex& cfg = (MsgConfigureCameraIndex&) cmd; uint32_t index = cfg.getIndex() & 0x7FFFFFF; m_source.configureCameraIndex(index); + + return true; } else if (MsgConfigureCameraData::match(cmd)) { QMutexLocker mutexLocker(&m_mutex); MsgConfigureCameraData& cfg = (MsgConfigureCameraData&) cmd; m_source.configureCameraData(cfg.getIndex(), cfg.getManualFPS(), cfg.getManualFPSEnable()); + + return true; } else { diff --git a/plugins/samplesink/testsink/testsinkplugin.cpp b/plugins/samplesink/testsink/testsinkplugin.cpp index 4e2cc1605..79b85de67 100644 --- a/plugins/samplesink/testsink/testsinkplugin.cpp +++ b/plugins/samplesink/testsink/testsinkplugin.cpp @@ -64,7 +64,7 @@ void TestSinkPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& originDevices.append(OriginDevice( "TestSink", m_hardwareID, - QString::null, + QString(), 0, // Sequence 0, // nb Rx 1 // nb Tx diff --git a/plugins/samplesource/localinput/localinputgui.cpp b/plugins/samplesource/localinput/localinputgui.cpp index 28468067c..6616fe0ea 100644 --- a/plugins/samplesource/localinput/localinputgui.cpp +++ b/plugins/samplesource/localinput/localinputgui.cpp @@ -104,8 +104,6 @@ LocalInputGui::LocalInputGui(DeviceUISet *deviceUISet, QWidget* parent) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - m_eventsTime.start(); - m_forceSettings = true; sendSettings(); } diff --git a/plugins/samplesource/localinput/localinputgui.h b/plugins/samplesource/localinput/localinputgui.h index 88ef503cf..f71096570 100644 --- a/plugins/samplesource/localinput/localinputgui.h +++ b/plugins/samplesource/localinput/localinputgui.h @@ -95,7 +95,6 @@ private: uint32_t m_countUnrecoverable; uint32_t m_countRecovered; - QTime m_eventsTime; bool m_doApplySettings; bool m_forceSettings; diff --git a/plugins/samplesource/remoteinput/remoteinputgui.h b/plugins/samplesource/remoteinput/remoteinputgui.h index ebe8a2dc4..a015af63c 100644 --- a/plugins/samplesource/remoteinput/remoteinputgui.h +++ b/plugins/samplesource/remoteinput/remoteinputgui.h @@ -19,6 +19,7 @@ #define INCLUDE_REMOTEINPUTGUI_H #include +#include #include #include @@ -95,7 +96,7 @@ private: uint32_t m_countUnrecoverable; uint32_t m_countRecovered; - QTime m_eventsTime; + QElapsedTimer m_eventsTime; bool m_doApplySettings; bool m_forceSettings; diff --git a/sdrbase/device/deviceapi.cpp b/sdrbase/device/deviceapi.cpp index 82de5b155..624e2776a 100644 --- a/sdrbase/device/deviceapi.cpp +++ b/sdrbase/device/deviceapi.cpp @@ -433,19 +433,19 @@ void DeviceAPI::getDeviceEngineStateStr(QString& state, int subsystemIndex) { switch(m_deviceMIMOEngine->state(subsystemIndex)) { - case DSPDeviceSinkEngine::StNotStarted: + case DSPDeviceMIMOEngine::StNotStarted: state = "notStarted"; break; - case DSPDeviceSinkEngine::StIdle: + case DSPDeviceMIMOEngine::StIdle: state = "idle"; break; - case DSPDeviceSinkEngine::StReady: + case DSPDeviceMIMOEngine::StReady: state = "ready"; break; - case DSPDeviceSinkEngine::StRunning: + case DSPDeviceMIMOEngine::StRunning: state = "running"; break; - case DSPDeviceSinkEngine::StError: + case DSPDeviceMIMOEngine::StError: state = "error"; break; default: diff --git a/sdrbase/dsp/fftwengine.cpp b/sdrbase/dsp/fftwengine.cpp index 969b7f9b7..c1cde69ad 100644 --- a/sdrbase/dsp/fftwengine.cpp +++ b/sdrbase/dsp/fftwengine.cpp @@ -1,4 +1,21 @@ -#include +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2015-2020 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include #include "dsp/fftwengine.h" FFTWEngine::FFTWEngine(const QString& fftWisdomFileName) : @@ -33,7 +50,7 @@ void FFTWEngine::configure(int n, bool inverse) m_currentPlan->inverse = inverse; m_currentPlan->in = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * n); m_currentPlan->out = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * n); - QTime t; + QElapsedTimer t; t.start(); m_globalPlanMutex.lock(); diff --git a/sdrbase/dsp/fftwengine.h b/sdrbase/dsp/fftwengine.h index 67f789e6d..a8a16fea3 100644 --- a/sdrbase/dsp/fftwengine.h +++ b/sdrbase/dsp/fftwengine.h @@ -1,3 +1,20 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2015-2020 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + #ifndef INCLUDE_FFTWENGINE_H #define INCLUDE_FFTWENGINE_H diff --git a/sdrbase/dsp/samplesinkfifo.h b/sdrbase/dsp/samplesinkfifo.h index ad3db9f95..316acd6eb 100644 --- a/sdrbase/dsp/samplesinkfifo.h +++ b/sdrbase/dsp/samplesinkfifo.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include "dsp/dsptypes.h" #include "export.h" @@ -30,7 +30,7 @@ class SDRBASE_API SampleSinkFifo : public QObject { private: QMutex m_mutex; - QTime m_msgRateTimer; + QElapsedTimer m_msgRateTimer; int m_suppressed; SampleVector m_data; diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index 9d5c44dc7..0fc60cb5f 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include "device/deviceenumerator.h" @@ -102,7 +103,7 @@ void PluginManager::loadPluginsPart(const QString& pluginsSubDir) void PluginManager::loadPluginsFinal() { - qSort(m_plugins); + std::sort(m_plugins.begin(), m_plugins.end()); for (Plugins::const_iterator it = m_plugins.begin(); it != m_plugins.end(); ++it) { diff --git a/sdrbase/settings/mainsettings.cpp b/sdrbase/settings/mainsettings.cpp index 5b23d1b66..cf4b513a4 100644 --- a/sdrbase/settings/mainsettings.cpp +++ b/sdrbase/settings/mainsettings.cpp @@ -1,6 +1,8 @@ #include #include +#include + #include "settings/mainsettings.h" #include "commands/command.h" #include "audio/audiodevicemanager.h" @@ -190,7 +192,7 @@ void MainSettings::deletePresetGroup(const QString& groupName) void MainSettings::sortPresets() { - qSort(m_presets.begin(), m_presets.end(), Preset::presetCompare); + std::sort(m_presets.begin(), m_presets.end(), Preset::presetCompare); } void MainSettings::renamePresetGroup(const QString& oldGroupName, const QString& newGroupName) @@ -266,7 +268,7 @@ void MainSettings::deleteCommandGroup(const QString& groupName) void MainSettings::sortCommands() { - qSort(m_commands.begin(), m_commands.end(), Command::commandCompare); + std::sort(m_commands.begin(), m_commands.end(), Command::commandCompare); } void MainSettings::renameCommandGroup(const QString& oldGroupName, const QString& newGroupName) diff --git a/sdrgui/device/deviceuiset.cpp b/sdrgui/device/deviceuiset.cpp index 499fcc76d..6decb780f 100644 --- a/sdrgui/device/deviceuiset.cpp +++ b/sdrgui/device/deviceuiset.cpp @@ -17,6 +17,8 @@ #include +#include + #include "gui/glspectrum.h" #include "dsp/spectrumvis.h" #include "gui/glspectrumgui.h" @@ -230,7 +232,7 @@ void DeviceUISet::saveRxChannelSettings(Preset *preset) { if (preset->isSourcePreset()) { - qSort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type + std::sort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { @@ -308,7 +310,7 @@ void DeviceUISet::saveTxChannelSettings(Preset *preset) { if (preset->isSinkPreset()) { - qSort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type + std::sort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { @@ -386,7 +388,7 @@ void DeviceUISet::saveMIMOChannelSettings(Preset *preset) { if (preset->isMIMOPreset()) { - qSort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type + std::sort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { diff --git a/sdrgui/gui/levelmeter.h b/sdrgui/gui/levelmeter.h index 1df2b6d48..f51f4bc62 100644 --- a/sdrgui/gui/levelmeter.h +++ b/sdrgui/gui/levelmeter.h @@ -48,6 +48,7 @@ #define SDRBASE_GUI_LEVELMETER_H_ #include +#include #include #include "dsp/dsptypes.h" @@ -102,7 +103,7 @@ protected: /** * Time at which m_peakLevel was last changed. */ - QTime m_peakLevelChanged; + QElapsedTimer m_peakLevelChanged; /** * Rate at which peak level bar decays. @@ -119,7 +120,7 @@ protected: /** * Time at which m_peakHoldLevel was last changed. */ - QTime m_peakHoldLevelChanged; + QElapsedTimer m_peakHoldLevelChanged; /** * Average smoothing factor (between 1: fast and 256: slow) diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index a507851d5..e51a6755a 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -807,7 +807,7 @@ QTreeWidgetItem* MainWindow::addPresetToTree(const Preset* preset) sl.append(preset->getDescription()); // description column PresetItem* item = new PresetItem(group, sl, preset->getCenterFrequency(), PItem); item->setTextAlignment(0, Qt::AlignRight); - item->setData(0, Qt::UserRole, qVariantFromValue(preset)); + item->setData(0, Qt::UserRole, QVariant::fromValue(preset)); ui->presetTree->resizeColumnToContents(0); // Resize frequency column to minimum ui->presetTree->resizeColumnToContents(1); // Resize mode column to minimum @@ -843,7 +843,7 @@ QTreeWidgetItem* MainWindow::addCommandToTree(const Command* command) sl.append(QString("%1").arg(command->getAssociateKey() ? command->getRelease() ? "R" : "P" : "-")); // key press/release column sl.append(QString("%1").arg(command->getKeyLabel())); // key column CommandItem* item = new CommandItem(group, sl, command->getDescription(), PItem); - item->setData(0, Qt::UserRole, qVariantFromValue(command)); + item->setData(0, Qt::UserRole, QVariant::fromValue(command)); item->setTextAlignment(0, Qt::AlignLeft); ui->commandTree->resizeColumnToContents(0); // Resize description column to minimum ui->commandTree->resizeColumnToContents(1); // Resize key column to minimum diff --git a/sdrsrv/device/deviceset.cpp b/sdrsrv/device/deviceset.cpp index 1308b9f92..c28e6820c 100644 --- a/sdrsrv/device/deviceset.cpp +++ b/sdrsrv/device/deviceset.cpp @@ -15,6 +15,8 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// +#include + #include "dsp/dspdevicesourceengine.h" #include "dsp/dspdevicesinkengine.h" #include "plugin/pluginapi.h" @@ -233,7 +235,7 @@ void DeviceSet::saveRxChannelSettings(Preset *preset) { if (preset->isSourcePreset()) { - qSort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type + std::sort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type for (int i = 0; i < m_channelInstanceRegistrations.count(); i++) { @@ -326,7 +328,7 @@ void DeviceSet::saveTxChannelSettings(Preset *preset) { if (preset->isSinkPreset()) { - qSort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type + std::sort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type for (int i = 0; i < m_channelInstanceRegistrations.count(); i++) { @@ -422,7 +424,7 @@ void DeviceSet::saveMIMOChannelSettings(Preset *preset) { if (preset->isMIMOPreset()) { - qSort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type + std::sort(m_channelInstanceRegistrations.begin(), m_channelInstanceRegistrations.end()); // sort by increasing delta frequency and type for (int i = 0; i < m_channelInstanceRegistrations.count(); i++) {