olofson / audiality2

A realtime scripted modular audio engine for video games and musical applications.
http://audiality.org/
zlib License
79 stars 5 forks source link

Improved message/event timestamping #279

Closed olofson closed 7 years ago

olofson commented 7 years ago

The current control API implementation just wraps A2_event structs up as messages and passes those via sfifos, with timestamps and all. Since, even after #204, there will only be one API-to-engine sfifo per A2 state (as the API is still not fully threadsafe anyway), we need to timestamp all messages at all times, using a2_TimestampReset() for contexts with timestamping "disabled."

One approach would be to remove the timestamps from the existing messages, and instead use separate timestamping messages. Interfaces may keep track of the last timestamp message sent to their target engine state, in order to send timestamp messages only when necessary. There would be a special message to disable timestamping altogether, causing subsequent messages to be scheduled ASAP when they arrive, meaning no delays, and no risk of "late event" warnings when timestamping is not actually used.

olofson commented 7 years ago

Or, we can just do this: 0ee5030fa548d9d3df23cf733043328e989effed. Serves the same purpose, but seems simpler and more efficient. I think this will do.