TAAE2: Pesky Questions Thread
For purposes of clarifying design objectives, I decided to open a thread to allow annoying questions regarding the current structure. The answers should hopefully help with a better understanding of how to use and implement the new version.
The first thing that boggles me currently:
1. why is a module initialized with a renderer? What is the purpose of the renderer?
I mean from a design perspective. The purpose of objects is to encapsulate and control data by datahiding. How are the module and the renderer related? Does a module control the renderer? Why can a renderer be changed after initialization? Is that ever relevant?
Note that a lot of thought seems to have gone into providing relatively threadsafe parameterchanges, but changing the renderer while observing sampleRate/channelCount changes is a potential pitfall: when the renderer is updated, the sampleRate/channelCount needs to be reset potentially, and threadwise it may generate an observerupdate for the new renderer, while the audiothread is still working with the old renderer etc...
In that regard i found that observing those changes from the system trails behind the actual update, i.e. the renderer may already have been forced to process a different sampleRate on the audioThread, while the management logic still needs to be notified. Perhaps there should be different logic in the audio-thread that continuously checks for these basic parameters before letting a module process a buffer.