PaulStoffregen / Audio

Teensy Audio Library
http://www.pjrc.com/teensy/td_libs_Audio.html
1.07k stars 398 forks source link

Fix issue with importing edited AudioEffectDelayExternal to GUI #452

Closed h4yn0nnym0u5e closed 1 year ago

h4yn0nnym0u5e commented 1 year ago

If an AudioEffectDelayExternal object's definition has been edited to specify the hardware type and delay, the re-import code fails. Consider:

AudioEffectDelayExternal delayExt(AUDIO_MEMORY_PSRAM64,1400.0f); //xy=322,396

The old import code splits the definition at the comma, and attempts to create two objects with insane names.

The new code finds and discards the constructor parameters (currently, anything in matching brackets), with anything left being considered a name. It should thus work for a hand-built definition such as:

AudioEffectDelayExternal delayExtL(AUDIO_MEMORY_PSRAM64,1400.0f),delayExtR(AUDIO_MEMORY_PSRAM64,1400.0f);