Better method names
This commit is contained in:
parent
16dc595aa6
commit
105e00a1ef
@ -616,6 +616,8 @@ struct Plugin : public clap_plugin {
|
||||
if (!fillFromStream(stream, buffer)) return false;
|
||||
StateReader storage{buffer};
|
||||
plugin.effect.state(storage);
|
||||
|
||||
plugin.effect.markStateDirty();
|
||||
plugin.sendWebMessages(); // should already be on the main thread
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -304,10 +304,7 @@ struct WebUIHelper {
|
||||
|
||||
if (cbor.isUtf8()) {
|
||||
if (cbor.utf8View() == "ready") {
|
||||
if (auto *m = getEmptyMessage()) {
|
||||
resetQueue.test_and_set();
|
||||
m->markReady();
|
||||
} // if this fails we're doing a reset anyway, so no worrie
|
||||
requestEntireState();
|
||||
return;
|
||||
}
|
||||
} else if (cbor.isMap()) {
|
||||
@ -319,11 +316,12 @@ struct WebUIHelper {
|
||||
|
||||
void maybeChanged() override {
|
||||
std::cout << "web effect maybe changed\n";
|
||||
// Resend entire state again
|
||||
if (auto *m = getEmptyMessage()) {
|
||||
resetQueue.test_and_set();
|
||||
m->markReady();
|
||||
}
|
||||
// TODO: something better
|
||||
requestEntireState();
|
||||
}
|
||||
|
||||
void markStateDirty() {
|
||||
requestEntireState();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -346,6 +344,13 @@ struct WebUIHelper {
|
||||
message.bytes.resize(0);
|
||||
return &message;
|
||||
}
|
||||
|
||||
void requestEntireState() {
|
||||
if (auto *m = getEmptyMessage()) {
|
||||
resetQueue.test_and_set();
|
||||
m->markReady();
|
||||
} // if this fails, then the queue is full and we're doing a reset anyway
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user