Hey All,<br><br>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.<br>
<br>Conditions:<br>Gui needs to feed data trough to the jack thread (data = parameter moves etc)<br>
Jack thread needs to push data (buffers for waveforms & "playhead" info)<br><br>The real question:<br>What is a neat solution to passing various data trough a ringbuffer?<br><br>My (hacky?) solution: Create a class, call it "Event". Runtime now looks like so:<br>
1. Create a EventType enum, set the details<br>2. Write those "Events" into the ringbuffer<br>3. Switch based on EventType, and handle the event.<br><br>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.<br>
<br>I'm very intrested how the "big" programs around have approached this problem... Cheers, -Harry<br>