1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-28 15:56:33 -04:00

WFM demod: remove UDP/RTP copy audio entirely

This commit is contained in:
f4exb 2018-03-28 09:18:28 +02:00
parent f71446b6ec
commit 814764eeee
9 changed files with 5 additions and 59 deletions

View File

@ -445,7 +445,7 @@
<item>
<widget class="QToolButton" name="audioMute">
<property name="toolTip">
<string>Mute/Unmute audio (all slots)</string>
<string>Left: Mute/Unmute audio (all slots) Right: select audio output</string>
</property>
<property name="text">
<string>...</string>

View File

@ -38,6 +38,8 @@ This is the volume of the audio signal from 0.0 (mute) to 10.0 (maximum). It can
This is the squelch threshold in dB. The average total power received in the signal bandwidth before demodulation is compared to this value and the squelch input is open above this value. It can be varied continuously in 0.1 dB steps from 0.0 to -100.0 dB using the dial button.
<h3>9: Audio mute</h3>
<h3>9: Audio mute and select audio output</h3>
Use this button to toggle audio mute for this channel. The button will light up in green if the squelch is open. This helps identifying which channels are active in a multi-channel configuration.
Left click on this button to toggle audio mute for this channel. The button will light up in green if the squelch is open. This helps identifying which channels are active in a multi-channel configuration.
If you right click on this button this will open a dialog to select the audio output device.

View File

@ -61,8 +61,6 @@ WFMDemod::WFMDemod(DeviceSourceAPI* deviceAPI) :
DSPEngine::instance()->getAudioDeviceManager()->addAudioSink(&m_audioFifo, getInputMessageQueue());
m_audioSampleRate = DSPEngine::instance()->getAudioDeviceManager()->getOutputSampleRate();
m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically - no RTP
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true);
applySettings(m_settings, true);
@ -81,7 +79,6 @@ WFMDemod::~WFMDemod()
}
DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(&m_audioFifo);
delete m_audioNetSink;
m_deviceAPI->removeChannelAPI(this);
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
@ -150,10 +147,6 @@ void WFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_audioBuffer[m_audioBufferFill].l = sample;
m_audioBuffer[m_audioBufferFill].r = sample;
if (m_settings.m_copyAudioToUDP) {
m_audioNetSink->write(sample);
}
++m_audioBufferFill;
if(m_audioBufferFill >= m_audioBuffer.size())
@ -241,7 +234,6 @@ bool WFMDemod::handleMessage(const Message& cmd)
BasebandSampleSink::MsgThreadedSink& cfg = (BasebandSampleSink::MsgThreadedSink&) cmd;
const QThread *thread = cfg.getThread();
qDebug("WFMDemod::handleMessage: BasebandSampleSink::MsgThreadedSink: %p", thread);
m_audioNetSink->moveToThread(const_cast<QThread*>(thread)); // use the thread for udp sinks
return true;
}
else if (DSPConfigureAudio::match(cmd))
@ -322,9 +314,6 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force)
<< " m_afBandwidth: " << settings.m_afBandwidth
<< " m_volume: " << settings.m_volume
<< " m_squelch: " << settings.m_squelch
<< " m_copyAudioToUDP: " << settings.m_copyAudioToUDP
<< " m_udpAddress: " << settings.m_udpAddress
<< " m_udpPort: " << settings.m_udpPort
<< " m_audioDeviceName: " << settings.m_audioDeviceName
<< " force: " << force;
@ -353,12 +342,6 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force)
m_squelchLevel *= m_squelchLevel;
}
if ((m_settings.m_udpAddress != settings.m_udpAddress)
|| (m_settings.m_udpPort != settings.m_udpPort) || force)
{
m_audioNetSink->setDestination(settings.m_udpAddress, settings.m_udpPort);
}
if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
{
AudioDeviceManager *audioDeviceManager = DSPEngine::instance()->getAudioDeviceManager();

View File

@ -156,7 +156,6 @@ private:
AudioVector m_audioBuffer;
uint m_audioBufferFill;
AudioNetSink *m_audioNetSink;
AudioFifo m_audioFifo;
SampleVector m_sampleBuffer;

View File

@ -133,12 +133,6 @@ void WFMDemodGUI::on_audioMute_toggled(bool checked)
applySettings();
}
void WFMDemodGUI::on_copyAudioToUDP_toggled(bool checked)
{
m_settings.m_copyAudioToUDP = checked;
applySettings();
}
void WFMDemodGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rollDown __attribute__((unused)))
{
}
@ -150,14 +144,11 @@ void WFMDemodGUI::onMenuDialogCalled(const QPoint &p)
dialog.exec();
m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency();
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
m_settings.m_title = m_channelMarker.getTitle();
setWindowTitle(m_settings.m_title);
setTitleColor(m_settings.m_rgbColor);
displayUDPAddress();
applySettings();
}
@ -257,7 +248,6 @@ void WFMDemodGUI::displaySettings()
setTitleColor(m_settings.m_rgbColor);
setWindowTitle(m_channelMarker.getTitle());
displayUDPAddress();
blockApplySettings(true);
@ -277,11 +267,6 @@ void WFMDemodGUI::displaySettings()
blockApplySettings(false);
}
void WFMDemodGUI::displayUDPAddress()
{
ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_settings.m_udpAddress).arg(m_settings.m_udpPort));
}
void WFMDemodGUI::leaveEvent(QEvent*)
{
m_channelMarker.setHighlighted(false);

View File

@ -59,7 +59,6 @@ private:
void blockApplySettings(bool block);
void applySettings(bool force = false);
void displaySettings();
void displayUDPAddress();
void leaveEvent(QEvent*);
void enterEvent(QEvent*);
@ -80,7 +79,6 @@ private slots:
void on_volume_valueChanged(int value);
void on_squelch_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_copyAudioToUDP_toggled(bool copy);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void audioSelect();

View File

@ -365,16 +365,6 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="copyAudioToUDP">
<property name="toolTip">
<string>Copy audio to UDP</string>
</property>
<property name="text">
<string>U</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="audioMute">
<property name="toolTip">
@ -417,11 +407,6 @@
<header>gui/valuedialz.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonSwitch</class>
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -42,9 +42,6 @@ void WFMDemodSettings::resetToDefaults()
m_volume = 2.0;
m_squelch = -60.0;
m_audioMute = false;
m_copyAudioToUDP = false;
m_udpAddress = "127.0.0.1";
m_udpPort = 9999;
m_rgbColor = QColor(0, 0, 255).rgb();
m_title = "WFM Demodulator";
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;

View File

@ -30,9 +30,6 @@ struct WFMDemodSettings
Real m_volume;
Real m_squelch;
bool m_audioMute;
bool m_copyAudioToUDP;
QString m_udpAddress;
quint16 m_udpPort;
quint32 m_rgbColor;
QString m_title;
QString m_audioDeviceName;