1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

Web API: use message passing to start/stop device for all the rest of device plugins

This commit is contained in:
f4exb
2017-12-14 18:02:49 +01:00
parent db86bc5813
commit 966767a44a
42 changed files with 884 additions and 389 deletions
@@ -219,8 +219,19 @@ bool LimeSDRInputGUI::handleMessage(const Message& message)
ui->temperatureText->setText(tr("%1C").arg(QString::number(report.getTemperature(), 'f', 0)));
return true;
}
else if (LimeSDRInput::MsgStartStop::match(message))
{
LimeSDRInput::MsgStartStop& notif = (LimeSDRInput::MsgStartStop&) message;
blockApplySettings(true);
ui->startStop->setChecked(notif.getStartStop());
blockApplySettings(false);
return false;
return true;
}
else
{
return false;
}
}
void LimeSDRInputGUI::handleInputMessages()
@@ -415,18 +426,10 @@ void LimeSDRInputGUI::blockApplySettings(bool block)
void LimeSDRInputGUI::on_startStop_toggled(bool checked)
{
if (checked)
if (m_doApplySettings)
{
if (m_deviceUISet->m_deviceSourceAPI->initAcquisition())
{
m_deviceUISet->m_deviceSourceAPI->startAcquisition();
DSPEngine::instance()->startAudioOutput();
}
}
else
{
m_deviceUISet->m_deviceSourceAPI->stopAcquisition();
DSPEngine::instance()->stopAudioOutput();
LimeSDRInput::MsgStartStop *message = LimeSDRInput::MsgStartStop::create(checked);
m_limeSDRInput->getInputMessageQueue()->push(message);
}
}