mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-05 22:57:47 -04:00
UDP source: interactive audio port setting from the GUI
This commit is contained in:
parent
70d4088fa6
commit
74f1f4e675
@ -53,6 +53,7 @@ void UDPSrcGUI::resetToDefaults()
|
|||||||
ui->rfBandwidth->setText("32000");
|
ui->rfBandwidth->setText("32000");
|
||||||
ui->udpAddress->setText("127.0.0.1");
|
ui->udpAddress->setText("127.0.0.1");
|
||||||
ui->udpPort->setText("9999");
|
ui->udpPort->setText("9999");
|
||||||
|
ui->audioPort->setText("9999");
|
||||||
ui->spectrumGUI->resetToDefaults();
|
ui->spectrumGUI->resetToDefaults();
|
||||||
ui->boost->setValue(1);
|
ui->boost->setValue(1);
|
||||||
ui->volume->setValue(20);
|
ui->volume->setValue(20);
|
||||||
@ -78,6 +79,7 @@ QByteArray UDPSrcGUI::serialize() const
|
|||||||
s.writeString(10, m_udpAddress);
|
s.writeString(10, m_udpAddress);
|
||||||
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);
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,6 +141,8 @@ bool UDPSrcGUI::deserialize(const QByteArray& data)
|
|||||||
ui->audioActive->setChecked(booltmp);
|
ui->audioActive->setChecked(booltmp);
|
||||||
d.readS32(12, &s32tmp, 20);
|
d.readS32(12, &s32tmp, 20);
|
||||||
ui->volume->setValue(s32tmp);
|
ui->volume->setValue(s32tmp);
|
||||||
|
d.readS32(13, &s32tmp, 9998);
|
||||||
|
ui->audioPort->setText(QString("%1").arg(s32tmp));
|
||||||
|
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
m_channelMarker.blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
@ -273,6 +277,7 @@ void UDPSrcGUI::applySettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_udpAddress = ui->udpAddress->text();
|
m_udpAddress = ui->udpAddress->text();
|
||||||
|
|
||||||
int udpPort = ui->udpPort->text().toInt(&ok);
|
int udpPort = ui->udpPort->text().toInt(&ok);
|
||||||
|
|
||||||
if((!ok) || (udpPort < 1) || (udpPort > 65535))
|
if((!ok) || (udpPort < 1) || (udpPort > 65535))
|
||||||
@ -280,6 +285,13 @@ void UDPSrcGUI::applySettings()
|
|||||||
udpPort = 9999;
|
udpPort = 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int audioPort = ui->audioPort->text().toInt(&ok);
|
||||||
|
|
||||||
|
if((!ok) || (audioPort < 1) || (audioPort > 65535) || (audioPort == udpPort))
|
||||||
|
{
|
||||||
|
audioPort = udpPort - 1;
|
||||||
|
}
|
||||||
|
|
||||||
int boost = ui->boost->value();
|
int boost = ui->boost->value();
|
||||||
bool audioActive = ui->audioActive->isChecked();
|
bool audioActive = ui->audioActive->isChecked();
|
||||||
|
|
||||||
@ -290,6 +302,7 @@ void UDPSrcGUI::applySettings()
|
|||||||
ui->rfBandwidth->setText(QString("%1").arg(rfBandwidth, 0));
|
ui->rfBandwidth->setText(QString("%1").arg(rfBandwidth, 0));
|
||||||
//ui->udpAddress->setText(m_udpAddress);
|
//ui->udpAddress->setText(m_udpAddress);
|
||||||
ui->udpPort->setText(QString("%1").arg(udpPort));
|
ui->udpPort->setText(QString("%1").arg(udpPort));
|
||||||
|
ui->audioPort->setText(QString("%1").arg(audioPort));
|
||||||
ui->boost->setValue(boost);
|
ui->boost->setValue(boost);
|
||||||
m_channelMarker.disconnect(this, SLOT(channelMarkerChanged()));
|
m_channelMarker.disconnect(this, SLOT(channelMarkerChanged()));
|
||||||
m_channelMarker.setBandwidth((int)rfBandwidth);
|
m_channelMarker.setBandwidth((int)rfBandwidth);
|
||||||
@ -322,6 +335,7 @@ void UDPSrcGUI::applySettings()
|
|||||||
m_outputSampleRate = outputSampleRate;
|
m_outputSampleRate = outputSampleRate;
|
||||||
m_rfBandwidth = rfBandwidth;
|
m_rfBandwidth = rfBandwidth;
|
||||||
m_udpPort = udpPort;
|
m_udpPort = udpPort;
|
||||||
|
m_audioPort = audioPort;
|
||||||
m_boost = boost;
|
m_boost = boost;
|
||||||
m_audioActive = audioActive;
|
m_audioActive = audioActive;
|
||||||
|
|
||||||
@ -331,7 +345,7 @@ void UDPSrcGUI::applySettings()
|
|||||||
rfBandwidth,
|
rfBandwidth,
|
||||||
m_udpAddress,
|
m_udpAddress,
|
||||||
udpPort,
|
udpPort,
|
||||||
udpPort - 1, // TODO: replace with the audio port
|
audioPort,
|
||||||
audioActive);
|
audioActive);
|
||||||
|
|
||||||
ui->applyBtn->setEnabled(false);
|
ui->applyBtn->setEnabled(false);
|
||||||
@ -378,6 +392,11 @@ void UDPSrcGUI::on_udpPort_textEdited(const QString& arg1)
|
|||||||
ui->applyBtn->setEnabled(true);
|
ui->applyBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UDPSrcGUI::on_audioPort_textEdited(const QString& arg1)
|
||||||
|
{
|
||||||
|
ui->applyBtn->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void UDPSrcGUI::on_applyBtn_clicked()
|
void UDPSrcGUI::on_applyBtn_clicked()
|
||||||
{
|
{
|
||||||
applySettings();
|
applySettings();
|
||||||
|
@ -46,6 +46,7 @@ private slots:
|
|||||||
void on_rfBandwidth_textEdited(const QString& arg1);
|
void on_rfBandwidth_textEdited(const QString& arg1);
|
||||||
void on_udpAddress_textEdited(const QString& arg1);
|
void on_udpAddress_textEdited(const QString& arg1);
|
||||||
void on_udpPort_textEdited(const QString& arg1);
|
void on_udpPort_textEdited(const QString& arg1);
|
||||||
|
void on_audioPort_textEdited(const QString& arg1);
|
||||||
void on_audioActive_toggled(bool checked);
|
void on_audioActive_toggled(bool checked);
|
||||||
void on_applyBtn_clicked();
|
void on_applyBtn_clicked();
|
||||||
void onWidgetRolled(QWidget* widget, bool rollDown);
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
||||||
@ -70,6 +71,7 @@ private:
|
|||||||
int m_volume;
|
int m_volume;
|
||||||
QString m_udpAddress;
|
QString m_udpAddress;
|
||||||
int m_udpPort;
|
int m_udpPort;
|
||||||
|
int m_audioPort;
|
||||||
bool m_basicSettingsShown;
|
bool m_basicSettingsShown;
|
||||||
bool m_doApplySettings;
|
bool m_doApplySettings;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user