Cabbage Logo
Back to Cabbage Site

Where to place preset-folders for presetbutton?

In terms of distribution, where do I place the user and factory preset-folders so that the plugin will recognize them? (Both Windows and macOS)

You can decide where to place them when you set the factoryFolder() idntifier. For example:

factoryFolder("#USER_APPLICATION_DATA_DIRECTORY/DeveloperName/PluginName/PresetsFolder", “* .snaps”)

The #USER_APPLICATION_DATA_DIRECTORY macro expands to User/AppData/Roaming. On MacOS it’s the Application Support folder. These are standard locations for application data.

Thank you. Won’t this be a nightmare in terms of version control?

Just thinking out loud here, but it would be nice if you could set a factoryFolder and userFolder for Cabbage, and a second factoryFolder & userFolder for exported plugins. Otherwise I would need to copy the presets back and forth all the time for version control? Or am I misunderstanding something perhaps?

If I was developing presets for a plugin called Whatever, I would place the presets into:

factoryFolder("#USER_APPLICATION_DATA_DIRECTORY/Rory/Whatever/PresetsFolder", “* .snaps”)

Then I’d point my installer script to that folder when it prepares my installer. The path will be the same on all machines because Cabbage auto expands the diretory path. But maybe I’m missing something here?

Yeah it’s a good solution for distribution. I was thinking more in terms of version control during development, where you would need to copy the presets back and forth between #USER_APPLICATION_DATA_DIRECTORY and the repository-folder before you push a commit.

But maybe I’m overthinking it, since it’s not really much work to handle this.

I tried this, but have had no success on MacOS yet.

Here’s the filebutton:

presetbutton bounds(21, 12, 120, 23), channel("PresetChannel"), colour:0(16, 19, 22, 255), fontColour(176, 176, 176), textColour(176, 176, 176), presetNameAsText(1), factoryFolder("#USER_APPLICATION_DATA_DIRECTORY/companyName/pluginName/Presets/Factory", "*.psts"), userFolder("#USER_APPLICATION_DATA_DIRECTORY/companyName/pluginName/Presets/User", "*.psts"), highlightedItemColour(200, 200, 200) highlightedTextColour(25, 25, 25), outlineColour(44, 47, 49), outlineThickness(1), corners(2)

Here’s the folders where the presets are placed after running my installer:

/Library/Application Support/companyName/pluginName/Presets/Factory
/Library/Application Support/companyName/pluginName/Presets/User

That’s the system library folder. But you’ve set a user library folder. I think if you move them to ~/Library it should work.

Thanks, tried that now, but no success :cry:

Sorry #USER_APPLICATION_DATA_DIRECTORY is ~/Library. I should have read your post a little more carefully. If you want to use the Application Support folder you’ll need to add that to the path.

1 Like

This works fine when reading presets, but I am having some trouble overwriting or saving new presets when they are stored in the ~Library. Is that working fine for you?

Yes, no issues here when last I tested? Can you prepare a simple .csd file for me to test with?

I think I figured it out.

If you are on a normal user when installing a plugin with a installer, you will need to log in with the admin-user during the installation process. If you try to edit or write a file in the folders placed during the installation process, you will need to type in the admin password to do it (even though they are in the user library).

The admin password prompt in macOS does not show when using the plugin in a DAW or in Cabbage, so you won’t be able to save, edit or delete presets in those folders.

Forgive me ignorance, but I didn’t realise there was such a thing as a normal user on MacOS :see_no_evil:

:stuck_out_tongue_closed_eyes:

There are some scenarios I can think of where this could happen, say a shared computer where you must log into as guest (such as in a school or studio).

It’s not really a problem, but since there is no visual feedback from the plugin that the save/delete operation failed, it caused a bit of confusion for me :+1: