Local sink: implemented play toggle REST API

pull/480/head
f4exb 2019-12-09 10:35:21 +01:00
rodzic ef85977682
commit 4399f6b537
2 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -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);
}

Wyświetl plik

@ -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();