1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

UDP sink: use sample format from settings. Bumped version to v3.7.5

This commit is contained in:
f4exb 2017-10-15 20:31:33 +02:00
parent a61348948a
commit e298042545
8 changed files with 41 additions and 38 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
sdrangel (3.7.5-1) unstable; urgency=medium
* GUI and demod separation step 1 full
-- Edouard Griffiths, F4EXB <f4exb06@gmail.com> Sun, 08 Oct 2017 23:14:18 +0200
sdrangel (3.7.4-1) unstable; urgency=medium
* GUI and demod separation step 1 full

View File

@ -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,

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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,

View File

@ -84,7 +84,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Version 3.7.4 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. &lt;/p&gt;&lt;p&gt;Code at &lt;a href=&quot;https://github.com/f4exb/sdrangel&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/f4exb/sdrangel&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many thanks to the original developers:&lt;/p&gt;&lt;p&gt;The osmocom developer team - especially horizon, Hoernchen &amp;amp; tnt.&lt;/p&gt;&lt;p&gt;Christian Daniel from maintech GmbH.&lt;/p&gt;&lt;p&gt;John Greb (hexameron) for the contributions in &lt;a href=&quot;https://github.com/hexameron/rtl-sdrangelove&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RTL-SDRangelove&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The following rules apply to the SDRangel main application and libsdrbase:&lt;br/&gt;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 &lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the license of installed plugins, look into the plugin list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Version 3.7.5 - Copyright (C) 2015-2017 Edouard Griffiths, F4EXB. &lt;/p&gt;&lt;p&gt;Code at &lt;a href=&quot;https://github.com/f4exb/sdrangel&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;https://github.com/f4exb/sdrangel&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Many thanks to the original developers:&lt;/p&gt;&lt;p&gt;The osmocom developer team - especially horizon, Hoernchen &amp;amp; tnt.&lt;/p&gt;&lt;p&gt;Christian Daniel from maintech GmbH.&lt;/p&gt;&lt;p&gt;John Greb (hexameron) for the contributions in &lt;a href=&quot;https://github.com/hexameron/rtl-sdrangelove&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;RTL-SDRangelove&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The following rules apply to the SDRangel main application and libsdrbase:&lt;br/&gt;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 &lt;a href=&quot;http://www.gnu.org/licenses/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.gnu.org/licenses/&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;For the license of installed plugins, look into the plugin list.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@ -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);