A few questions regarding presets and disk storage

I’m in the final stretch of programming before I begin to release some bigger projects and have been putting this off for a bit. None of my products have featured presets yet, but newer ones will need to have them included. I’ve already taken a look at IVPresetManagerControl.h and have a pretty good understanding of what they are doing. The only thing I am unsure of is how to define the presets path. On the product installer, I plan to create some sort of folder in the Documents directory that will hold the presets.

For the IVDiskPresetManagerControl constructor, I’m unsure of what to use at const char* presetPath. My path to Documents would be C:\Users\seant\Documents, but no one else will have that path. How do I get the correct path?

I am also beginning to need to store data from the plugin to the local machine (settings, stats, etc). What would be the best way to go about this?

Thanks for any help

You can use the methods in IPlugPaths.h e.g.

On macOS you should use SandboxSafeAppSupportPath() and you probably want to store your presets in ~/Music/YourPluginName/…, since this folder is accessible in the macOS sandbox

NOTE: this function will be changing name soon

Thanks, will take a look

What would be the best function to save / load presets? I see SavePresetAsFXP and LoadPresetFromFXP - but it states that they’re for VST2. Would it create any issues saving on VST3 / AU formats?

Edit: Also, how do I find the folder of a selected preset from a popup? How would I go about creating the file name string for loading a preset?

Discovered mFiles, edit problem solved

But how would one go about creating an init preset button?

I wouldn’t recommend using these anymore since VST2 is a dead format. I guess you don’t support VST format anyway?

Initial preset can be done in a variety of ways. If you didn’t serialize any data, and your plugin state only consists of parameters (the default), try this

Thanks!
Where would I put a license file? The user enters in a serial code and the plugin creates a license file based on an API call, and the file is placed in Documents/SNFK.

The issue I’m having is that the AU paths do not match the VST3 paths, so the plugin can’t find the license file and then does not work. Where should I store the license file on Mac? I need to make sure that both plugin formats can access it.

~/Music/YourPlugin/License.txt etc should work

For the VST3, I get /Users/(myusername)/
For the AU2, I get /Users/(myusername)/Library/Containers/com.apple.garageband10/Data

I’m using SandboxSafeAppSupportPath to get these paths. How can I get the path you mentioned? Thanks

Pull master

1 Like

I’m getting /Users/(myusername)/Library/Containers/com.apple.garageband10/Data/Music from SharedMusicPath on AU2. Is there a compile setting that takes me out of the sandbox, or is there something else?

It is being caused by App Sandbox, but the AU2 scheme doesn’t have capabilities available…

It actually seems to be an issue with getting the paths, I’m not sure if I pulled the master correctly lol.

Still returned /Users/(myusername)/Library/Containers/com.apple.garageband10/Data/Music

OK. I think you need to great an “app group” ID and store your license file using the path returned by “AppGroupContainerPath()” if you want users to be able to register it inside Garageband

Thanks, that makes a lot more sense now