If the processing of an audio buffer in getNextAudioBlock depends on the value of a GUI object, what's the safest way to access that value?
In the second "audio basics" tutorial, the value of a slider is read directly from the slider object by getNextAudioBlock. Although it doesn't state why this is not good practice, I presume it's because the slider value is updated in the context of another thread, and that reading it in the context of an audio thread may return an incorrect value.
Is it true to say that the only safe way to access the value of a GUI object from an audio thread is to use a critical section or some other OS resource?
Thanks.
