mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 14:04:46 -04:00
Multi device support: migrate device specific stuff outside plugin classes completed for source plugins
This commit is contained in:
@@ -142,20 +142,20 @@ FCDProGui::FCDProGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_sampleSource = new FCDProInput(m_pluginAPI);
|
||||
m_pluginAPI->setSource(m_sampleSource);
|
||||
m_sampleSource = new FCDProInput(m_deviceAPI);
|
||||
m_deviceAPI->setSource(m_sampleSource);
|
||||
|
||||
char recFileNameCStr[30];
|
||||
sprintf(recFileNameCStr, "test_%d.sdriq", m_pluginAPI->getDeviceUID());
|
||||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileSink(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
connect(m_pluginAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);
|
||||
connect(m_deviceAPI->getDeviceOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
FCDProGui::~FCDProGui()
|
||||
{
|
||||
m_pluginAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
delete ui;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ void FCDProGui::handleDSPMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_pluginAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
||||
while ((message = m_deviceAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
||||
{
|
||||
qDebug("FCDProGui::handleDSPMessages: message: %s", message->getIdentifier());
|
||||
|
||||
@@ -243,8 +243,8 @@ void FCDProGui::handleDSPMessages()
|
||||
|
||||
void FCDProGui::updateSampleRateAndFrequency()
|
||||
{
|
||||
m_pluginAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||
m_pluginAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||
m_deviceAPI->getSpectrum()->setSampleRate(m_sampleRate);
|
||||
m_deviceAPI->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||
ui->deviceRateText->setText(tr("%1k").arg((float)m_sampleRate / 1000));
|
||||
}
|
||||
|
||||
@@ -426,15 +426,15 @@ void FCDProGui::on_startStop_toggled(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
{
|
||||
if (m_pluginAPI->initAcquisition())
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
{
|
||||
m_pluginAPI->startAcquisition();
|
||||
m_deviceAPI->startAcquisition();
|
||||
DSPEngine::instance()->startAudio();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pluginAPI->stopAcquistion();
|
||||
m_deviceAPI->stopAcquisition();
|
||||
DSPEngine::instance()->stopAudio();
|
||||
}
|
||||
}
|
||||
@@ -455,7 +455,7 @@ void FCDProGui::on_record_toggled(bool checked)
|
||||
|
||||
void FCDProGui::updateStatus()
|
||||
{
|
||||
int state = m_pluginAPI->state();
|
||||
int state = m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
@@ -472,7 +472,7 @@ void FCDProGui::updateStatus()
|
||||
break;
|
||||
case DSPDeviceEngine::StError:
|
||||
ui->startStop->setStyleSheet("QToolButton { background-color : red; }");
|
||||
QMessageBox::information(this, tr("Message"), m_pluginAPI->errorMessage());
|
||||
QMessageBox::information(this, tr("Message"), m_deviceAPI->errorMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user