Device API: removed useless stream index parameter on channel API methods

This commit is contained in:
f4exb 2019-12-23 23:41:35 +01:00
parent a0830f8ba2
commit 6855602a7f
23 changed files with 52 additions and 58 deletions

View File

@ -193,10 +193,10 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -188,10 +188,10 @@ void BFMDemod::applySettings(const BFMDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -228,10 +228,10 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -182,10 +182,10 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -211,10 +211,10 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -211,10 +211,10 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -189,10 +189,10 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -234,10 +234,10 @@ void FreqTracker::applySettings(const FreqTrackerSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -280,10 +280,10 @@ void LocalSink::applySettings(const LocalSinkSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -214,10 +214,10 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -212,10 +212,10 @@ void UDPSink::applySettings(const UDPSinkSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSinkAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSink(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSinkAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -234,10 +234,10 @@ void FileSource::applySettings(const FileSourceSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -283,10 +283,10 @@ void LocalSource::applySettings(const LocalSourceSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -278,10 +278,10 @@ void AMMod::applySettings(const AMModSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -298,10 +298,10 @@ void ATVMod::applySettings(const ATVModSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -264,10 +264,10 @@ void FreeDVMod::applySettings(const FreeDVModSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -324,10 +324,10 @@ void NFMMod::applySettings(const NFMModSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -281,10 +281,10 @@ void SSBMod::applySettings(const SSBModSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -264,10 +264,10 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -180,10 +180,10 @@ void RemoteSource::applySettings(const RemoteSourceSettings& settings, bool forc
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -224,10 +224,10 @@ void UDPSource::applySettings(const UDPSourceSettings& settings, bool force)
{
if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only
{
m_deviceAPI->removeChannelSourceAPI(this, m_settings.m_streamIndex);
m_deviceAPI->removeChannelSourceAPI(this);
m_deviceAPI->removeChannelSource(this, m_settings.m_streamIndex);
m_deviceAPI->addChannelSource(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this, settings.m_streamIndex);
m_deviceAPI->addChannelSourceAPI(this);
}
reverseAPIKeys.append("streamIndex");

View File

@ -137,17 +137,14 @@ void DeviceAPI::removeMIMOChannel(MIMOChannel* channel)
}
}
void DeviceAPI::addChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex)
void DeviceAPI::addChannelSinkAPI(ChannelAPI* channelAPI)
{
(void) streamIndex;
m_channelSinkAPIs.append(channelAPI);
renumerateChannels();
}
void DeviceAPI::removeChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex)
void DeviceAPI::removeChannelSinkAPI(ChannelAPI* channelAPI)
{
(void) streamIndex;
if (m_channelSinkAPIs.removeOne(channelAPI)) {
renumerateChannels();
}
@ -155,17 +152,14 @@ void DeviceAPI::removeChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex)
channelAPI->setIndexInDeviceSet(-1);
}
void DeviceAPI::addChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex)
void DeviceAPI::addChannelSourceAPI(ChannelAPI* channelAPI)
{
(void) streamIndex;
m_channelSourceAPIs.append(channelAPI);
renumerateChannels();
}
void DeviceAPI::removeChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex)
void DeviceAPI::removeChannelSourceAPI(ChannelAPI* channelAPI)
{
(void) streamIndex;
if (m_channelSourceAPIs.removeOne(channelAPI)) {
renumerateChannels();
}

View File

@ -77,10 +77,10 @@ public:
void addMIMOChannel(MIMOChannel* channel); //!< Add a MIMO channel (n Rx and m Tx combination)
void removeMIMOChannel(MIMOChannel* channe); //!< Remove a MIMO channel (n Rx and m Tx combination)
void addChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void removeChannelSinkAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void addChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void removeChannelSourceAPI(ChannelAPI* channelAPI, int streamIndex = 0);
void addChannelSinkAPI(ChannelAPI* channelAPI);
void removeChannelSinkAPI(ChannelAPI* channelAPI);
void addChannelSourceAPI(ChannelAPI* channelAPI);
void removeChannelSourceAPI(ChannelAPI* channelAPI);
void addMIMOChannelAPI(ChannelAPI* channelAPI);
void removeMIMOChannelAPI(ChannelAPI* channelAPI);