Search guides and the APICtrl K
  1. API reference
  2. Applications

user_settings.h

Settings that belong to the USER, not to the session.

#include <sonore/user_settings.h>
On this page

Design notes

A plugin has two kinds of persistent state and hosts only understand one of them. The session blob is per-instance: this reverb, on this track, in this project. But a plugin also accumulates things that belong to the person using it: where their sample folder is, what scale their editor should open at, which one-time notice they have already dismissed, which output device the standalone last used.

Putting any of that in the session blob gets it wrong in both directions. It travels to whoever the project is sent to, carrying a path that does not exist on their machine; and it is absent from every NEW instance, so the preference the user set five minutes ago does not apply to the next plugin they add.

A properties file, and here it is the same StateBag the session uses, written to a per-user file: deliberately the same, because a second key/value format is a second parser to get wrong, and this one is already exercised by every state round-trip in the suite.

MAIN THREAD ONLY. It opens files.

Types 1

A plugin's per-user settings, loaded from and saved to one file.

Every instance of a plugin shares the file, and nothing coordinates them: two editors open at once, both saving, and the last writer wins. That is the right trade for preferences (the alternative is a lock held across a file write in a process that must never block), but it means this is for things a user SETS, not for anything a plugin accumulates continuously.

Functions 3

↑↓ to move↵ to openEvery public name in the headers, and every guide