diff --git a/plugins/channel/udpsrc/udpsrc.cpp b/plugins/channel/udpsrc/udpsrc.cpp
index df9d95310..b2b10f78c 100644
--- a/plugins/channel/udpsrc/udpsrc.cpp
+++ b/plugins/channel/udpsrc/udpsrc.cpp
@@ -106,11 +106,13 @@ void UDPSrc::configure(MessageQueue* messageQueue,
void UDPSrc::configureImmediate(MessageQueue* messageQueue,
bool audioActive,
+ bool audioStereo,
int boost,
int volume)
{
Message* cmd = MsgUDPSrcConfigureImmediate::create(
audioActive,
+ audioStereo,
boost,
volume);
messageQueue->push(cmd);
@@ -266,6 +268,11 @@ bool UDPSrc::handleMessage(const Message& cmd)
}
}
+ if (cfg.getAudioStereo() != m_audioStereo)
+ {
+ m_audioStereo = cfg.getAudioStereo();
+ }
+
if (cfg.getBoost() != m_boost)
{
m_boost = cfg.getBoost();
@@ -280,6 +287,7 @@ bool UDPSrc::handleMessage(const Message& cmd)
qDebug() << "UDPSrc::handleMessage: MsgUDPSrcConfigureImmediate: "
<< " m_audioActive: " << m_audioActive
+ << " m_audioStereo: " << m_audioStereo
<< " m_boost: " << m_boost
<< " m_volume: " << m_volume;
diff --git a/plugins/channel/udpsrc/udpsrc.h b/plugins/channel/udpsrc/udpsrc.h
index a64f680fd..69958bcac 100644
--- a/plugins/channel/udpsrc/udpsrc.h
+++ b/plugins/channel/udpsrc/udpsrc.h
@@ -46,6 +46,7 @@ public:
int audioPort);
void configureImmediate(MessageQueue* messageQueue,
bool audioActive,
+ bool audioStereo,
int boost,
int volume);
void setSpectrum(MessageQueue* messageQueue, bool enabled);
@@ -118,14 +119,17 @@ protected:
int getBoost() const { return m_boost; }
int getVolume() const { return m_volume; }
bool getAudioActive() const { return m_audioActive; }
+ bool getAudioStereo() const { return m_audioStereo; }
static MsgUDPSrcConfigureImmediate* create(
bool audioActive,
+ bool audioStereo,
int boost,
int volume)
{
return new MsgUDPSrcConfigureImmediate(
audioActive,
+ audioStereo,
boost,
volume);
}
@@ -134,13 +138,16 @@ protected:
int m_boost;
int m_volume;
bool m_audioActive;
+ bool m_audioStereo;
MsgUDPSrcConfigureImmediate(
bool audioActive,
+ bool audioStereo,
int boost,
int volume) :
Message(),
m_audioActive(audioActive),
+ m_audioStereo(audioStereo),
m_boost(boost),
m_volume(volume)
{ }
diff --git a/plugins/channel/udpsrc/udpsrcgui.cpp b/plugins/channel/udpsrc/udpsrcgui.cpp
index 61d855cac..292d670f8 100644
--- a/plugins/channel/udpsrc/udpsrcgui.cpp
+++ b/plugins/channel/udpsrc/udpsrcgui.cpp
@@ -58,6 +58,7 @@ void UDPSrcGUI::resetToDefaults()
ui->boost->setValue(1);
ui->volume->setValue(20);
ui->audioActive->setChecked(false);
+ ui->audioStereo->setChecked(false);
blockApplySettings(false);
applySettingsImmediate();
@@ -80,6 +81,7 @@ QByteArray UDPSrcGUI::serialize() const
s.writeBool(11, m_audioActive);
s.writeS32(12, (qint32)m_volume);
s.writeS32(13, m_audioPort);
+ s.writeBool(14, m_audioStereo);
return s.final();
}
@@ -143,6 +145,8 @@ bool UDPSrcGUI::deserialize(const QByteArray& data)
ui->volume->setValue(s32tmp);
d.readS32(13, &s32tmp, 9998);
ui->audioPort->setText(QString("%1").arg(s32tmp));
+ d.readBool(14, &booltmp, false);
+ ui->audioStereo->setChecked(booltmp);
blockApplySettings(false);
m_channelMarker.blockSignals(false);
@@ -247,11 +251,13 @@ void UDPSrcGUI::applySettingsImmediate()
if (m_doApplySettings)
{
m_audioActive = ui->audioActive->isChecked();
+ m_audioStereo = ui->audioStereo->isChecked();
m_boost = ui->boost->value();
m_volume = ui->volume->value();
m_udpSrc->configureImmediate(m_udpSrc->getInputMessageQueue(),
m_audioActive,
+ m_audioStereo,
m_boost,
m_volume);
}
@@ -406,6 +412,11 @@ void UDPSrcGUI::on_audioActive_toggled(bool active)
applySettingsImmediate();
}
+void UDPSrcGUI::on_audioStereo_toggled(bool stereo)
+{
+ applySettingsImmediate();
+}
+
void UDPSrcGUI::on_boost_valueChanged(int value)
{
ui->boost->setValue(value);
diff --git a/plugins/channel/udpsrc/udpsrcgui.h b/plugins/channel/udpsrc/udpsrcgui.h
index 8971de9e2..8fe04c0f6 100644
--- a/plugins/channel/udpsrc/udpsrcgui.h
+++ b/plugins/channel/udpsrc/udpsrcgui.h
@@ -48,6 +48,7 @@ private slots:
void on_udpPort_textEdited(const QString& arg1);
void on_audioPort_textEdited(const QString& arg1);
void on_audioActive_toggled(bool active);
+ void on_audioStereo_toggled(bool stereo);
void on_applyBtn_clicked();
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDoubleClicked();
@@ -68,6 +69,7 @@ private:
Real m_rfBandwidth;
int m_boost;
bool m_audioActive;
+ bool m_audioStereo;
int m_volume;
QString m_udpAddress;
int m_udpPort;
diff --git a/plugins/channel/udpsrc/udpsrcgui.ui b/plugins/channel/udpsrc/udpsrcgui.ui
index 57e1d3f7b..abe8589b8 100644
--- a/plugins/channel/udpsrc/udpsrcgui.ui
+++ b/plugins/channel/udpsrc/udpsrcgui.ui
@@ -354,6 +354,24 @@
+ -
+
+
+ Toggle mono/stereo audio input
+
+
+ ...
+
+
+
+ :/mono.png
+ :/stereo.png:/mono.png
+
+
+ true
+
+
+
-
@@ -371,6 +389,9 @@
false
+
+ Apply text input and/or samples format
+
Apply