ffAudio / ff_meters

Plug and play component to display LED meters for JUCE audio buffers
BSD 3-Clause "New" or "Revised" License
113 stars 31 forks source link

Exception on start in JUCE plugin host when previously saving the filtergraph with plugin open #11

Closed cornzz closed 2 years ago

cornzz commented 4 years ago

The title might be a bit misleading because this only happens if one does not resize() the level meter sources in prepareToPlay(), however I thought it might be good to add this to the readme.

To reproduce, open a plugin with level meters in the juce plugin host, save the filter graph (ctrl+s) while the plugin is open, then restart the plugin host.

The exception is an out of range exception which occurs in LevelMeterSources.h in getMaxLevel():

float getMaxLevel (const int channel) const
{
    return levels.at (size_t (channel)).max;
}

The obvious fix is to call resize() on the level meter sources before processing audio. I didn't do that because I followed the tutorial and it wasn't done there.

ffAudio commented 4 years ago

Thanks for the heads up, I will update the readme/tutorial.

ffAudio commented 2 years ago

Thanks for the report. The resize in measureBlock() is gone, so there is no possibility for a race condition any more.