validator (PresetFile) calls IEditController::getState with stream at end

SDK for VST 3 audio plug-in and host development.
Post Reply
obiwanjacobi
Posts: 4
Joined: Wed Jun 22, 2016 7:41 am

validator (PresetFile) calls IEditController::getState with stream at end

Post by obiwanjacobi »

I run into problems during the 'bypasspersistence' tests in the validator.exe.

It uses PresetFile::savePreset() to save the parameters.
I have verified that my state is save correctly (memory debugger) during setState().

Then later uses PresetFile::loadPreset() (vstpresetfile.cpp: 144) to retrieve them again (and test if the bypass parameter has a correct value).
As far as I could track it down the PresetFile::readChunkList() is the call that reads the entire stream - the first call loadPreset makes.
Later, the PresetFile::restoreControllerState() (vstpresetfile.cpp: 544) call creates a ReadOnlyBStream around the stream with correct offset (and length). But it does not reposition the stream to the start of its offset (which would fix the issue). Then calls into the plugin with IEditController::setState() with the stream position at the end - which fails in my plugin.

Bug or am I doing it wrong?

Arne Scheffler
Posts: 353
Joined: Mon Jun 20, 2016 7:53 am

Re: validator (PresetFile) calls IEditController::getState with stream at end

Post by Arne Scheffler »

I just verified this and I think you must do something wrong as the ReadOnlyBStream is created with the absolute offset into the stream and seeks to that position when the read is performed.

Cheers,
Arne

Post Reply