Ok, this is a bit tricky. I have a wusikprst file, which is actually what I use to read and use as a setChunk for a VST. So, all I need to do is read it to memory and send to a setChunk. But I don’t want to over-do any code. From what I see the setStateInformation() would do the job, as long as I convert the read information into a FXP/FXB format, right? Here’s the code I’m trying to use on Windows, it crashes every time. :oops:
[code] MemoryBlock dest;
MemoryBlock chunk; fileLoad.loadFileAsData(chunk); const int totalLen = sizeof (fxChunkSet) + chunk.getSize() - 8; dest.setSize (totalLen, true); fxChunkSet* const set = (fxChunkSet*) dest.getData(); set->chunkMagic = vst_swap ('CcnK'); set->byteSize = 0; set->fxMagic = vst_swap ('FBCh'); set->version = vst_swap (fxbVersionNum); set->fxID = vst_swap ('Wskk'); set->fxVersion = vst_swap (1); set->numPrograms = vst_swap (512); set->chunkSize = vst_swap (chunk.getSize()); chunk.copyTo (set->chunk, 0, chunk.getSize()); getFilter()->VstInstance->setStateInformation((void*)set,totalLen);[/code]
What I’m missing?
In any event, tomorrow I will try to debug this further and see what I’m doing wrong.