diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index 76c4e06ef9..0e481d99f0 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -299,6 +299,8 @@ void ChannelAnalyzer::applySettings(const ChannelAnalyzerSettings& settings, boo m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index f6f0853fd3..42caa6a2c2 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -313,6 +313,8 @@ void ADSBDemod::applySettings(const ADSBDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodais/aisdemod.cpp b/plugins/channelrx/demodais/aisdemod.cpp index 83f442cce5..2d61e6e306 100644 --- a/plugins/channelrx/demodais/aisdemod.cpp +++ b/plugins/channelrx/demodais/aisdemod.cpp @@ -318,6 +318,8 @@ void AISDemod::applySettings(const AISDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index 861c3e1daf..e563990e29 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -302,6 +302,8 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index 419fa26bdf..1295890c31 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -362,6 +362,8 @@ void APTDemod::applySettings(const APTDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index 95a1e0a98d..7f687fe075 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -195,6 +195,19 @@ void ATVDemod::applySettings(const ATVDemodSettings& settings, bool force) << "m_udpPort:" << settings.m_udpPort << "force:" << force; + if (m_settings.m_streamIndex != settings.m_streamIndex) + { + if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only + { + m_deviceAPI->removeChannelSinkAPI(this); + m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); + m_deviceAPI->addChannelSink(this, settings.m_streamIndex); + m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); + } + } + ATVDemodBaseband::MsgConfigureATVDemodBaseband *msg = ATVDemodBaseband::MsgConfigureATVDemodBaseband::create(settings, force); m_basebandSink->getInputMessageQueue()->push(msg); diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 1931c690e7..19535d31b4 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -252,6 +252,8 @@ void BFMDemod::applySettings(const BFMDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp index e714f2bf01..cdb916d502 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp @@ -499,6 +499,8 @@ void ChirpChatDemod::applySettings(const ChirpChatDemodSettings& settings, bool m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demoddab/dabdemod.cpp b/plugins/channelrx/demoddab/dabdemod.cpp index d1b146d680..72e9dc7e36 100644 --- a/plugins/channelrx/demoddab/dabdemod.cpp +++ b/plugins/channelrx/demoddab/dabdemod.cpp @@ -366,6 +366,8 @@ void DABDemod::applySettings(const DABDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index 3bfd90fbdb..fdce7e7301 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -271,6 +271,20 @@ void DATVDemod::applySettings(const DATVDemodSettings& settings, bool force) if (settings.m_playerEnable != m_settings.m_playerEnable) { reverseAPIKeys.append("playerEnable"); } + if (m_settings.m_streamIndex != settings.m_streamIndex) + { + if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only + { + m_deviceAPI->removeChannelSinkAPI(this); + m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); + m_deviceAPI->addChannelSink(this, settings.m_streamIndex); + m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); + } + + reverseAPIKeys.append("streamIndex"); + } DATVDemodBaseband::MsgConfigureDATVDemodBaseband *msg = DATVDemodBaseband::MsgConfigureDATVDemodBaseband::create(settings, force); m_basebandSink->getInputMessageQueue()->push(msg); diff --git a/plugins/channelrx/demoddsc/dscdemod.cpp b/plugins/channelrx/demoddsc/dscdemod.cpp index 81a2c30665..f026a9aeea 100644 --- a/plugins/channelrx/demoddsc/dscdemod.cpp +++ b/plugins/channelrx/demoddsc/dscdemod.cpp @@ -322,6 +322,8 @@ void DSCDemod::applySettings(const DSCDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 396d6ccb6d..36648781ae 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -395,6 +395,8 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index eefcc4e7f9..6705afd2b8 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -244,6 +244,8 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodft8/ft8demod.cpp b/plugins/channelrx/demodft8/ft8demod.cpp index ebd6bd1806..23232a3a89 100644 --- a/plugins/channelrx/demodft8/ft8demod.cpp +++ b/plugins/channelrx/demodft8/ft8demod.cpp @@ -340,6 +340,8 @@ void FT8Demod::applySettings(const FT8DemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodils/ilsdemod.cpp b/plugins/channelrx/demodils/ilsdemod.cpp index 8156c9cc3a..d0b48d600e 100644 --- a/plugins/channelrx/demodils/ilsdemod.cpp +++ b/plugins/channelrx/demodils/ilsdemod.cpp @@ -377,6 +377,8 @@ void ILSDemod::applySettings(const ILSDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodm17/m17demod.cpp b/plugins/channelrx/demodm17/m17demod.cpp index adbf725643..c42b399ded 100644 --- a/plugins/channelrx/demodm17/m17demod.cpp +++ b/plugins/channelrx/demodm17/m17demod.cpp @@ -287,6 +287,8 @@ void M17Demod::applySettings(const M17DemodSettings& settings, const QListremoveChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } } diff --git a/plugins/channelrx/demodnavtex/navtexdemod.cpp b/plugins/channelrx/demodnavtex/navtexdemod.cpp index 714ff8aba7..9c7a59b51b 100644 --- a/plugins/channelrx/demodnavtex/navtexdemod.cpp +++ b/plugins/channelrx/demodnavtex/navtexdemod.cpp @@ -309,6 +309,8 @@ void NavtexDemod::applySettings(const NavtexDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 8aca4e133a..f04ae8b866 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -314,6 +314,8 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodpacket/packetdemod.cpp b/plugins/channelrx/demodpacket/packetdemod.cpp index 10eefe27f9..c772b22d80 100644 --- a/plugins/channelrx/demodpacket/packetdemod.cpp +++ b/plugins/channelrx/demodpacket/packetdemod.cpp @@ -305,6 +305,8 @@ void PacketDemod::applySettings(const PacketDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodpager/pagerdemod.cpp b/plugins/channelrx/demodpager/pagerdemod.cpp index 59c093233a..282824f1b1 100644 --- a/plugins/channelrx/demodpager/pagerdemod.cpp +++ b/plugins/channelrx/demodpager/pagerdemod.cpp @@ -296,6 +296,8 @@ void PagerDemod::applySettings(const PagerDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp index 4e07c4da2b..a025399c3a 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp @@ -345,6 +345,8 @@ void RadiosondeDemod::applySettings(const RadiosondeDemodSettings& settings, boo m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodrtty/rttydemod.cpp b/plugins/channelrx/demodrtty/rttydemod.cpp index 042914914e..12c73ade0b 100644 --- a/plugins/channelrx/demodrtty/rttydemod.cpp +++ b/plugins/channelrx/demodrtty/rttydemod.cpp @@ -309,6 +309,8 @@ void RttyDemod::applySettings(const RttyDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index 6b779ada20..0d9554a3ed 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -361,6 +361,8 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodvor/vordemod.cpp b/plugins/channelrx/demodvor/vordemod.cpp index d33e2c4b46..5ee93644e9 100644 --- a/plugins/channelrx/demodvor/vordemod.cpp +++ b/plugins/channelrx/demodvor/vordemod.cpp @@ -317,6 +317,8 @@ void VORDemod::applySettings(const VORDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index 8ac08f5bff..52d0ac236a 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -280,6 +280,8 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/filesink/filesink.cpp b/plugins/channelrx/filesink/filesink.cpp index 1af1d3df40..4a1301dc51 100644 --- a/plugins/channelrx/filesink/filesink.cpp +++ b/plugins/channelrx/filesink/filesink.cpp @@ -373,6 +373,8 @@ void FileSink::applySettings(const FileSinkSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/freqscanner/freqscanner.cpp b/plugins/channelrx/freqscanner/freqscanner.cpp index 39a597dd98..653f2cc4a4 100644 --- a/plugins/channelrx/freqscanner/freqscanner.cpp +++ b/plugins/channelrx/freqscanner/freqscanner.cpp @@ -709,6 +709,7 @@ void FreqScanner::applySettings(const FreqScannerSettings& settings, const QStri m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); scanAvailableChannels(); // re-scan + emit streamIndexChanged(settings.m_streamIndex); } } @@ -1138,6 +1139,13 @@ void FreqScanner::scanAvailableChannels() -1 }; m_availableChannels[channel] = availableChannel; + QObject::connect( + channel, + &ChannelAPI::streamIndexChanged, + [=](int streamIndex){ + this->handleChannelStreamIndexChanged(streamIndex, channel); + } + ); } } @@ -1165,6 +1173,13 @@ void FreqScanner::scanAvailableChannels() channel->getStreamIndex() }; m_availableChannels[channel] = availableChannel; + QObject::connect( + channel, + &ChannelAPI::streamIndexChanged, + [=](int streamIndex){ + this->handleChannelStreamIndexChanged(streamIndex, channel); + } + ); } } } @@ -1187,6 +1202,13 @@ void FreqScanner::handleChannelAdded(int deviceSetIndex, ChannelAPI* channel) FreqScannerSettings::AvailableChannel availableChannel = FreqScannerSettings::AvailableChannel{ deviceSetIndex, channel->getIndexInDeviceSet(), -1}; m_availableChannels[channel] = availableChannel; + QObject::connect( + channel, + &ChannelAPI::streamIndexChanged, + [=](int streamIndex){ + this->handleChannelStreamIndexChanged(streamIndex, channel); + } + ); } DSPDeviceMIMOEngine *deviceMIMOEngine = getDeviceAPI()->getDeviceMIMOEngine(); @@ -1203,6 +1225,13 @@ void FreqScanner::handleChannelAdded(int deviceSetIndex, ChannelAPI* channel) channel->getStreamIndex() }; m_availableChannels[channel] = availableChannel; + QObject::connect( + channel, + &ChannelAPI::streamIndexChanged, + [=](int streamIndex){ + this->handleChannelStreamIndexChanged(streamIndex, channel); + } + ); } notifyUpdateChannels(); @@ -1226,6 +1255,28 @@ void FreqScanner::handleChannelRemoved(int deviceSetIndex, ChannelAPI* channel) notifyUpdateChannels(); } +void FreqScanner::handleChannelStreamIndexChanged(int streamIndex, ChannelAPI* channel) +{ + qDebug("FreqScanner::handleChannelStreamIndexChanged: channel: %s (%p) stream: %d", + qPrintable(channel->getURI()), channel, streamIndex); + if (streamIndex != m_settings.m_streamIndex) // channel has moved to another I/Q stream + { + m_availableChannels.remove(channel); + notifyUpdateChannels(); + } + else if (!m_availableChannels.contains(channel)) // if channel has been tracked before put back it in the list + { + FreqScannerSettings::AvailableChannel availableChannel = + FreqScannerSettings::AvailableChannel{ + getDeviceSetIndex(), + channel->getIndexInDeviceSet(), + channel->getStreamIndex() + }; + m_availableChannels[channel] = availableChannel; + notifyUpdateChannels(); + } +} + void FreqScanner::notifyUpdateChannels() { if (getMessageQueueToGUI()) diff --git a/plugins/channelrx/freqscanner/freqscanner.h b/plugins/channelrx/freqscanner/freqscanner.h index e56262e2d2..09a52c9460 100644 --- a/plugins/channelrx/freqscanner/freqscanner.h +++ b/plugins/channelrx/freqscanner/freqscanner.h @@ -418,6 +418,7 @@ private slots: void handleIndexInDeviceSetChanged(int index); void handleChannelAdded(int deviceSetIndex, ChannelAPI* channel); void handleChannelRemoved(int deviceSetIndex, ChannelAPI* channel); + void handleChannelStreamIndexChanged(int streamIndex, ChannelAPI* channel); void timeout(); }; diff --git a/plugins/channelrx/freqtracker/freqtracker.cpp b/plugins/channelrx/freqtracker/freqtracker.cpp index 10d3f5d5d4..aa052663b2 100644 --- a/plugins/channelrx/freqtracker/freqtracker.cpp +++ b/plugins/channelrx/freqtracker/freqtracker.cpp @@ -309,6 +309,8 @@ void FreqTracker::applySettings(const FreqTrackerSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/heatmap/heatmap.cpp b/plugins/channelrx/heatmap/heatmap.cpp index 0d422b6ced..83222bfa08 100644 --- a/plugins/channelrx/heatmap/heatmap.cpp +++ b/plugins/channelrx/heatmap/heatmap.cpp @@ -219,6 +219,8 @@ void HeatMap::applySettings(const HeatMapSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/localsink/localsink.cpp b/plugins/channelrx/localsink/localsink.cpp index a04640189b..ac7abd56a1 100644 --- a/plugins/channelrx/localsink/localsink.cpp +++ b/plugins/channelrx/localsink/localsink.cpp @@ -366,6 +366,8 @@ void LocalSink::applySettings(const LocalSinkSettings& settings, const QListremoveChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } } diff --git a/plugins/channelrx/noisefigure/noisefigure.cpp b/plugins/channelrx/noisefigure/noisefigure.cpp index 5348bb93f8..8593c7b8db 100644 --- a/plugins/channelrx/noisefigure/noisefigure.cpp +++ b/plugins/channelrx/noisefigure/noisefigure.cpp @@ -563,6 +563,8 @@ void NoiseFigure::applySettings(const NoiseFigureSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/radioastronomy/radioastronomy.cpp b/plugins/channelrx/radioastronomy/radioastronomy.cpp index bee6a22495..baa76f478b 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomy.cpp @@ -784,6 +784,8 @@ void RadioAstronomy::applySettings(const RadioAstronomySettings& settings, bool m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/radioclock/radioclock.cpp b/plugins/channelrx/radioclock/radioclock.cpp index 6e30768f31..aa42cde5f5 100644 --- a/plugins/channelrx/radioclock/radioclock.cpp +++ b/plugins/channelrx/radioclock/radioclock.cpp @@ -256,6 +256,8 @@ void RadioClock::applySettings(const RadioClockSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/remotesink/remotesink.cpp b/plugins/channelrx/remotesink/remotesink.cpp index 20bf1633f0..5538ba4dd9 100644 --- a/plugins/channelrx/remotesink/remotesink.cpp +++ b/plugins/channelrx/remotesink/remotesink.cpp @@ -294,6 +294,8 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/remotetcpsink/remotetcpsink.cpp b/plugins/channelrx/remotetcpsink/remotetcpsink.cpp index 923b44677e..53d32100e6 100644 --- a/plugins/channelrx/remotetcpsink/remotetcpsink.cpp +++ b/plugins/channelrx/remotetcpsink/remotetcpsink.cpp @@ -234,6 +234,8 @@ void RemoteTCPSink::applySettings(const RemoteTCPSinkSettings& settings, const Q m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } } diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp index a30e02e389..b3e4a8d0ea 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp @@ -371,6 +371,8 @@ void SigMFFileSink::applySettings(const SigMFFileSinkSettings& settings, bool fo m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channelrx/udpsink/udpsink.cpp b/plugins/channelrx/udpsink/udpsink.cpp index bc0d96dfc4..7495d18121 100644 --- a/plugins/channelrx/udpsink/udpsink.cpp +++ b/plugins/channelrx/udpsink/udpsink.cpp @@ -269,6 +269,8 @@ void UDPSink::applySettings(const UDPSinkSettings& settings, bool force) m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSink(this, settings.m_streamIndex); m_deviceAPI->addChannelSinkAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/filesource/filesource.cpp b/plugins/channeltx/filesource/filesource.cpp index 088eec50eb..2b08956d4b 100644 --- a/plugins/channeltx/filesource/filesource.cpp +++ b/plugins/channeltx/filesource/filesource.cpp @@ -268,6 +268,8 @@ void FileSource::applySettings(const FileSourceSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/localsource/localsource.cpp b/plugins/channeltx/localsource/localsource.cpp index c6940a61e9..a91248740f 100644 --- a/plugins/channeltx/localsource/localsource.cpp +++ b/plugins/channeltx/localsource/localsource.cpp @@ -311,6 +311,8 @@ void LocalSource::applySettings(const LocalSourceSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp index c0de0f38c9..3e419081f8 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp @@ -378,6 +378,8 @@ void IEEE_802_15_4_Mod::applySettings(const IEEE_802_15_4_ModSettings& settings, m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modais/aismod.cpp b/plugins/channeltx/modais/aismod.cpp index 7545d55d76..294914dbb1 100644 --- a/plugins/channeltx/modais/aismod.cpp +++ b/plugins/channeltx/modais/aismod.cpp @@ -464,6 +464,8 @@ void AISMod::applySettings(const AISModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index 9bb0060b10..a3bb9f9f23 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -333,6 +333,8 @@ void AMMod::applySettings(const AMModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 0abc135d1b..4228e63bb2 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -347,6 +347,8 @@ void ATVMod::applySettings(const ATVModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.cpp b/plugins/channeltx/modchirpchat/chirpchatmod.cpp index 6315542fd5..bf18f2871c 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmod.cpp @@ -399,6 +399,8 @@ void ChirpChatMod::applySettings(const ChirpChatModSettings& settings, bool forc m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/moddatv/datvmod.cpp b/plugins/channeltx/moddatv/datvmod.cpp index 196ecd85c3..a5730b1976 100644 --- a/plugins/channeltx/moddatv/datvmod.cpp +++ b/plugins/channeltx/moddatv/datvmod.cpp @@ -312,6 +312,8 @@ void DATVMod::applySettings(const DATVModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modfreedv/freedvmod.cpp b/plugins/channeltx/modfreedv/freedvmod.cpp index 2fe797d5c2..069a760aaf 100644 --- a/plugins/channeltx/modfreedv/freedvmod.cpp +++ b/plugins/channeltx/modfreedv/freedvmod.cpp @@ -318,6 +318,8 @@ void FreeDVMod::applySettings(const FreeDVModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modm17/m17mod.cpp b/plugins/channeltx/modm17/m17mod.cpp index b7c4d8a526..730a93b8ff 100644 --- a/plugins/channeltx/modm17/m17mod.cpp +++ b/plugins/channeltx/modm17/m17mod.cpp @@ -335,6 +335,8 @@ void M17Mod::applySettings(const M17ModSettings& settings, const QList& m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } } diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index fe5be17cae..2f55522e63 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -381,6 +381,8 @@ void NFMMod::applySettings(const NFMModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modpacket/packetmod.cpp b/plugins/channeltx/modpacket/packetmod.cpp index 8b1cb967d8..a302ec36d8 100644 --- a/plugins/channeltx/modpacket/packetmod.cpp +++ b/plugins/channeltx/modpacket/packetmod.cpp @@ -414,6 +414,8 @@ void PacketMod::applySettings(const PacketModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modpsk31/psk31mod.cpp b/plugins/channeltx/modpsk31/psk31mod.cpp index e81de94845..9bed9c3c48 100644 --- a/plugins/channeltx/modpsk31/psk31mod.cpp +++ b/plugins/channeltx/modpsk31/psk31mod.cpp @@ -305,6 +305,8 @@ void PSK31::applySettings(const PSK31Settings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modrtty/rttymod.cpp b/plugins/channeltx/modrtty/rttymod.cpp index 8520ce3457..cfd190d8c3 100644 --- a/plugins/channeltx/modrtty/rttymod.cpp +++ b/plugins/channeltx/modrtty/rttymod.cpp @@ -330,6 +330,8 @@ void RttyMod::applySettings(const RttyModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index 7dba7fe2f7..2c31a12c8d 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -345,6 +345,8 @@ void SSBMod::applySettings(const SSBModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index 863c2b500d..ddae066b03 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -319,6 +319,8 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/remotesource/remotesource.cpp b/plugins/channeltx/remotesource/remotesource.cpp index e457dcc6f2..a4bc9fec2a 100644 --- a/plugins/channeltx/remotesource/remotesource.cpp +++ b/plugins/channeltx/remotesource/remotesource.cpp @@ -247,6 +247,8 @@ void RemoteSource::applySettings(const RemoteSourceSettings& settings, bool forc m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/plugins/channeltx/udpsource/udpsource.cpp b/plugins/channeltx/udpsource/udpsource.cpp index b4116ae46e..263b107a6c 100644 --- a/plugins/channeltx/udpsource/udpsource.cpp +++ b/plugins/channeltx/udpsource/udpsource.cpp @@ -281,6 +281,8 @@ void UDPSource::applySettings(const UDPSourceSettings& settings, bool force) m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex); m_deviceAPI->addChannelSource(this, settings.m_streamIndex); m_deviceAPI->addChannelSourceAPI(this); + m_settings.m_streamIndex = settings.m_streamIndex; // make sure ChannelAPI::getStreamIndex() is consistent + emit streamIndexChanged(settings.m_streamIndex); } reverseAPIKeys.append("streamIndex"); diff --git a/sdrbase/channel/channelapi.h b/sdrbase/channel/channelapi.h index c9301c433b..10c7a940cb 100644 --- a/sdrbase/channel/channelapi.h +++ b/sdrbase/channel/channelapi.h @@ -188,6 +188,7 @@ protected slots: signals: void indexInDeviceSetChanged(int index); + void streamIndexChanged(int index); };