From ef859776827d4a756208c120249adfc168fd1cae Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 9 Dec 2019 10:32:09 +0100 Subject: [PATCH] Local source: implemented play toggle REST API --- plugins/channeltx/localsource/localsource.cpp | 7 +++++++ plugins/channeltx/localsource/localsourcegui.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/plugins/channeltx/localsource/localsource.cpp b/plugins/channeltx/localsource/localsource.cpp index 229b20ec9..e55d77b87 100644 --- a/plugins/channeltx/localsource/localsource.cpp +++ b/plugins/channeltx/localsource/localsource.cpp @@ -386,6 +386,9 @@ void LocalSource::webapiUpdateChannelSettings( validateFilterChainHash(settings); } + if (channelSettingsKeys.contains("play")) { + settings.m_play = response.getLocalSourceSettings()->getPlay() != 0; + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getLocalSourceSettings()->getUseReverseApi() != 0; } @@ -419,6 +422,7 @@ void LocalSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r response.getLocalSourceSettings()->setLog2Interp(settings.m_log2Interp); response.getLocalSourceSettings()->setFilterChainHash(settings.m_filterChainHash); + response.getLocalSourceSettings()->setPlay(settings.m_play ? 1 : 0); response.getLocalSourceSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); if (response.getLocalSourceSettings()->getReverseApiAddress()) { @@ -459,6 +463,9 @@ void LocalSource::webapiReverseSendSettings(QList& channelSettingsKeys, if (channelSettingsKeys.contains("filterChainHash") || force) { swgLocalSourceSettings->setFilterChainHash(settings.m_filterChainHash); } + if (channelSettingsKeys.contains("play") || force) { + swgLocalSourceSettings->setPlay(settings.m_play ? 1 : 0); + } if (channelSettingsKeys.contains("streamIndex") || force) { swgLocalSourceSettings->setRgbColor(settings.m_streamIndex); } diff --git a/plugins/channeltx/localsource/localsourcegui.cpp b/plugins/channeltx/localsource/localsourcegui.cpp index 32770e9fc..aaf1f18ac 100644 --- a/plugins/channeltx/localsource/localsourcegui.cpp +++ b/plugins/channeltx/localsource/localsourcegui.cpp @@ -184,6 +184,7 @@ void LocalSourceGUI::displaySettings() blockApplySettings(true); ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp); + ui->localDevicePlay->setChecked(m_settings.m_play); applyInterpolation(); blockApplySettings(false); }