mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-25 04:03:30 -05:00
UDP source: implemented mono/stereo audio input toggle
This commit is contained in:
parent
f69264ec24
commit
f8c36546b0
@ -106,11 +106,13 @@ void UDPSrc::configure(MessageQueue* messageQueue,
|
|||||||
|
|
||||||
void UDPSrc::configureImmediate(MessageQueue* messageQueue,
|
void UDPSrc::configureImmediate(MessageQueue* messageQueue,
|
||||||
bool audioActive,
|
bool audioActive,
|
||||||
|
bool audioStereo,
|
||||||
int boost,
|
int boost,
|
||||||
int volume)
|
int volume)
|
||||||
{
|
{
|
||||||
Message* cmd = MsgUDPSrcConfigureImmediate::create(
|
Message* cmd = MsgUDPSrcConfigureImmediate::create(
|
||||||
audioActive,
|
audioActive,
|
||||||
|
audioStereo,
|
||||||
boost,
|
boost,
|
||||||
volume);
|
volume);
|
||||||
messageQueue->push(cmd);
|
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)
|
if (cfg.getBoost() != m_boost)
|
||||||
{
|
{
|
||||||
m_boost = cfg.getBoost();
|
m_boost = cfg.getBoost();
|
||||||
@ -280,6 +287,7 @@ bool UDPSrc::handleMessage(const Message& cmd)
|
|||||||
|
|
||||||
qDebug() << "UDPSrc::handleMessage: MsgUDPSrcConfigureImmediate: "
|
qDebug() << "UDPSrc::handleMessage: MsgUDPSrcConfigureImmediate: "
|
||||||
<< " m_audioActive: " << m_audioActive
|
<< " m_audioActive: " << m_audioActive
|
||||||
|
<< " m_audioStereo: " << m_audioStereo
|
||||||
<< " m_boost: " << m_boost
|
<< " m_boost: " << m_boost
|
||||||
<< " m_volume: " << m_volume;
|
<< " m_volume: " << m_volume;
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ public:
|
|||||||
int audioPort);
|
int audioPort);
|
||||||
void configureImmediate(MessageQueue* messageQueue,
|
void configureImmediate(MessageQueue* messageQueue,
|
||||||
bool audioActive,
|
bool audioActive,
|
||||||
|
bool audioStereo,
|
||||||
int boost,
|
int boost,
|
||||||
int volume);
|
int volume);
|
||||||
void setSpectrum(MessageQueue* messageQueue, bool enabled);
|
void setSpectrum(MessageQueue* messageQueue, bool enabled);
|
||||||
@ -118,14 +119,17 @@ protected:
|
|||||||
int getBoost() const { return m_boost; }
|
int getBoost() const { return m_boost; }
|
||||||
int getVolume() const { return m_volume; }
|
int getVolume() const { return m_volume; }
|
||||||
bool getAudioActive() const { return m_audioActive; }
|
bool getAudioActive() const { return m_audioActive; }
|
||||||
|
bool getAudioStereo() const { return m_audioStereo; }
|
||||||
|
|
||||||
static MsgUDPSrcConfigureImmediate* create(
|
static MsgUDPSrcConfigureImmediate* create(
|
||||||
bool audioActive,
|
bool audioActive,
|
||||||
|
bool audioStereo,
|
||||||
int boost,
|
int boost,
|
||||||
int volume)
|
int volume)
|
||||||
{
|
{
|
||||||
return new MsgUDPSrcConfigureImmediate(
|
return new MsgUDPSrcConfigureImmediate(
|
||||||
audioActive,
|
audioActive,
|
||||||
|
audioStereo,
|
||||||
boost,
|
boost,
|
||||||
volume);
|
volume);
|
||||||
}
|
}
|
||||||
@ -134,13 +138,16 @@ protected:
|
|||||||
int m_boost;
|
int m_boost;
|
||||||
int m_volume;
|
int m_volume;
|
||||||
bool m_audioActive;
|
bool m_audioActive;
|
||||||
|
bool m_audioStereo;
|
||||||
|
|
||||||
MsgUDPSrcConfigureImmediate(
|
MsgUDPSrcConfigureImmediate(
|
||||||
bool audioActive,
|
bool audioActive,
|
||||||
|
bool audioStereo,
|
||||||
int boost,
|
int boost,
|
||||||
int volume) :
|
int volume) :
|
||||||
Message(),
|
Message(),
|
||||||
m_audioActive(audioActive),
|
m_audioActive(audioActive),
|
||||||
|
m_audioStereo(audioStereo),
|
||||||
m_boost(boost),
|
m_boost(boost),
|
||||||
m_volume(volume)
|
m_volume(volume)
|
||||||
{ }
|
{ }
|
||||||
|
@ -58,6 +58,7 @@ void UDPSrcGUI::resetToDefaults()
|
|||||||
ui->boost->setValue(1);
|
ui->boost->setValue(1);
|
||||||
ui->volume->setValue(20);
|
ui->volume->setValue(20);
|
||||||
ui->audioActive->setChecked(false);
|
ui->audioActive->setChecked(false);
|
||||||
|
ui->audioStereo->setChecked(false);
|
||||||
|
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
applySettingsImmediate();
|
applySettingsImmediate();
|
||||||
@ -80,6 +81,7 @@ QByteArray UDPSrcGUI::serialize() const
|
|||||||
s.writeBool(11, m_audioActive);
|
s.writeBool(11, m_audioActive);
|
||||||
s.writeS32(12, (qint32)m_volume);
|
s.writeS32(12, (qint32)m_volume);
|
||||||
s.writeS32(13, m_audioPort);
|
s.writeS32(13, m_audioPort);
|
||||||
|
s.writeBool(14, m_audioStereo);
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,6 +145,8 @@ bool UDPSrcGUI::deserialize(const QByteArray& data)
|
|||||||
ui->volume->setValue(s32tmp);
|
ui->volume->setValue(s32tmp);
|
||||||
d.readS32(13, &s32tmp, 9998);
|
d.readS32(13, &s32tmp, 9998);
|
||||||
ui->audioPort->setText(QString("%1").arg(s32tmp));
|
ui->audioPort->setText(QString("%1").arg(s32tmp));
|
||||||
|
d.readBool(14, &booltmp, false);
|
||||||
|
ui->audioStereo->setChecked(booltmp);
|
||||||
|
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
m_channelMarker.blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
@ -247,11 +251,13 @@ void UDPSrcGUI::applySettingsImmediate()
|
|||||||
if (m_doApplySettings)
|
if (m_doApplySettings)
|
||||||
{
|
{
|
||||||
m_audioActive = ui->audioActive->isChecked();
|
m_audioActive = ui->audioActive->isChecked();
|
||||||
|
m_audioStereo = ui->audioStereo->isChecked();
|
||||||
m_boost = ui->boost->value();
|
m_boost = ui->boost->value();
|
||||||
m_volume = ui->volume->value();
|
m_volume = ui->volume->value();
|
||||||
|
|
||||||
m_udpSrc->configureImmediate(m_udpSrc->getInputMessageQueue(),
|
m_udpSrc->configureImmediate(m_udpSrc->getInputMessageQueue(),
|
||||||
m_audioActive,
|
m_audioActive,
|
||||||
|
m_audioStereo,
|
||||||
m_boost,
|
m_boost,
|
||||||
m_volume);
|
m_volume);
|
||||||
}
|
}
|
||||||
@ -406,6 +412,11 @@ void UDPSrcGUI::on_audioActive_toggled(bool active)
|
|||||||
applySettingsImmediate();
|
applySettingsImmediate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UDPSrcGUI::on_audioStereo_toggled(bool stereo)
|
||||||
|
{
|
||||||
|
applySettingsImmediate();
|
||||||
|
}
|
||||||
|
|
||||||
void UDPSrcGUI::on_boost_valueChanged(int value)
|
void UDPSrcGUI::on_boost_valueChanged(int value)
|
||||||
{
|
{
|
||||||
ui->boost->setValue(value);
|
ui->boost->setValue(value);
|
||||||
|
@ -48,6 +48,7 @@ private slots:
|
|||||||
void on_udpPort_textEdited(const QString& arg1);
|
void on_udpPort_textEdited(const QString& arg1);
|
||||||
void on_audioPort_textEdited(const QString& arg1);
|
void on_audioPort_textEdited(const QString& arg1);
|
||||||
void on_audioActive_toggled(bool active);
|
void on_audioActive_toggled(bool active);
|
||||||
|
void on_audioStereo_toggled(bool stereo);
|
||||||
void on_applyBtn_clicked();
|
void on_applyBtn_clicked();
|
||||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||||
void onMenuDoubleClicked();
|
void onMenuDoubleClicked();
|
||||||
@ -68,6 +69,7 @@ private:
|
|||||||
Real m_rfBandwidth;
|
Real m_rfBandwidth;
|
||||||
int m_boost;
|
int m_boost;
|
||||||
bool m_audioActive;
|
bool m_audioActive;
|
||||||
|
bool m_audioStereo;
|
||||||
int m_volume;
|
int m_volume;
|
||||||
QString m_udpAddress;
|
QString m_udpAddress;
|
||||||
int m_udpPort;
|
int m_udpPort;
|
||||||
|
@ -354,6 +354,24 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="audioStereo">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Toggle mono/stereo audio input</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../sdrbase/resources/res.qrc">
|
||||||
|
<normaloff>:/mono.png</normaloff>
|
||||||
|
<normalon>:/stereo.png</normalon>:/mono.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
@ -371,6 +389,9 @@
|
|||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Apply text input and/or samples format</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Apply</string>
|
<string>Apply</string>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
Reference in New Issue
Block a user