storeItemInCache SOULPatchHost

hello everybody, I am sure this is my lack of knowledge in cached object code chunks but I can’t figure out which kind of sourceData I have to pass to:

soul::patch::CompilerCacheFolder.storeItemInCache (const char* key, const void* sourceData, uint64_t size)

I am developing a SOULPatch host with Juce that autoload a .soulpatch file when it starts, I am guessing I need a compilerCache for my SOULPatchAudioPluginFormat constructor to speed up the process. right?

thanks for the help.
d

Hello, you’ve probably figured this out by this point, but just in case someone else stumbles upon this.

When you create new PatchPlayer from a PatchInstance, you can pass in your implemetation of CompilerCache to PatchInstance->compileNewPlayer() function. Before compiling code again it’s going to ask your CompilerCacheFoler if it has an already compiled patch using that key.

That being said, if you’re using the JUCE helper_classes, it should handle it on it’s own.

But, as far as I understand, the basic idea is that when PatchInstance->compileNewPlayer() is called, it looks for precompiled cache, if your implementation of CompilerCache can’t provide one, it’s going to compile patch from scratch and tell your implementation of CompilerCache to store it by a given key. It’s your responsibility to manage keycache files registry.

sourceData is the data that you need to store in a file or in memory, it’s provided by the compiler, not really something you have to pass in. In fact, I don’t believe you should be manually calling storeItemInCache() function.

1 Like

thanks Jay, I hadn’t figured it out yet so your answer is really helpful, I found a turnaround using the JUCE helper_classes.

I’m glad you found it helpful.

It seems like there’re 3 people at most actively using SOUL, I try to document most of my findings, especially things I wish I had found in documentation :expressionless:

I will also keep track of everything I find out, actually I am working on how to receive OSC messages inside the SOULPatchHostDemo. I will keep you updated! have fun with SOUL

1 Like