Add Saving and Loading Presets - #40
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds preset functionality to the Rustortion amplifier application allowing users to save, load, and manage amplifier configurations. The implementation serializes stage configurations to JSON format and provides GUI controls for preset management.
- Introduces a
PresetManagerfor handling preset persistence with JSON serialization - Adds a
PresetBarcomponent with controls for loading, saving, updating, and deleting presets - Creates three default presets (Clean, Crunch, Lead) with predefined stage configurations
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/gui/preset.rs | Core preset functionality with Preset struct, PresetManager for file operations, and default preset creation |
| src/gui/components/preset_bar.rs | GUI component providing preset selection dropdown and management buttons |
| src/gui/app.rs | Integration of preset functionality into main application with message handling |
| src/gui/messages.rs | New message types for preset operations |
| src/gui/config/*.rs | Added serde derive macros to enable JSON serialization of stage configurations |
| presets/*.json | Default preset files generated by the application |
| Cargo.toml | Added serde_json dependency for JSON serialization |
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.
Closes #15
Adds functionality to save and load presets, serialises the stage configs to and from JSON and adds in the relevant GUI functionality. It's a little bit messy but gets the job done.