mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-17 23:28:50 -05:00
SDRPlay: force settings at startup and on deserialize
This commit is contained in:
parent
44d4acc3e6
commit
edb2ae985f
@ -31,7 +31,8 @@
|
||||
SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SDRPlayGui),
|
||||
m_deviceAPI(deviceAPI)
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_forceSettings(true)
|
||||
{
|
||||
m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource();
|
||||
|
||||
@ -121,6 +122,7 @@ bool SDRPlayGui::deserialize(const QByteArray& data)
|
||||
if(m_settings.deserialize(data))
|
||||
{
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
return true;
|
||||
}
|
||||
@ -265,8 +267,9 @@ void SDRPlayGui::sendSettings()
|
||||
void SDRPlayGui::updateHardware()
|
||||
{
|
||||
qDebug() << "SDRPlayGui::updateHardware";
|
||||
SDRPlayInput::MsgConfigureSDRPlay* message = SDRPlayInput::MsgConfigureSDRPlay::create( m_settings);
|
||||
SDRPlayInput::MsgConfigureSDRPlay* message = SDRPlayInput::MsgConfigureSDRPlay::create( m_settings, m_forceSettings);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ private:
|
||||
Ui::SDRPlayGui* ui;
|
||||
|
||||
DeviceSourceAPI* m_deviceAPI;
|
||||
bool m_forceSettings;
|
||||
SDRPlaySettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
||||
|
@ -232,7 +232,7 @@ bool SDRPlayInput::handleMessage(const Message& message)
|
||||
// standard changes
|
||||
else
|
||||
{
|
||||
if (!applySettings(settings, false, false))
|
||||
if (!applySettings(settings, false, conf.getForce()))
|
||||
{
|
||||
qDebug("SDRPlayInput::handleMessage: config error");
|
||||
}
|
||||
|
@ -35,18 +35,21 @@ public:
|
||||
|
||||
public:
|
||||
const SDRPlaySettings& getSettings() const { return m_settings; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureSDRPlay* create(const SDRPlaySettings& settings)
|
||||
static MsgConfigureSDRPlay* create(const SDRPlaySettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureSDRPlay(settings);
|
||||
return new MsgConfigureSDRPlay(settings, force);
|
||||
}
|
||||
|
||||
private:
|
||||
SDRPlaySettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureSDRPlay(const SDRPlaySettings& settings) :
|
||||
MsgConfigureSDRPlay(const SDRPlaySettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
const PluginDescriptor SDRPlayPlugin::m_pluginDescriptor = {
|
||||
QString("SDRPlay RSP1 Input"),
|
||||
QString("3.5.0"),
|
||||
QString("3.7.4"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user