mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-03 14:34:57 -04:00
Multi device support: migrate device specific stuff outside plugin classes completed for source plugins
This commit is contained in:
@@ -53,21 +53,21 @@ RTLSDRGui::RTLSDRGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent
|
||||
|
||||
displaySettings();
|
||||
|
||||
m_sampleSource = new RTLSDRInput(m_pluginAPI);
|
||||
m_sampleSource = new RTLSDRInput(m_deviceAPI);
|
||||
connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
|
||||
m_pluginAPI->setSource(m_sampleSource);
|
||||
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);
|
||||
}
|
||||
|
||||
RTLSDRGui::~RTLSDRGui()
|
||||
{
|
||||
m_pluginAPI->removeSink(m_fileSink);
|
||||
m_deviceAPI->removeSink(m_fileSink);
|
||||
delete m_fileSink;
|
||||
delete ui;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void RTLSDRGui::handleDSPMessages()
|
||||
{
|
||||
Message* message;
|
||||
|
||||
while ((message = m_pluginAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
||||
while ((message = m_deviceAPI->getDeviceOutputMessageQueue()->pop()) != 0)
|
||||
{
|
||||
qDebug("RTLSDRGui::handleDSPMessages: message: %s", message->getIdentifier());
|
||||
|
||||
@@ -192,8 +192,8 @@ void RTLSDRGui::handleSourceMessages()
|
||||
|
||||
void RTLSDRGui::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));
|
||||
}
|
||||
|
||||
@@ -315,15 +315,15 @@ void RTLSDRGui::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();
|
||||
}
|
||||
}
|
||||
@@ -351,7 +351,7 @@ void RTLSDRGui::updateHardware()
|
||||
|
||||
void RTLSDRGui::updateStatus()
|
||||
{
|
||||
int state = m_pluginAPI->state();
|
||||
int state = m_deviceAPI->state();
|
||||
|
||||
if(m_lastEngineState != state)
|
||||
{
|
||||
@@ -368,7 +368,7 @@ void RTLSDRGui::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