Whenever Dirt needs to load up a new sample from disk, it now creates a thread for reading and loading sound data into cache. Meanwhile the main thread continues playing, solving the problem with large sample files blocking the main execution thread. To keep it simple, there can only be one thread for file reading (no queue), and to enforce that, there is a boolean variable (and its corresponding mutex) that determines if there is actually one running.
* free sndfile after reading it * free sample data array when fixing rate * free list of output ports before reusing variable (only if INPUT is defined)
Default value is 2. This removes CHANNELS macro definition. Some statically defined arrays now are defined dynamically based on the number of channels specified. * output_ports: Initialized by jack_init(), freed by jack_shutdown(). * delays: Initialied by audio_init(), freed by audio_close(), which is called by atexit() on program exit. * sound.vcf, sound.formant_history: Initialized by new_sound(), freed also by new_sound() just before replacing old sound in `sounds' array, and by audio_close().
…t reset values of those that do