1
0

Better method names

This commit is contained in:
Geraint 2025-06-25 18:47:24 +01:00
parent 16dc595aa6
commit 105e00a1ef
2 changed files with 16 additions and 9 deletions

View File

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

View File

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