Save and recall the whole setup as named presets #15

Merged
erdoar merged 4 commits from claude/presets into main 2026-10-10 16:58:02 +00:00
erdoar commented 2026-10-10 04:37:17 +00:00 (Migrated from github.com)

Stacked on erdoar/plug#14 (master knob), because presets save the master level. Merge #14 first.

Summary

  • Preset strip at the bottom of the window, on pine like the top board. It shows the current preset's name on a tuning scale, a small bakelite knob that opens the preset list (click a name to recall it, or the bin to delete it), and a brass SAVE plate that asks for a name. Saving under an existing name replaces that preset.
  • What a preset holds: input, captured apps, output device (by UID), every effect with its Audio Unit state (so all its settings), bypass states, chain order, and the master level. The MIDI assignment isn't included; it stays with the controller.
  • Storage: one JSON file per preset in ~/Library/Application Support/Plug/Presets/, in the same format as the settings file. PresetStore (PlugCore) cleans names (trims, turns / and : into -, drops leading dots), so a preset can't become a hidden file or land outside its folder.
  • Recall: closes the old effects' windows, loads the new chain and restores each unit's state, then sets master, apps, output and input. It shares one code path with the restore on launch. It never starts or stops playback by itself.
  • BrassPlateLabel is shared by the MIDI LEARN and SAVE plates, and TuningScale gains a width.

Tested

  • Linux, Swift 6.0.3: 34 tests pass. New: name cleaning, save, list (sorted, ignoring other files), load, replace, delete, and refusing an empty name.
  • The macOS files pass a syntax-only parse. Not compiled or tried yet.

To test on the Mac

  1. Quit Plug, then run swift test.
  2. Run scripts/bundle.sh --open. Set up something (input, effects with tweaked settings, master), press SAVE, and name it.
  3. Change everything, then save a second preset.
  4. Click the preset knob and pick the first preset. Everything should come back, including effect settings. Delete one from the list.

🤖 Generated with Claude Code

https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5


Generated by Claude Code

Stacked on erdoar/plug#14 (master knob), because presets save the master level. Merge #14 first. ## Summary - **Preset strip** at the bottom of the window, on pine like the top board. It shows the current preset's name on a tuning scale, a small bakelite knob that opens the preset list (click a name to recall it, or the bin to delete it), and a brass **SAVE** plate that asks for a name. Saving under an existing name replaces that preset. - **What a preset holds:** input, captured apps, output device (by UID), every effect with its Audio Unit state (so all its settings), bypass states, chain order, and the master level. The MIDI assignment isn't included; it stays with the controller. - **Storage:** one JSON file per preset in `~/Library/Application Support/Plug/Presets/`, in the same format as the settings file. `PresetStore` (PlugCore) cleans names (trims, turns `/` and `:` into `-`, drops leading dots), so a preset can't become a hidden file or land outside its folder. - **Recall:** closes the old effects' windows, loads the new chain and restores each unit's state, then sets master, apps, output and input. It shares one code path with the restore on launch. It never starts or stops playback by itself. - `BrassPlateLabel` is shared by the MIDI LEARN and SAVE plates, and `TuningScale` gains a width. ## Tested - Linux, Swift 6.0.3: 34 tests pass. New: name cleaning, save, list (sorted, ignoring other files), load, replace, delete, and refusing an empty name. - The macOS files pass a syntax-only parse. **Not compiled or tried yet.** ## To test on the Mac 1. Quit Plug, then run `swift test`. 2. Run `scripts/bundle.sh --open`. Set up something (input, effects with tweaked settings, master), press **SAVE**, and name it. 3. Change everything, then save a second preset. 4. Click the preset knob and pick the first preset. Everything should come back, including effect settings. Delete one from the list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5 --- _Generated by [Claude Code](https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5)_
Sign in to join this conversation.
No description provided.