mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 10:05:46 -05:00
Message pipes rework (2)
This commit is contained in:
parent
555a5d1d4c
commit
7bbc2749eb
@ -362,19 +362,19 @@ bool AISDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void AISDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
AISDemodSettings::AISDEMOD_CHANNEL_SAMPLE_RATE
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -282,19 +282,19 @@ bool AMDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void AMDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -342,16 +342,16 @@ void AMDemodSink::applyAudioSampleRate(int sampleRate)
|
||||
m_syncAMAGC.resize(sampleRate/4, sampleRate/8, 0.1);
|
||||
m_pll.setSampleRate(sampleRate);
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,19 +369,19 @@ bool DABDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void DABDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -648,16 +648,16 @@ void DABDemodSink::applyAudioSampleRate(int sampleRate)
|
||||
|
||||
m_audioFifo.setSize(sampleRate);
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,19 +308,19 @@ bool DSDDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void DSDDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,16 +328,16 @@ void DSDDemodSink::applyAudioSampleRate(int sampleRate)
|
||||
m_dsdDecoder.setUpsampling(upsampling);
|
||||
m_audioSampleRate = sampleRate;
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -293,19 +293,19 @@ bool NFMDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void NFMDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -409,16 +409,16 @@ void NFMDemodSink::applyAudioSampleRate(unsigned int sampleRate)
|
||||
m_interpolatorDistanceRemain = m_interpolatorDistance;
|
||||
m_audioSampleRate = sampleRate;
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -335,19 +335,19 @@ void PacketDemod::applySettings(const PacketDemodSettings& settings, bool force)
|
||||
|
||||
void PacketDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
PacketDemodSettings::PACKETDEMOD_CHANNEL_SAMPLE_RATE
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -333,19 +333,19 @@ bool PagerDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void PagerDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
PagerDemodSettings::m_channelSampleRate
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -303,19 +303,23 @@ bool SSBDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void SSBDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe: pipes)
|
||||
{
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -309,16 +309,21 @@ void SSBDemodSink::applyAudioSampleRate(int sampleRate)
|
||||
m_audioFifo.setSize(sampleRate);
|
||||
m_audioSampleRate = sampleRate;
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
|
||||
if (messageQueues)
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -269,19 +269,20 @@ bool WFMDemod::deserialize(const QByteArray& data)
|
||||
|
||||
void WFMDemod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe: pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -180,16 +180,16 @@ void WFMDemodSink::applyAudioSampleRate(int sampleRate)
|
||||
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) sampleRate;
|
||||
m_audioSampleRate = sampleRate;
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -488,19 +488,19 @@ bool AISMod::deserialize(const QByteArray& data)
|
||||
|
||||
void AISMod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
AISModSettings::AISMOD_SAMPLE_RATE
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -364,16 +364,16 @@ void AISModSource::applyChannelSettings(int channelSampleRate, int channelFreque
|
||||
m_channelSampleRate = channelSampleRate;
|
||||
m_channelFrequencyOffset = channelFrequencyOffset;
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, m_channelSampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -357,19 +357,19 @@ bool AMMod::deserialize(const QByteArray& data)
|
||||
|
||||
void AMMod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -321,16 +321,16 @@ void AMModSource::applyAudioSampleRate(int sampleRate)
|
||||
m_cwKeyer.setSampleRate(sampleRate);
|
||||
m_cwKeyer.reset();
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -404,19 +404,19 @@ bool NFMMod::deserialize(const QByteArray& data)
|
||||
|
||||
void NFMMod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -359,16 +359,16 @@ void NFMModSource::applyAudioSampleRate(int sampleRate)
|
||||
m_audioSampleRate = sampleRate;
|
||||
applyFeedbackAudioSampleRate(m_feedbackAudioSampleRate);
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -438,19 +438,19 @@ bool PacketMod::deserialize(const QByteArray& data)
|
||||
|
||||
void PacketMod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getSourceChannelSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -417,16 +417,16 @@ void PacketModSource::applyChannelSettings(int channelSampleRate, int channelFre
|
||||
// Precalculate FM sensensity to save doing it in the loop
|
||||
m_phaseSensitivity = 2.0f * M_PI * m_settings.m_fmDeviation / (double)m_channelSampleRate;
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, m_channelSampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -381,19 +381,19 @@ bool SSBMod::deserialize(const QByteArray& data)
|
||||
|
||||
void SSBMod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -620,16 +620,16 @@ void SSBModSource::applyAudioSampleRate(int sampleRate)
|
||||
|
||||
applyFeedbackAudioSampleRate(m_feedbackAudioSampleRate);
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -343,19 +343,19 @@ bool WFMMod::deserialize(const QByteArray& data)
|
||||
|
||||
void WFMMod::sendSampleRateToDemodAnalyzer()
|
||||
{
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(this, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(
|
||||
this,
|
||||
getAudioSampleRate()
|
||||
);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -371,16 +371,16 @@ void WFMModSource::applyAudioSampleRate(int sampleRate)
|
||||
m_audioSampleRate = sampleRate;
|
||||
applyFeedbackAudioSampleRate(m_feedbackAudioSampleRate);
|
||||
|
||||
QList<MessageQueue*> *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(m_channel, "reportdemod");
|
||||
QList<ObjectPipe*> pipes;
|
||||
MainCore::instance()->getMessagePipes2().getMessagePipes(m_channel, "reportdemod", pipes);
|
||||
|
||||
if (messageQueues)
|
||||
if (pipes.size() > 0)
|
||||
{
|
||||
QList<MessageQueue*>::iterator it = messageQueues->begin();
|
||||
|
||||
for (; it != messageQueues->end(); ++it)
|
||||
for (const auto& pipe : pipes)
|
||||
{
|
||||
MessageQueue* messageQueue = qobject_cast<MessageQueue*>(pipe->m_element);
|
||||
MainCore::MsgChannelDemodReport *msg = MainCore::MsgChannelDemodReport::create(m_channel, sampleRate);
|
||||
(*it)->push(msg);
|
||||
messageQueue->push(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,12 +157,13 @@ bool DemodAnalyzer::handleMessage(const Message& cmd)
|
||||
}
|
||||
else if (MsgSelectChannel::match(cmd))
|
||||
{
|
||||
qDebug() << "DemodAnalyzer::handleMessage: MsgSelectChannel";
|
||||
MsgSelectChannel& cfg = (MsgSelectChannel&) cmd;
|
||||
ChannelAPI *selectedChannel = cfg.getChannel();
|
||||
qDebug("DemodAnalyzer::handleMessage: MsgSelectChannel: %p %s",
|
||||
selectedChannel, qPrintable(selectedChannel->objectName()));
|
||||
setChannel(selectedChannel);
|
||||
MainCore::MsgChannelDemodQuery *msg = MainCore::MsgChannelDemodQuery::create();
|
||||
selectedChannel->getChannelMessageQueue()->push(msg);
|
||||
selectedChannel->getInputMessageQueue()->push(msg);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -343,8 +344,16 @@ void DemodAnalyzer::setChannel(ChannelAPI *selectedChannel)
|
||||
m_worker->getInputMessageQueue()->push(msg);
|
||||
}
|
||||
|
||||
MessageQueue *messageQueue = mainCore->getMessagePipes().unregisterChannelToFeature(m_selectedChannel, this, "reportdemod");
|
||||
disconnect(messageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessageQueue(MessageQueue*)));
|
||||
ObjectPipe *messagePipe = mainCore->getMessagePipes2().unregisterProducerToConsumer(m_selectedChannel, this, "reportdemod");
|
||||
|
||||
if (messagePipe)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(messagePipe->m_element);
|
||||
|
||||
if (messageQueue) {
|
||||
disconnect(messageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessageQueue(MessageQueue*)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_dataPipe = mainCore->getDataPipes().registerProducerToConsumer(selectedChannel, this, "demod");
|
||||
@ -362,15 +371,23 @@ void DemodAnalyzer::setChannel(ChannelAPI *selectedChannel)
|
||||
}
|
||||
}
|
||||
|
||||
MessageQueue *messageQueue = mainCore->getMessagePipes().registerChannelToFeature(selectedChannel, this, "reportdemod");
|
||||
ObjectPipe *messagePipe = mainCore->getMessagePipes2().registerProducerToConsumer(selectedChannel, this, "reportdemod");
|
||||
|
||||
QObject::connect(
|
||||
messageQueue,
|
||||
&MessageQueue::messageEnqueued,
|
||||
this,
|
||||
[=](){ this->handleChannelMessageQueue(messageQueue); },
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
if (messagePipe)
|
||||
{
|
||||
MessageQueue *messageQueue = qobject_cast<MessageQueue*>(messagePipe->m_element);
|
||||
|
||||
if (messageQueue)
|
||||
{
|
||||
QObject::connect(
|
||||
messageQueue,
|
||||
&MessageQueue::messageEnqueued,
|
||||
this,
|
||||
[=](){ this->handleChannelMessageQueue(messageQueue); },
|
||||
Qt::QueuedConnection
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
m_selectedChannel = selectedChannel;
|
||||
}
|
||||
|
@ -68,7 +68,6 @@ public:
|
||||
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
|
||||
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
|
||||
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||
MessageQueue *getChannelMessageQueue() { return &m_channelMessageQueue; } //!< Get the queue for plugin communication
|
||||
|
||||
/**
|
||||
* API adapter for the channel settings GET requests
|
||||
|
@ -44,6 +44,7 @@ DataFifo::DataFifo(QObject* parent) :
|
||||
m_currentDataType(DataTypeI16),
|
||||
m_mutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName("DataFifo");
|
||||
m_suppressed = -1;
|
||||
m_size = 0;
|
||||
m_fill = 0;
|
||||
@ -57,6 +58,7 @@ DataFifo::DataFifo(int size, QObject* parent) :
|
||||
m_currentDataType(DataTypeI16),
|
||||
m_mutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName("DataFifo");
|
||||
m_suppressed = -1;
|
||||
create(size);
|
||||
}
|
||||
@ -67,6 +69,7 @@ DataFifo::DataFifo(const DataFifo& other) :
|
||||
m_currentDataType(DataTypeI16),
|
||||
m_mutex(QMutex::Recursive)
|
||||
{
|
||||
setObjectName("DataFifo");
|
||||
m_suppressed = -1;
|
||||
m_size = m_data.size();
|
||||
m_fill = 0;
|
||||
|
@ -29,7 +29,6 @@ ObjectPipesRegistrations::~ObjectPipesRegistrations()
|
||||
|
||||
ObjectPipe *ObjectPipesRegistrations::registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type)
|
||||
{
|
||||
qDebug("ObjectPipesRegistrations::registerProducerToConsumer: %p %p %s", producer, consumer, qPrintable("type"));
|
||||
int typeId;
|
||||
QMutexLocker mlock(&m_mutex);
|
||||
|
||||
@ -52,6 +51,8 @@ ObjectPipe *ObjectPipesRegistrations::registerProducerToConsumer(const QObject *
|
||||
}
|
||||
|
||||
QObject *element = m_objectPipeElementsStore->createElement();
|
||||
qDebug("ObjectPipesRegistrations::registerProducerToConsumer: %p %p %s %s",
|
||||
producer, consumer, qPrintable(element->objectName()), qPrintable(type));
|
||||
m_pipes.push_back(new ObjectPipe());
|
||||
m_pipes.back()->m_pipeId = ++m_pipeId;
|
||||
m_pipes.back()->m_typeId = typeId;
|
||||
@ -73,7 +74,6 @@ ObjectPipe *ObjectPipesRegistrations::registerProducerToConsumer(const QObject *
|
||||
|
||||
ObjectPipe *ObjectPipesRegistrations::unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type)
|
||||
{
|
||||
qDebug("ObjectPipesRegistrations::unregisterProducerToConsumer: %p %p %s", producer, consumer, qPrintable(type));
|
||||
ObjectPipe *pipe = nullptr;
|
||||
|
||||
if (m_typeIds.contains(type))
|
||||
@ -108,6 +108,17 @@ ObjectPipe *ObjectPipesRegistrations::unregisterProducerToConsumer(const QObject
|
||||
}
|
||||
}
|
||||
|
||||
if (pipe)
|
||||
{
|
||||
qDebug("ObjectPipesRegistrations::unregisterProducerToConsumer: %p %p %s %s",
|
||||
producer, consumer, qPrintable(pipe->m_element->objectName()), qPrintable(type));
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("ObjectPipesRegistrations::unregisterProducerToConsumer: %p %p %s nullptr",
|
||||
producer, consumer, qPrintable(type));
|
||||
}
|
||||
|
||||
return pipe;
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ MessageQueue::MessageQueue(QObject* parent) :
|
||||
m_lock(QMutex::Recursive),
|
||||
m_queue()
|
||||
{
|
||||
setObjectName("MessageQueue");
|
||||
}
|
||||
|
||||
MessageQueue::~MessageQueue()
|
||||
|
Loading…
Reference in New Issue
Block a user