1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-17 08:14:07 -04:00

Add frequency scanner channel plugin

This commit is contained in:
srcejon
2023-09-28 16:45:35 +01:00
parent 88aded6e04
commit 37521224c3
30 changed files with 5395 additions and 17 deletions
+41
View File
@@ -937,6 +937,47 @@ bool ChannelWebAPIUtils::setFrequencyOffset(unsigned int deviceIndex, int channe
return false;
}
bool ChannelWebAPIUtils::setAudioMute(unsigned int deviceIndex, int channelIndex, bool mute)
{
SWGSDRangel::SWGChannelSettings channelSettingsResponse;
QString errorResponse;
int httpRC;
QJsonObject* jsonObj;
ChannelAPI* channel = MainCore::instance()->getChannel(deviceIndex, channelIndex);
if (channel != nullptr)
{
httpRC = channel->webapiSettingsGet(channelSettingsResponse, errorResponse);
if (httpRC / 100 != 2)
{
qWarning("ChannelWebAPIUtils::setAudioMute: get channel settings error %d: %s",
httpRC, qPrintable(errorResponse));
return false;
}
jsonObj = channelSettingsResponse.asJsonObject();
if (WebAPIUtils::setSubObjectInt(*jsonObj, "audioMute", (int)mute))
{
QStringList keys;
keys.append("audioMute");
channelSettingsResponse.init();
channelSettingsResponse.fromJsonObject(*jsonObj);
httpRC = channel->webapiSettingsPutPatch(false, keys, channelSettingsResponse, errorResponse);
if (httpRC / 100 != 2)
{
qWarning("ChannelWebAPIUtils::setAudioMute: patch channel settings error %d: %s",
httpRC, qPrintable(errorResponse));
return false;
}
return true;
}
}
return false;
}
// Start or stop all file sinks in a given device set
bool ChannelWebAPIUtils::startStopFileSinks(unsigned int deviceIndex, bool start)
{