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;
|
if (!fillFromStream(stream, buffer)) return false;
|
||||||
StateReader storage{buffer};
|
StateReader storage{buffer};
|
||||||
plugin.effect.state(storage);
|
plugin.effect.state(storage);
|
||||||
|
|
||||||
|
plugin.effect.markStateDirty();
|
||||||
plugin.sendWebMessages(); // should already be on the main thread
|
plugin.sendWebMessages(); // should already be on the main thread
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -304,10 +304,7 @@ struct WebUIHelper {
|
|||||||
|
|
||||||
if (cbor.isUtf8()) {
|
if (cbor.isUtf8()) {
|
||||||
if (cbor.utf8View() == "ready") {
|
if (cbor.utf8View() == "ready") {
|
||||||
if (auto *m = getEmptyMessage()) {
|
requestEntireState();
|
||||||
resetQueue.test_and_set();
|
|
||||||
m->markReady();
|
|
||||||
} // if this fails we're doing a reset anyway, so no worrie
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (cbor.isMap()) {
|
} else if (cbor.isMap()) {
|
||||||
@ -319,11 +316,12 @@ struct WebUIHelper {
|
|||||||
|
|
||||||
void maybeChanged() override {
|
void maybeChanged() override {
|
||||||
std::cout << "web effect maybe changed\n";
|
std::cout << "web effect maybe changed\n";
|
||||||
// Resend entire state again
|
// TODO: something better
|
||||||
if (auto *m = getEmptyMessage()) {
|
requestEntireState();
|
||||||
resetQueue.test_and_set();
|
|
||||||
m->markReady();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void markStateDirty() {
|
||||||
|
requestEntireState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -346,6 +344,13 @@ struct WebUIHelper {
|
|||||||
message.bytes.resize(0);
|
message.bytes.resize(0);
|
||||||
return &message;
|
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