mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-06 11:39:02 -04:00
FileSink output: force settings at startup and on deserialize
This commit is contained in:
parent
2d27235769
commit
ca674efb24
@ -38,6 +38,7 @@ FileSinkGui::FileSinkGui(DeviceSinkAPI *deviceAPI, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::FileSinkGui),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_fileName("./test.sdriq"),
|
||||
m_deviceSampleSink(0),
|
||||
@ -117,6 +118,7 @@ bool FileSinkGui::deserialize(const QByteArray& data)
|
||||
{
|
||||
if(m_settings.deserialize(data)) {
|
||||
displaySettings();
|
||||
m_forceSettings = true;
|
||||
sendSettings();
|
||||
return true;
|
||||
} else {
|
||||
@ -196,8 +198,9 @@ void FileSinkGui::sendSettings()
|
||||
void FileSinkGui::updateHardware()
|
||||
{
|
||||
qDebug() << "FileSinkGui::updateHardware";
|
||||
FileSinkOutput::MsgConfigureFileSink* message = FileSinkOutput::MsgConfigureFileSink::create(m_settings);
|
||||
FileSinkOutput::MsgConfigureFileSink* message = FileSinkOutput::MsgConfigureFileSink::create(m_settings, m_forceSettings);
|
||||
m_deviceSampleSink->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ private:
|
||||
Ui::FileSinkGui* ui;
|
||||
|
||||
DeviceSinkAPI* m_deviceAPI;
|
||||
bool m_forceSettings;
|
||||
FileSinkSettings m_settings;
|
||||
QString m_fileName;
|
||||
QTimer m_updateTimer;
|
||||
|
@ -157,7 +157,7 @@ bool FileSinkOutput::handleMessage(const Message& message)
|
||||
{
|
||||
qDebug() << "FileSinkOutput::handleMessage: MsgConfigureFileSink";
|
||||
MsgConfigureFileSink& conf = (MsgConfigureFileSink&) message;
|
||||
applySettings(conf.getSettings(), false);
|
||||
applySettings(conf.getSettings(), conf.getForce());
|
||||
return true;
|
||||
}
|
||||
else if (MsgConfigureFileSinkWork::match(message))
|
||||
|
@ -36,18 +36,21 @@ public:
|
||||
|
||||
public:
|
||||
const FileSinkSettings& getSettings() const { return m_settings; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureFileSink* create(const FileSinkSettings& settings)
|
||||
static MsgConfigureFileSink* create(const FileSinkSettings& settings, bool force)
|
||||
{
|
||||
return new MsgConfigureFileSink(settings);
|
||||
return new MsgConfigureFileSink(settings, force);
|
||||
}
|
||||
|
||||
private:
|
||||
FileSinkSettings m_settings;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureFileSink(const FileSinkSettings& settings) :
|
||||
MsgConfigureFileSink(const FileSinkSettings& settings, bool force) :
|
||||
Message(),
|
||||
m_settings(settings)
|
||||
m_settings(settings),
|
||||
m_force(force)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
const PluginDescriptor FileSinkPlugin::m_pluginDescriptor = {
|
||||
QString("File sink output"),
|
||||
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