Switch spectran http source module to use the remoteconfig endpoint as per #1354

This commit is contained in:
AlexandreRouma
2024-04-04 19:25:02 +02:00
parent 065a5b4c40
commit 12f7efed32
2 changed files with 24 additions and 8 deletions

View File

@@ -144,9 +144,7 @@ private:
_this->tryConnect();
}
else if (connected && SmGui::Button("Disconnect##spectran_http_source")) {
_this->client->onCenterFrequencyChanged.unbind(_this->onFreqChangedId);
_this->client->onCenterFrequencyChanged.unbind(_this->onSamplerateChangedId);
_this->client->close();
_this->disconnect();
}
if (_this->running) { style::endDisabled(); }
@@ -173,6 +171,12 @@ private:
}
}
void disconnect() {
client->onCenterFrequencyChanged.unbind(onFreqChangedId);
client->onSamplerateChanged.unbind(onSamplerateChangedId);
client->close();
}
void onFreqChanged(double newFreq) {
if (lastReportedFreq == newFreq) { return; }
lastReportedFreq = newFreq;