mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-04 06:54:39 -04:00
SDRdaemon plugin: code cleanup
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
const int SDRdaemonUDPHandler::m_rateDivider = 1000/SDRDAEMON_THROTTLE_MS;
|
||||
|
||||
SDRdaemonUDPHandler::SDRdaemonUDPHandler(SampleFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI) :
|
||||
//m_mutex(QMutex::Recursive),
|
||||
m_sdrDaemonBuffer(m_rateDivider),
|
||||
m_dataSocket(0),
|
||||
m_dataAddress(QHostAddress::LocalHost),
|
||||
@@ -64,7 +63,6 @@ void SDRdaemonUDPHandler::start()
|
||||
if (m_dataSocket->bind(m_dataAddress, m_dataPort))
|
||||
{
|
||||
qDebug("SDRdaemonUDPHandler::start: bind data socket to port %d", m_dataPort);
|
||||
//connect(this, SIGNAL(dataReady()), this, SLOT(processData()));
|
||||
connect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()), Qt::QueuedConnection); // , Qt::QueuedConnection
|
||||
m_dataConnected = true;
|
||||
}
|
||||
@@ -82,7 +80,6 @@ void SDRdaemonUDPHandler::stop()
|
||||
|
||||
if (m_dataConnected) {
|
||||
disconnect(m_dataSocket, SIGNAL(readyRead()), this, SLOT(dataReadyRead()));
|
||||
//disconnect(this, SIGNAL(dataReady()), this, SLOT(processData));
|
||||
m_dataConnected = false;
|
||||
}
|
||||
|
||||
@@ -95,13 +92,10 @@ void SDRdaemonUDPHandler::stop()
|
||||
|
||||
void SDRdaemonUDPHandler::dataReadyRead()
|
||||
{
|
||||
//qDebug() << "SDRdaemonUDPHandler::dataReadyRead";
|
||||
|
||||
while (m_dataSocket->hasPendingDatagrams())
|
||||
{
|
||||
qint64 pendingDataSize = m_dataSocket->pendingDatagramSize();
|
||||
m_udpReadBytes = m_dataSocket->readDatagram(m_udpBuf, pendingDataSize, 0, 0);
|
||||
//emit dataReady();
|
||||
processData();
|
||||
}
|
||||
}
|
||||
@@ -114,8 +108,6 @@ void SDRdaemonUDPHandler::processData()
|
||||
}
|
||||
else if (m_udpReadBytes > 0)
|
||||
{
|
||||
//QMutexLocker ml(&m_mutex);
|
||||
|
||||
m_sdrDaemonBuffer.updateBlockCounts(m_udpReadBytes);
|
||||
|
||||
if (m_sdrDaemonBuffer.readMeta(m_udpBuf, m_udpReadBytes))
|
||||
@@ -163,8 +155,6 @@ void SDRdaemonUDPHandler::setSamplerate(uint32_t samplerate)
|
||||
<< " new:" << samplerate
|
||||
<< " old:" << m_samplerate;
|
||||
|
||||
//QMutexLocker ml(&m_mutex);
|
||||
|
||||
m_samplerate = samplerate;
|
||||
m_chunksize = (m_samplerate / m_rateDivider) * SDRdaemonBuffer::m_iqSampleSize;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user