Remember input, output and the effect chain between launches #9

Merged
erdoar merged 1 commit from claude/remember-settings into main 2026-10-10 02:56:35 +00:00
erdoar commented 2026-10-10 02:28:59 +00:00 (Migrated from github.com)

Summary

  • PlugCore gains HostSettings / SavedSlot (Codable) and SettingsStore, which writes JSON to ~/Library/Application Support/Plug/settings.json. EffectID and InputSource become Codable.
  • AudioEngine.savedState(for:) / restoreState(_:for:) save and restore each Audio Unit's fullState, so effect parameters come back too.
  • The app restores input, output (matched by device UID) and effects on launch, but never starts playing by itself. It saves after each change and on quit, since parameter edits in plugin windows aren't observed. States for units still loading are kept and saved unchanged, so a quick quit can't lose them.

Tested

  • Mac mini M4, macOS 15: in the bundled app, input, output, effects and an effect's slider all came back after quitting and reopening, as reported by the owner.
  • Linux, Swift 6.0.3: 17 tests pass, including new settings round-trip, missing-file and corrupt-file tests.
  • Not yet confirmed on the Mac: swift test, including the new engine test that an AUDelay parameter survives save and restore.

🤖 Generated with Claude Code

https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5

## Summary - `PlugCore` gains `HostSettings` / `SavedSlot` (Codable) and `SettingsStore`, which writes JSON to `~/Library/Application Support/Plug/settings.json`. `EffectID` and `InputSource` become Codable. - `AudioEngine.savedState(for:)` / `restoreState(_:for:)` save and restore each Audio Unit's `fullState`, so effect parameters come back too. - The app restores input, output (matched by device UID) and effects on launch, but **never starts playing by itself**. It saves after each change and on quit, since parameter edits in plugin windows aren't observed. States for units still loading are kept and saved unchanged, so a quick quit can't lose them. ## Tested - Mac mini M4, macOS 15: in the bundled app, input, output, effects and an effect's slider all came back after quitting and reopening, as reported by the owner. - Linux, Swift 6.0.3: 17 tests pass, including new settings round-trip, missing-file and corrupt-file tests. - Not yet confirmed on the Mac: `swift test`, including the new engine test that an AUDelay parameter survives save and restore. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5
Sign in to join this conversation.
No description provided.