Hi
Which approach is better to respond to a message from for example Processor to Controller?
tresult PLUGIN_API PlugProcessor::notify(Vst::IMessage* message) {
const void* binaryData = nullptr;
uint32 messageSize = 0;
if (strcmp(message->getMessageID(), "MESSAGE") == 0) {
if (message->getAttributes()->getBinary("MESSAGE", binaryData, messageSize) == kResultOk) {
sendBackMessage(...) //<----- Respond here
return kResultTrue;
}
}
}
or
tresult PLUGIN_API PlugProcessor::notify(Vst::IMessage* message) {
const void* binaryData = nullptr;
uint32 messageSize = 0;
if (strcmp(message->getMessageID(), "MESSAGE") == 0) {
if (message->getAttributes()->getBinary("MESSAGE", binaryData, messageSize) == kResultOk) {
setTimer(...); //<---- set timer here
return kResultTrue;
}
}
}
tresult PLUGIN_API PlugProcessor::onTimer(...) { //<----- answer in timer callback
sendBackMessage(...);
}