mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-17 13:51:47 -05:00
Revert "NFM demod: GUI button and setting to use RTP over UDP for copy to audio"
This reverts commit 2beba446f3
.
This commit is contained in:
parent
44552e26ef
commit
69a382a12c
@ -81,6 +81,12 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) :
|
||||
m_audioNetSink = new AudioNetSink(this);
|
||||
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
|
||||
|
||||
if (m_audioNetSink->selectType(AudioNetSink::SinkRTP)) {
|
||||
qDebug("NFMDemod::NFMDemod: set audio sink to RTP mode");
|
||||
} else {
|
||||
qWarning("NFMDemod::NFMDemod: RTP support for audio sink not available. Fall back too UDP");
|
||||
}
|
||||
|
||||
m_channelizer = new DownChannelizer(this);
|
||||
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||
@ -100,11 +106,6 @@ NFMDemod::~NFMDemod()
|
||||
delete m_channelizer;
|
||||
}
|
||||
|
||||
bool NFMDemod::isAudioNetSinkRTPCapable() const
|
||||
{
|
||||
return m_audioNetSink && m_audioNetSink->isRTPCapable();
|
||||
}
|
||||
|
||||
float arctan2(Real y, Real x)
|
||||
{
|
||||
Real coeff_1 = M_PI / 4;
|
||||
@ -479,26 +480,6 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
|
||||
setSelectedCtcssIndex(settings.m_ctcssIndex);
|
||||
}
|
||||
|
||||
if ((settings.m_copyAudioUseRTP != m_settings.m_copyAudioUseRTP) || force)
|
||||
{
|
||||
if (settings.m_copyAudioUseRTP)
|
||||
{
|
||||
if (m_audioNetSink->selectType(AudioNetSink::SinkRTP)) {
|
||||
qDebug("NFMDemod::applySettings: set audio sink to RTP mode");
|
||||
} else {
|
||||
qWarning("NFMDemod::applySettings: RTP support for audio sink not available. Fall back too UDP");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_audioNetSink->selectType(AudioNetSink::SinkUDP)) {
|
||||
qDebug("NFMDemod::applySettings: set audio sink to UDP mode");
|
||||
} else {
|
||||
qWarning("NFMDemod::applySettings: failed to set audio sink to UDP mode");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
}
|
||||
|
||||
@ -557,9 +538,6 @@ int NFMDemod::webapiSettingsPutPatch(
|
||||
if (channelSettingsKeys.contains("copyAudioToUDP")) {
|
||||
settings.m_copyAudioToUDP = response.getNfmDemodSettings()->getCopyAudioToUdp() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("copyAudioUseRTP")) {
|
||||
settings.m_copyAudioUseRTP = response.getNfmDemodSettings()->getCopyAudioUseRtp() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("ctcssIndex")) {
|
||||
settings.m_ctcssIndex = response.getNfmDemodSettings()->getCtcssIndex();
|
||||
}
|
||||
@ -629,7 +607,6 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
|
||||
response.getNfmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
|
||||
response.getNfmDemodSettings()->setAudioSampleRate(settings.m_audioSampleRate);
|
||||
response.getNfmDemodSettings()->setCopyAudioToUdp(settings.m_copyAudioToUDP ? 1 : 0);
|
||||
response.getNfmDemodSettings()->setCopyAudioUseRtp(settings.m_copyAudioUseRTP ? 1 : 0);
|
||||
response.getNfmDemodSettings()->setCtcssIndex(settings.m_ctcssIndex);
|
||||
response.getNfmDemodSettings()->setCtcssOn(settings.m_ctcssOn ? 1 : 0);
|
||||
response.getNfmDemodSettings()->setDeltaSquelch(settings.m_deltaSquelch ? 1 : 0);
|
||||
|
@ -159,8 +159,6 @@ public:
|
||||
m_magsqCount = 0;
|
||||
}
|
||||
|
||||
bool isAudioNetSinkRTPCapable() const;
|
||||
|
||||
static const QString m_channelIdURI;
|
||||
static const QString m_channelId;
|
||||
|
||||
|
@ -211,12 +211,6 @@ void NFMDemodGUI::on_copyAudioToUDP_toggled(bool checked)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void NFMDemodGUI::on_useRTP_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_copyAudioUseRTP = checked;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void NFMDemodGUI::on_ctcss_currentIndexChanged(int index)
|
||||
{
|
||||
m_settings.m_ctcssIndex = index;
|
||||
@ -320,7 +314,6 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
|
||||
|
||||
QChar delta = QChar(0x94, 0x03);
|
||||
ui->deltaSquelch->setText(delta);
|
||||
ui->useRTP->setEnabled(m_nfmDemod->isAudioNetSinkRTPCapable());
|
||||
|
||||
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
|
||||
|
||||
@ -400,10 +393,6 @@ void NFMDemodGUI::displaySettings()
|
||||
|
||||
ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex);
|
||||
|
||||
if (m_nfmDemod->isAudioNetSinkRTPCapable()) {
|
||||
ui->useRTP->setChecked(m_settings.m_copyAudioUseRTP);
|
||||
}
|
||||
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ private slots:
|
||||
void on_ctcssOn_toggled(bool checked);
|
||||
void on_audioMute_toggled(bool checked);
|
||||
void on_copyAudioToUDP_toggled(bool checked);
|
||||
void on_useRTP_toggled(bool checked);
|
||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||
void onMenuDialogCalled(const QPoint& p);
|
||||
void handleInputMessages();
|
||||
|
@ -611,19 +611,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="ButtonSwitch" name="useRTP">
|
||||
<property name="toolTip">
|
||||
<string>Use RTP protocol for sending audio via UDP</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -51,7 +51,6 @@ void NFMDemodSettings::resetToDefaults()
|
||||
m_ctcssIndex = 0;
|
||||
m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate();
|
||||
m_copyAudioToUDP = false;
|
||||
m_copyAudioUseRTP = false;
|
||||
m_udpAddress = "127.0.0.1";
|
||||
m_udpPort = 9998;
|
||||
m_rgbColor = QColor(255, 0, 0).rgb();
|
||||
@ -78,7 +77,6 @@ QByteArray NFMDemodSettings::serialize() const
|
||||
}
|
||||
|
||||
s.writeString(14, m_title);
|
||||
s.writeBool(15, m_copyAudioUseRTP);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -122,7 +120,6 @@ bool NFMDemodSettings::deserialize(const QByteArray& data)
|
||||
d.readS32(11, &m_squelchGate, 5);
|
||||
d.readBool(12, &m_deltaSquelch, false);
|
||||
d.readString(14, &m_title, "NFM Demodulator");
|
||||
d.readBool(15, &m_copyAudioUseRTP, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ struct NFMDemodSettings
|
||||
int m_ctcssIndex;
|
||||
uint32_t m_audioSampleRate;
|
||||
bool m_copyAudioToUDP;
|
||||
bool m_copyAudioUseRTP;
|
||||
QString m_udpAddress;
|
||||
uint16_t m_udpPort;
|
||||
quint32 m_rgbColor;
|
||||
|
@ -56,15 +56,6 @@ AudioNetSink::~AudioNetSink()
|
||||
#endif
|
||||
}
|
||||
|
||||
bool AudioNetSink::isRTPCapable() const
|
||||
{
|
||||
#ifdef HAS_JRTPLIB
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool AudioNetSink::selectType(SinkType type)
|
||||
{
|
||||
if (type == SinkUDP)
|
||||
|
@ -43,7 +43,6 @@ public:
|
||||
void write(qint16 sample);
|
||||
void write(const AudioSample& sample);
|
||||
|
||||
bool isRTPCapable() const;
|
||||
bool selectType(SinkType type);
|
||||
|
||||
static const int m_udpBlockSize;
|
||||
|
@ -1371,9 +1371,6 @@ margin-bottom: 20px;
|
||||
"copyAudioToUDP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"copyAudioUseRTP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"udpAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
@ -16924,7 +16921,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-02-05T00:57:57.193+01:00
|
||||
Generated 2018-01-25T00:10:31.068+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -32,8 +32,6 @@ NFMDemodSettings:
|
||||
type: integer
|
||||
copyAudioToUDP:
|
||||
type: integer
|
||||
copyAudioUseRTP:
|
||||
type: integer
|
||||
udpAddress:
|
||||
type: string
|
||||
udpPort:
|
||||
|
@ -32,8 +32,6 @@ NFMDemodSettings:
|
||||
type: integer
|
||||
copyAudioToUDP:
|
||||
type: integer
|
||||
copyAudioUseRTP:
|
||||
type: integer
|
||||
udpAddress:
|
||||
type: string
|
||||
udpPort:
|
||||
|
@ -1371,9 +1371,6 @@ margin-bottom: 20px;
|
||||
"copyAudioToUDP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"copyAudioUseRTP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"udpAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
@ -16924,7 +16921,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-02-05T00:57:57.193+01:00
|
||||
Generated 2018-01-25T00:10:31.068+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -50,7 +50,6 @@ SWGNFMDemodSettings::init() {
|
||||
ctcss_index = 0;
|
||||
audio_sample_rate = 0;
|
||||
copy_audio_to_udp = 0;
|
||||
copy_audio_use_rtp = 0;
|
||||
udp_address = new QString("");
|
||||
udp_port = 0;
|
||||
rgb_color = 0;
|
||||
@ -73,7 +72,6 @@ SWGNFMDemodSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
if(udp_address != nullptr) {
|
||||
delete udp_address;
|
||||
}
|
||||
@ -109,7 +107,6 @@ SWGNFMDemodSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&ctcss_index, pJson["ctcssIndex"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
|
||||
::SWGSDRangel::setValue(©_audio_to_udp, pJson["copyAudioToUDP"], "qint32", "");
|
||||
::SWGSDRangel::setValue(©_audio_use_rtp, pJson["copyAudioUseRTP"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString");
|
||||
::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", "");
|
||||
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
||||
@ -156,8 +153,6 @@ SWGNFMDemodSettings::asJsonObject() {
|
||||
|
||||
obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp));
|
||||
|
||||
obj->insert("copyAudioUseRTP", QJsonValue(copy_audio_use_rtp));
|
||||
|
||||
toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString"));
|
||||
|
||||
obj->insert("udpPort", QJsonValue(udp_port));
|
||||
@ -286,15 +281,6 @@ SWGNFMDemodSettings::setCopyAudioToUdp(qint32 copy_audio_to_udp) {
|
||||
this->copy_audio_to_udp = copy_audio_to_udp;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGNFMDemodSettings::getCopyAudioUseRtp() {
|
||||
return copy_audio_use_rtp;
|
||||
}
|
||||
void
|
||||
SWGNFMDemodSettings::setCopyAudioUseRtp(qint32 copy_audio_use_rtp) {
|
||||
this->copy_audio_use_rtp = copy_audio_use_rtp;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGNFMDemodSettings::getUdpAddress() {
|
||||
return udp_address;
|
||||
|
@ -81,9 +81,6 @@ public:
|
||||
qint32 getCopyAudioToUdp();
|
||||
void setCopyAudioToUdp(qint32 copy_audio_to_udp);
|
||||
|
||||
qint32 getCopyAudioUseRtp();
|
||||
void setCopyAudioUseRtp(qint32 copy_audio_use_rtp);
|
||||
|
||||
QString* getUdpAddress();
|
||||
void setUdpAddress(QString* udp_address);
|
||||
|
||||
@ -111,7 +108,6 @@ private:
|
||||
qint32 ctcss_index;
|
||||
qint32 audio_sample_rate;
|
||||
qint32 copy_audio_to_udp;
|
||||
qint32 copy_audio_use_rtp;
|
||||
QString* udp_address;
|
||||
qint32 udp_port;
|
||||
qint32 rgb_color;
|
||||
|
Loading…
Reference in New Issue
Block a user