From e298042545c6d5729b72e151078b784f62013dd7 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 15 Oct 2017 20:31:33 +0200 Subject: [PATCH] UDP sink: use sample format from settings. Bumped version to v3.7.5 --- debian/changelog | 6 +++++ plugins/channeltx/udpsink/udpsink.cpp | 12 +++++----- plugins/channeltx/udpsink/udpsink.h | 25 +++++++++------------ plugins/channeltx/udpsink/udpsinkgui.cpp | 24 ++++++++++---------- plugins/channeltx/udpsink/udpsinkgui.h | 4 +++- plugins/channeltx/udpsink/udpsinkplugin.cpp | 2 +- sdrbase/gui/aboutdialog.ui | 2 +- sdrbase/mainwindow.cpp | 4 ++-- 8 files changed, 41 insertions(+), 38 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1a6a6ecb2..9443963e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (3.7.5-1) unstable; urgency=medium + + * GUI and demod separation step 1 full + + -- Edouard Griffiths, F4EXB Sun, 08 Oct 2017 23:14:18 +0200 + sdrangel (3.7.4-1) unstable; urgency=medium * GUI and demod separation step 1 full diff --git a/plugins/channeltx/udpsink/udpsink.cpp b/plugins/channeltx/udpsink/udpsink.cpp index b9d03bac7..bef3ef2c8 100644 --- a/plugins/channeltx/udpsink/udpsink.cpp +++ b/plugins/channeltx/udpsink/udpsink.cpp @@ -120,7 +120,7 @@ void UDPSink::pull(Sample& sample) void UDPSink::modulateSample() { - if (m_running.m_sampleFormat == FormatS16LE) // Linear I/Q transponding + if (m_running.m_sampleFormat == UDPSinkSettings::FormatS16LE) // Linear I/Q transponding { Sample s; @@ -144,7 +144,7 @@ void UDPSink::modulateSample() m_modSample.imag(0.0f); } } - else if (m_running.m_sampleFormat == FormatNFM) + else if (m_running.m_sampleFormat == UDPSinkSettings::FormatNFM) { FixReal t; readMonoSample(t); @@ -167,7 +167,7 @@ void UDPSink::modulateSample() m_modSample.imag(0.0f); } } - else if (m_running.m_sampleFormat == FormatAM) + else if (m_running.m_sampleFormat == UDPSinkSettings::FormatAM) { FixReal t; readMonoSample(t); @@ -188,7 +188,7 @@ void UDPSink::modulateSample() m_modSample.imag(0.0f); } } - else if ((m_running.m_sampleFormat == FormatLSB) || (m_running.m_sampleFormat == FormatUSB)) + else if ((m_running.m_sampleFormat == UDPSinkSettings::FormatLSB) || (m_running.m_sampleFormat == UDPSinkSettings::FormatUSB)) { FixReal t; Complex c, ci; @@ -206,7 +206,7 @@ void UDPSink::modulateSample() ci.real((t / 32768.0f) * m_running.m_gainOut); ci.imag(0.0f); - n_out = m_SSBFilter->runSSB(ci, &filtered, (m_running.m_sampleFormat == FormatUSB)); + n_out = m_SSBFilter->runSSB(ci, &filtered, (m_running.m_sampleFormat == UDPSinkSettings::FormatUSB)); if (n_out > 0) { @@ -432,7 +432,7 @@ bool UDPSink::handleMessage(const Message& cmd) } void UDPSink::configure(MessageQueue* messageQueue, - SampleFormat sampleFormat, + UDPSinkSettings::SampleFormat sampleFormat, Real outputSampleRate, Real rfBandwidth, int fmDeviation, diff --git a/plugins/channeltx/udpsink/udpsink.h b/plugins/channeltx/udpsink/udpsink.h index bc894a661..607b3525c 100644 --- a/plugins/channeltx/udpsink/udpsink.h +++ b/plugins/channeltx/udpsink/udpsink.h @@ -28,6 +28,7 @@ #include "util/message.h" #include "udpsinkudphandler.h" +#include "udpsinksettings.h" class UDPSinkGUI; @@ -35,15 +36,6 @@ class UDPSink : public BasebandSampleSource { Q_OBJECT public: - enum SampleFormat { - FormatS16LE, - FormatNFM, - FormatLSB, - FormatUSB, - FormatAM, - FormatNone - }; - UDPSink(MessageQueue* uiMessageQueue, UDPSinkGUI* udpSinkGUI, BasebandSampleSink* spectrum); virtual ~UDPSink(); @@ -58,7 +50,7 @@ public: bool getSquelchOpen() const { return m_squelchOpen; } void configure(MessageQueue* messageQueue, - SampleFormat sampleFormat, + UDPSinkSettings::SampleFormat sampleFormat, Real inputSampleRate, Real rfBandwidth, int fmDeviation, @@ -91,7 +83,7 @@ private: MESSAGE_CLASS_DECLARATION public: - SampleFormat getSampleFormat() const { return m_sampleFormat; } + UDPSinkSettings::SampleFormat getSampleFormat() const { return m_sampleFormat; } Real getInputSampleRate() const { return m_inputSampleRate; } Real getRFBandwidth() const { return m_rfBandwidth; } int getFMDeviation() const { return m_fmDeviation; } @@ -108,7 +100,8 @@ private: bool getAutoRWBalance() const { return m_autoRWBalance; } bool getStereoInput() const { return m_stereoInput; } - static MsgUDPSinkConfigure* create(SampleFormat + static MsgUDPSinkConfigure* create( + UDPSinkSettings::SampleFormat sampleFormat, Real inputSampleRate, Real rfBandwidth, @@ -126,7 +119,8 @@ private: bool stereoInput, bool force) { - return new MsgUDPSinkConfigure(sampleFormat, + return new MsgUDPSinkConfigure( + sampleFormat, inputSampleRate, rfBandwidth, fmDeviation, @@ -145,7 +139,7 @@ private: } private: - SampleFormat m_sampleFormat; + UDPSinkSettings::SampleFormat m_sampleFormat; Real m_inputSampleRate; Real m_rfBandwidth; int m_fmDeviation; @@ -162,7 +156,8 @@ private: bool m_stereoInput; bool m_force; - MsgUDPSinkConfigure(SampleFormat sampleFormat, + MsgUDPSinkConfigure( + UDPSinkSettings::SampleFormat sampleFormat, Real inputSampleRate, Real rfBandwidth, int fmDeviation, diff --git a/plugins/channeltx/udpsink/udpsinkgui.cpp b/plugins/channeltx/udpsink/udpsinkgui.cpp index 982e00333..2563335de 100644 --- a/plugins/channeltx/udpsink/udpsinkgui.cpp +++ b/plugins/channeltx/udpsink/udpsinkgui.cpp @@ -121,11 +121,11 @@ bool UDPSinkGUI::deserialize(const QByteArray& data) d.readS32(2, &s32tmp, 0); m_channelMarker.setCenterFrequency(s32tmp); - d.readS32(3, &s32tmp, UDPSink::FormatS16LE); - if (s32tmp < (int) UDPSink::FormatNone) { + d.readS32(3, &s32tmp, UDPSinkSettings::FormatS16LE); + if (s32tmp < (int) UDPSinkSettings::FormatNone) { ui->sampleFormat->setCurrentIndex(s32tmp); } else { - ui->sampleFormat->setCurrentIndex(((int) UDPSink::FormatNone) - 1); + ui->sampleFormat->setCurrentIndex(((int) UDPSinkSettings::FormatNone) - 1); } d.readReal(4, &realtmp, 48000); ui->sampleRate->setText(QString("%1").arg(realtmp, 0)); @@ -308,38 +308,38 @@ void UDPSinkGUI::applySettings(bool force) inputSampleRate, m_channelMarker.getCenterFrequency()); - UDPSink::SampleFormat sampleFormat; + UDPSinkSettings::SampleFormat sampleFormat; switch(ui->sampleFormat->currentIndex()) { case 0: - sampleFormat = UDPSink::FormatS16LE; + sampleFormat = UDPSinkSettings::FormatS16LE; ui->fmDeviation->setEnabled(false); ui->stereoInput->setChecked(true); ui->stereoInput->setEnabled(false); break; case 1: - sampleFormat = UDPSink::FormatNFM; + sampleFormat = UDPSinkSettings::FormatNFM; ui->fmDeviation->setEnabled(true); ui->stereoInput->setEnabled(true); break; case 2: - sampleFormat = UDPSink::FormatLSB; + sampleFormat = UDPSinkSettings::FormatLSB; ui->fmDeviation->setEnabled(false); ui->stereoInput->setEnabled(true); break; case 3: - sampleFormat = UDPSink::FormatUSB; + sampleFormat = UDPSinkSettings::FormatUSB; ui->fmDeviation->setEnabled(false); ui->stereoInput->setEnabled(true); break; case 4: - sampleFormat = UDPSink::FormatAM; + sampleFormat = UDPSinkSettings::FormatAM; ui->fmDeviation->setEnabled(false); ui->stereoInput->setEnabled(true); break; default: - sampleFormat = UDPSink::FormatS16LE; + sampleFormat = UDPSinkSettings::FormatS16LE; ui->fmDeviation->setEnabled(false); ui->stereoInput->setChecked(true); ui->stereoInput->setEnabled(false); @@ -397,13 +397,13 @@ void UDPSinkGUI::on_deltaFrequency_changed(qint64 value) void UDPSinkGUI::on_sampleFormat_currentIndexChanged(int index) { - if ((index == (int) UDPSink::FormatNFM)) { + if ((index == (int) UDPSinkSettings::FormatNFM)) { ui->fmDeviation->setEnabled(true); } else { ui->fmDeviation->setEnabled(false); } - if (index == (int) UDPSink::FormatAM) { + if (index == (int) UDPSinkSettings::FormatAM) { ui->amModPercent->setEnabled(true); } else { ui->amModPercent->setEnabled(false); diff --git a/plugins/channeltx/udpsink/udpsinkgui.h b/plugins/channeltx/udpsink/udpsinkgui.h index a6abfb8b5..983ce37aa 100644 --- a/plugins/channeltx/udpsink/udpsinkgui.h +++ b/plugins/channeltx/udpsink/udpsinkgui.h @@ -25,6 +25,7 @@ #include "util/messagequeue.h" #include "udpsink.h" +#include "udpsinksettings.h" class PluginAPI; class DeviceSinkAPI; @@ -94,7 +95,8 @@ private: ChannelMarker m_channelMarker; // settings - UDPSink::SampleFormat m_sampleFormat; + UDPSinkSettings m_settings; + UDPSinkSettings::SampleFormat m_sampleFormat; Real m_inputSampleRate; Real m_rfBandwidth; int m_fmDeviation; diff --git a/plugins/channeltx/udpsink/udpsinkplugin.cpp b/plugins/channeltx/udpsink/udpsinkplugin.cpp index 46d829c84..a40c7f2e6 100644 --- a/plugins/channeltx/udpsink/udpsinkplugin.cpp +++ b/plugins/channeltx/udpsink/udpsinkplugin.cpp @@ -24,7 +24,7 @@ const PluginDescriptor UDPSinkPlugin::m_pluginDescriptor = { QString("UDP Channel Sink"), - QString("3.6.1"), + QString("3.7.5"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/sdrbase/gui/aboutdialog.ui b/sdrbase/gui/aboutdialog.ui index 62c113b22..d166da3ae 100644 --- a/sdrbase/gui/aboutdialog.ui +++ b/sdrbase/gui/aboutdialog.ui @@ -84,7 +84,7 @@ - <html><head/><body><p>Version 3.7.4 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">RTL-SDRangelove</span></a></p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>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; either version 2 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. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> + <html><head/><body><p>Version 3.7.5 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. </p><p>Code at <a href="https://github.com/f4exb/sdrangel"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/f4exb/sdrangel</span></a></p><p>Many thanks to the original developers:</p><p>The osmocom developer team - especially horizon, Hoernchen &amp; tnt.</p><p>Christian Daniel from maintech GmbH.</p><p>John Greb (hexameron) for the contributions in <a href="https://github.com/hexameron/rtl-sdrangelove"><span style=" text-decoration: underline; color:#0000ff;">RTL-SDRangelove</span></a></p><p>The following rules apply to the SDRangel main application and libsdrbase:<br/>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; either version 2 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. You should have received a copy of the GNU General Public License along with this program. If not, see <a href="http://www.gnu.org/licenses/"><span style=" text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses/</span></a>.</p><p>For the license of installed plugins, look into the plugin list.</p></body></html> true diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index bc02e5c72..65a84a56e 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -501,9 +501,9 @@ void MainWindow::createStatusBar() { QString qtVersionStr = QString("Qt %1 ").arg(QT_VERSION_STR); #if QT_VERSION >= 0x050400 - m_showSystemWidget = new QLabel("SDRangel v3.7.4 " + qtVersionStr + QSysInfo::prettyProductName(), this); + m_showSystemWidget = new QLabel("SDRangel v3.7.5 " + qtVersionStr + QSysInfo::prettyProductName(), this); #else - m_showSystemWidget = new QLabel("SDRangel v3.7.4 " + qtVersionStr, this); + m_showSystemWidget = new QLabel("SDRangel v3.7.5 " + qtVersionStr, this); #endif statusBar()->addPermanentWidget(m_showSystemWidget);