1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-18 07:35:47 -05:00

SDRPlay: force settings at startup and on deserialize

This commit is contained in:
f4exb 2017-10-14 07:02:21 +02:00
parent 44d4acc3e6
commit edb2ae985f
5 changed files with 15 additions and 8 deletions

View File

@ -31,7 +31,8 @@
SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent) : SDRPlayGui::SDRPlayGui(DeviceSourceAPI *deviceAPI, QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::SDRPlayGui), ui(new Ui::SDRPlayGui),
m_deviceAPI(deviceAPI) m_deviceAPI(deviceAPI),
m_forceSettings(true)
{ {
m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource(); m_sampleSource = (SDRPlayInput*) m_deviceAPI->getSampleSource();
@ -121,6 +122,7 @@ bool SDRPlayGui::deserialize(const QByteArray& data)
if(m_settings.deserialize(data)) if(m_settings.deserialize(data))
{ {
displaySettings(); displaySettings();
m_forceSettings = true;
sendSettings(); sendSettings();
return true; return true;
} }
@ -265,8 +267,9 @@ void SDRPlayGui::sendSettings()
void SDRPlayGui::updateHardware() void SDRPlayGui::updateHardware()
{ {
qDebug() << "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_sampleSource->getInputMessageQueue()->push(message);
m_forceSettings = false;
m_updateTimer.stop(); m_updateTimer.stop();
} }

View File

@ -57,6 +57,7 @@ private:
Ui::SDRPlayGui* ui; Ui::SDRPlayGui* ui;
DeviceSourceAPI* m_deviceAPI; DeviceSourceAPI* m_deviceAPI;
bool m_forceSettings;
SDRPlaySettings m_settings; SDRPlaySettings m_settings;
QTimer m_updateTimer; QTimer m_updateTimer;
QTimer m_statusTimer; QTimer m_statusTimer;

View File

@ -232,7 +232,7 @@ bool SDRPlayInput::handleMessage(const Message& message)
// standard changes // standard changes
else else
{ {
if (!applySettings(settings, false, false)) if (!applySettings(settings, false, conf.getForce()))
{ {
qDebug("SDRPlayInput::handleMessage: config error"); qDebug("SDRPlayInput::handleMessage: config error");
} }

View File

@ -35,18 +35,21 @@ public:
public: public:
const SDRPlaySettings& getSettings() const { return m_settings; } 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: private:
SDRPlaySettings m_settings; SDRPlaySettings m_settings;
bool m_force;
MsgConfigureSDRPlay(const SDRPlaySettings& settings) : MsgConfigureSDRPlay(const SDRPlaySettings& settings, bool force) :
Message(), Message(),
m_settings(settings) m_settings(settings),
m_force(force)
{ } { }
}; };

View File

@ -25,7 +25,7 @@
const PluginDescriptor SDRPlayPlugin::m_pluginDescriptor = { const PluginDescriptor SDRPlayPlugin::m_pluginDescriptor = {
QString("SDRPlay RSP1 Input"), QString("SDRPlay RSP1 Input"),
QString("3.5.0"), QString("3.7.4"),
QString("(c) Edouard Griffiths, F4EXB"), QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"), QString("https://github.com/f4exb/sdrangel"),
true, true,