Only send parameter update messages to the UI if they actually change
This commit is contained in:
parent
51700553b0
commit
bb14d84a3f
@ -148,8 +148,9 @@ struct WebUIHelper {
|
|||||||
ParamContext context;
|
ParamContext context;
|
||||||
|
|
||||||
ParamRange & operator=(double v) {
|
ParamRange & operator=(double v) {
|
||||||
|
bool changed = (v != *this);
|
||||||
SuperRange::operator=(v);
|
SuperRange::operator=(v);
|
||||||
sendUpdateMessage();
|
if (changed) sendUpdateMessage();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,8 +225,9 @@ struct WebUIHelper {
|
|||||||
ParamContext context;
|
ParamContext context;
|
||||||
|
|
||||||
ParamStepped & operator=(int v) {
|
ParamStepped & operator=(int v) {
|
||||||
SuperStepped::operator=(v);
|
bool changed = (v != *this);
|
||||||
sendUpdateMessage();
|
SuperRange::operator=(v);
|
||||||
|
if (changed) sendUpdateMessage();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,6 +298,7 @@ struct WebUIHelper {
|
|||||||
std::function<void(ParamContext, bool)> paramListenerGesture;
|
std::function<void(ParamContext, bool)> paramListenerGesture;
|
||||||
std::function<void(ParamContext, int)> paramListenerStepped;
|
std::function<void(ParamContext, int)> paramListenerStepped;
|
||||||
|
|
||||||
|
// This state includes all the parameters
|
||||||
void saveState(std::vector<unsigned char> &bytes) {
|
void saveState(std::vector<unsigned char> &bytes) {
|
||||||
stfx::storage::STFXStorageWriter<> storage(bytes);
|
stfx::storage::STFXStorageWriter<> storage(bytes);
|
||||||
this->state(storage);
|
this->state(storage);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user