1
0

Only send parameter update messages to the UI if they actually change

This commit is contained in:
Geraint 2025-06-26 16:32:43 +01:00
parent 51700553b0
commit bb14d84a3f

View File

@ -148,8 +148,9 @@ struct WebUIHelper {
ParamContext context;
ParamRange & operator=(double v) {
bool changed = (v != *this);
SuperRange::operator=(v);
sendUpdateMessage();
if (changed) sendUpdateMessage();
return *this;
}
@ -224,8 +225,9 @@ struct WebUIHelper {
ParamContext context;
ParamStepped & operator=(int v) {
SuperStepped::operator=(v);
sendUpdateMessage();
bool changed = (v != *this);
SuperRange::operator=(v);
if (changed) sendUpdateMessage();
return *this;
}
@ -296,6 +298,7 @@ struct WebUIHelper {
std::function<void(ParamContext, bool)> paramListenerGesture;
std::function<void(ParamContext, int)> paramListenerStepped;
// This state includes all the parameters
void saveState(std::vector<unsigned char> &bytes) {
stfx::storage::STFXStorageWriter<> storage(bytes);
this->state(storage);