mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-03 18:18:31 -04:00
SDRdaemon input: fixed reporting to the GUI. Device sample source: cleanup
This commit is contained in:
parent
31ad75a405
commit
2af1f56fea
plugins/samplesource/sdrdaemonsource
sdrbase/dsp
@ -258,7 +258,7 @@ void SDRdaemonSourceGui::handleInputMessages()
|
||||
|
||||
while ((message = m_inputMessageQueue.pop()) != 0)
|
||||
{
|
||||
qDebug("SDRdaemonGui::handleInputMessages: message: %s", message->getIdentifier());
|
||||
//qDebug("SDRdaemonGui::handleInputMessages: message: %s", message->getIdentifier());
|
||||
|
||||
if (DSPSignalNotification::match(*message))
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ SDRdaemonSourceInput::SDRdaemonSourceInput(DeviceSourceAPI *deviceAPI) :
|
||||
m_autoCorrBuffer(false)
|
||||
{
|
||||
m_sampleFifo.setSize(96000 * 4);
|
||||
m_SDRdaemonUDPHandler = new SDRdaemonSourceUDPHandler(&m_sampleFifo, getMessageQueueToGUI(), m_deviceAPI);
|
||||
m_SDRdaemonUDPHandler = new SDRdaemonSourceUDPHandler(&m_sampleFifo, &m_inputMessageQueue, m_deviceAPI);
|
||||
m_SDRdaemonUDPHandler->connectTimer(&m_masterTimer);
|
||||
|
||||
char recFileNameCStr[30];
|
||||
@ -175,6 +175,26 @@ bool SDRdaemonSourceInput::handleMessage(const Message& message)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (MsgReportSDRdaemonSourceStreamData::match(message))
|
||||
{
|
||||
// Forward message to the GUI if it is present
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(const_cast<Message*>(&message));
|
||||
return false; // deletion of message is handled by the GUI
|
||||
} else {
|
||||
return true; // delete the unused message
|
||||
}
|
||||
}
|
||||
else if (MsgReportSDRdaemonSourceStreamTiming::match(message))
|
||||
{
|
||||
// Forward message to the GUI if it is present
|
||||
if (getMessageQueueToGUI()) {
|
||||
getMessageQueueToGUI()->push(const_cast<Message*>(&message));
|
||||
return false; // deletion of message is handled by the GUI
|
||||
} else {
|
||||
return true; // delete the unused message
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@ -183,6 +203,7 @@ bool SDRdaemonSourceInput::handleMessage(const Message& message)
|
||||
|
||||
void SDRdaemonSourceInput::setMessageQueueToGUI(MessageQueue *queue)
|
||||
{
|
||||
qDebug("SDRdaemonSourceInput::setMessageQueueToGUI: %p", queue);
|
||||
DeviceSampleSource::setMessageQueueToGUI(queue);
|
||||
m_SDRdaemonUDPHandler->setMessageQueueToGUI(queue);
|
||||
}
|
||||
|
@ -180,9 +180,7 @@ void SDRdaemonSourceUDPHandler::processData()
|
||||
m_tv_sec,
|
||||
m_tv_usec);
|
||||
|
||||
if (m_outputMessageQueueToGUI) {
|
||||
m_outputMessageQueueToGUI->push(report);
|
||||
}
|
||||
m_outputMessageQueueToGUI->push(report);
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,8 +260,6 @@ void SDRdaemonSourceUDPHandler::tick()
|
||||
nbOriginalBlocks,
|
||||
nbFECblocks);
|
||||
|
||||
if (m_outputMessageQueueToGUI) {
|
||||
m_outputMessageQueueToGUI->push(report);
|
||||
}
|
||||
m_outputMessageQueueToGUI->push(report);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||
//MessageQueue *getOutputMessageQueueToGUI() { return &m_outputMessageQueueToGUI; } // TODO: remove
|
||||
SampleSinkFifo* getSampleFifo() { return &m_sampleFifo; }
|
||||
|
||||
protected slots:
|
||||
@ -54,7 +53,6 @@ protected:
|
||||
SampleSinkFifo m_sampleFifo;
|
||||
MessageQueue m_inputMessageQueue; //!< Input queue to the source
|
||||
MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI
|
||||
MessageQueue m_outputMessageQueueToGUI; //!< Output queue specialized for the source GUI // TODO: remove
|
||||
};
|
||||
|
||||
#endif // INCLUDE_SAMPLESOURCE_H
|
||||
|
Loading…
Reference in New Issue
Block a user