[FEATURE] Preset Manager - #664
Open
jesusaviladev wants to merge 3 commits into
Open
Conversation
…sdatkinson#428) Introduces PresetManager, a plugin-agnostic class that persists named presets (model path, IR path, EQ/volume params) as JSON under the plugin's app-support directory, with atomic writes and duplicate/corruption-safe error handling. Wires it into NeuralAmpModeler via a new "Presets" button: save the current state as a preset, load or delete an existing one from a popup menu. Saving under a name that already exists asks for confirmation before overwriting. Applying a preset that was saved without a model or IR unloads the current one, so loading a preset always reproduces the state it captured rather than leaving the previous file behind. A failed disk write rolls back the in-memory change so the preset list never diverges from what's actually persisted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GUjbC9Vj8wD6UAkLW5QjG4
Adds PresetManager.cpp/.h to every macOS target and to the Windows app and VST3 projects. The Windows AAX project is intentionally left out: that build targets Pro Tools only and is not produced by CI. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GUjbC9Vj8wD6UAkLW5QjG4
Fixes formatting violations per CONTRIBUTING.md: C-style cast spacing, message box call wrapping, and preset param map layout. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a local preset system that lets users save and recall the current model, IR,
and EQ/volume settings under a named preset.
Closes #252
Closes #428
Motivation
#252 asked for a way to group model, IR, and EQ/volume params under a named
preset that can be saved and recalled. #428 asked for a generic local
persistence layer (JSON file under the app's Application Support / AppData
path) as infrastructure for exactly this kind of feature, plus others
mentioned in that issue (default paths, one-time messages) that this PR
doesn't attempt to solve.
Design decisions
ships as a standalone app, where VST3 native presets don't apply, so a
self-contained format made more sense than coupling to the host's preset
mechanism.
PresetManageris fully decoupled fromNeuralAmpModeler. It's a new,self-contained class that only knows about a plain
PresetDatastruct(name, model path, IR path, and a param name -> value map) — it doesn't
include
NeuralAmpModeler.hor know about the parameter enum. Integrationin
NeuralAmpModeler.cppis limited to two private methods(
CollectCurrentState()/ApplyPreset()) that translate between theplugin's live state and
PresetData, using the existingGetParam()->Value()/SetParamValue()API.presets.jsonunderAppSupportPath()(existingWDL/iPlug2 helper), so path resolution is already cross-platform without
extra code.
nlohmann::json, already vendored inthe repo — no new dependency added.
Unserialization.cppis untouched. That file handles state the hostserializes into the DAW project, which is a separate concern from this
local persistence layer.
(
SendArbitraryMsgFromUI/ message tags) already used elsewhere inNeuralAmpModeler.cpp, rather than introducing a new pattern.What's included
.xcodeprojand the Windows.vcxproj(appandvst3targets) to include the new filesWhat's intentionally out of scope
it, so I left
NeuralAmpModeler-aax.vcxprojuntouched rather than guess.Happy to add it if someone can verify the AAX build.
storage format could be extended for these later, but this PR only
implements what's needed for presets.
PresetManager— it's designed to be testable inisolation (the base path is injected via constructor), so this could be a
quick follow-up if useful.
Testing
plugin/app, reopen, load the preset, confirm model/IR/EQ/volume values are
restored correctly.
.vst3on Windows:47/47 tests passed, no new/removed/renamed parameters detected.
access to a Mac at the moment. The macOS build was compiled and manually
tested as noted above, just not run through the formal validator. Happy to
do that once I have access again, or if CI already covers it, that works
too.
PR Checklist
forrmat.bash?Unserialization.cpp.)