Hey All,
I'm looking to improve a program's design with regards to how it communicates between the "jack" thread and its "main/gui" thread. Please note I'm *not* looking for implementation details like what ringbuffer to use, this has been discussed here before.
Conditions:
Gui needs to feed data trough to the jack thread (data = parameter moves etc)
Jack thread needs to push data (buffers for waveforms & "playhead" info)
The real question:
What is a neat solution to passing various data trough a ringbuffer?
My (hacky?) solution: Create a class, call it "Event". Runtime now looks like so:
1. Create a EventType enum, set the details
2. Write those "Events" into the ringbuffer
3. Switch based on EventType, and handle the event.
While not terribly ugly, that Event class starts to get bigger & nastier, so I concidered sub-classing it... but I'm not sure this is going in the right direction.
I'm very intrested how the "big" programs around have approached this problem... Cheers, -Harry