mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-04 10:38:45 -04:00
SoapySDR support: stream ArgInfo SoapySDR interface
This commit is contained in:
parent
ad8026c6a2
commit
c382913fb4
@ -38,6 +38,7 @@ SoapySDROutput::SoapySDROutput(DeviceSinkAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
initGainSettings(m_settings);
|
||||
initStreamArgSettings(m_settings);
|
||||
}
|
||||
|
||||
SoapySDROutput::~SoapySDROutput()
|
||||
@ -1000,6 +1001,32 @@ bool SoapySDROutput::applySettings(const SoapySDROutputSettings& settings, bool
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto &oname : m_settings.m_streamArgSettings.keys())
|
||||
{
|
||||
auto nvalue = settings.m_streamArgSettings.find(oname);
|
||||
|
||||
if (nvalue != settings.m_streamArgSettings.end() && ((m_settings.m_streamArgSettings[oname] != *nvalue) || force))
|
||||
{
|
||||
if (dev != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
dev->writeSetting(SOAPY_SDR_TX, requestedChannel, oname.toStdString(), nvalue->toString().toStdString());
|
||||
qDebug("SoapySDRInput::applySettings: stream argument %s set to %s",
|
||||
oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
|
||||
individualGainsChanged = true;
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
qCritical("SoapySDRInput::applySettings: cannot set stream argument %s to %s: %s",
|
||||
oname.toStdString().c_str(), nvalue->toString().toStdString().c_str(), ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
m_settings.m_streamArgSettings[oname] = *nvalue;
|
||||
}
|
||||
}
|
||||
|
||||
if (forwardChangeOwnDSP)
|
||||
{
|
||||
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2Interp);
|
||||
|
@ -383,7 +383,7 @@ void SoapySDROutputGui::createStreamArgumentsControl(const SoapySDR::ArgInfoList
|
||||
|
||||
DynamicArgSettingGUI *gui = new DynamicArgSettingGUI(argGUI, QString(it->key.c_str()));
|
||||
m_streamArgsGUIs.push_back(gui);
|
||||
connect(gui, SIGNAL(valueChanged(QString, value)), this, SLOT(streamArgChanged(QString, QVariant)));
|
||||
connect(gui, SIGNAL(valueChanged(QString, QVariant)), this, SLOT(streamArgChanged(QString, QVariant)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ SoapySDRInput::SoapySDRInput(DeviceSourceAPI *deviceAPI) :
|
||||
{
|
||||
openDevice();
|
||||
initGainSettings(m_settings);
|
||||
initStreamArgSettings(m_settings);
|
||||
|
||||
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
@ -1046,6 +1047,32 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto &oname : m_settings.m_streamArgSettings.keys())
|
||||
{
|
||||
auto nvalue = settings.m_streamArgSettings.find(oname);
|
||||
|
||||
if (nvalue != settings.m_streamArgSettings.end() && ((m_settings.m_streamArgSettings[oname] != *nvalue) || force))
|
||||
{
|
||||
if (dev != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
dev->writeSetting(SOAPY_SDR_RX, requestedChannel, oname.toStdString(), nvalue->toString().toStdString());
|
||||
qDebug("SoapySDRInput::applySettings: stream argument %s set to %s",
|
||||
oname.toStdString().c_str(), nvalue->toString().toStdString().c_str());
|
||||
individualGainsChanged = true;
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
qCritical("SoapySDRInput::applySettings: cannot set stream argument %s to %s: %s",
|
||||
oname.toStdString().c_str(), nvalue->toString().toStdString().c_str(), ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
m_settings.m_streamArgSettings[oname] = *nvalue;
|
||||
}
|
||||
}
|
||||
|
||||
if (forwardChangeOwnDSP)
|
||||
{
|
||||
int sampleRate = settings.m_devSampleRate/(1<<settings.m_log2Decim);
|
||||
|
@ -386,7 +386,7 @@ void SoapySDRInputGui::createStreamArgumentsControl(const SoapySDR::ArgInfoList&
|
||||
|
||||
DynamicArgSettingGUI *gui = new DynamicArgSettingGUI(argGUI, QString(it->key.c_str()));
|
||||
m_streamArgsGUIs.push_back(gui);
|
||||
connect(gui, SIGNAL(valueChanged(QString, value)), this, SLOT(streamArgChanged(QString, QVariant)));
|
||||
connect(gui, SIGNAL(valueChanged(QString, QVariant)), this, SLOT(streamArgChanged(QString, QVariant)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user