1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Local sink: implemented play toggle REST API

This commit is contained in:
f4exb 2019-12-09 10:35:21 +01:00
parent ef85977682
commit 4399f6b537
2 changed files with 14 additions and 0 deletions

View File

@ -429,6 +429,9 @@ void LocalSink::webapiUpdateChannelSettings(
validateFilterChainHash(settings);
}
if (channelSettingsKeys.contains("play")) {
settings.m_play = response.getLocalSinkSettings()->getPlay() != 0;
}
if (channelSettingsKeys.contains("streamIndex")) {
settings.m_streamIndex = response.getLocalSinkSettings()->getStreamIndex();
}
@ -462,6 +465,7 @@ void LocalSink::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
response.getLocalSinkSettings()->setLog2Decim(settings.m_log2Decim);
response.getLocalSinkSettings()->setFilterChainHash(settings.m_filterChainHash);
response.getLocalSinkSettings()->setPlay(settings.m_play ? 1 : 0);
response.getLocalSinkSettings()->setStreamIndex(settings.m_streamIndex);
response.getLocalSinkSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
@ -503,6 +507,9 @@ void LocalSink::webapiReverseSendSettings(QList<QString>& channelSettingsKeys, c
if (channelSettingsKeys.contains("filterChainHash") || force) {
swgLocalSinkSettings->setFilterChainHash(settings.m_filterChainHash);
}
if (channelSettingsKeys.contains("play") || force) {
swgLocalSinkSettings->setPlay(settings.m_play ? 1 : 0);
}
if (channelSettingsKeys.contains("streamIndex") || force) {
swgLocalSinkSettings->setStreamIndex(settings.m_streamIndex);
}

View File

@ -193,6 +193,13 @@ void LocalSinkGUI::displaySettings()
setWindowTitle(m_channelMarker.getTitle());
blockApplySettings(true);
int index = getLocalDeviceIndexInCombo(m_settings.m_localDeviceIndex);
if (index >= 0) {
ui->localDevice->setCurrentIndex(index);
}
ui->localDevicePlay->setChecked(m_settings.m_play);
ui->decimationFactor->setCurrentIndex(m_settings.m_log2Decim);
applyDecimation();
displayStreamIndex();