Repository navigation
Use deep copy for realtime effect states when cloning a ReatimeEffectList - #7873
Conversation
There was a problem hiding this comment.
I think we have to add the name of the track it belongs to. If we don't,
- I tweak my reverb effect on track 1,
- I tweak my compressor effect on track 2,
- I undo
would undo my tweaking of the reverb effect of track 1, too.
@LWinterberg please comment.
There was a problem hiding this comment.
I mean, it should undo the last effect, shouldn't it? I don't understand why the name of the track matters here. Does the code as-is effect all instances of an effect? so if:
- I tweak the reverb on track 1
- I tweak the reverb on track 2
- I tweak a second reverb on track 2
- I undo
would all changes across all tracks and effects be undone?
There was a problem hiding this comment.
Yes.
Why track name matters: this is what the history mechanism bases its logic to consolidate actions. If you change a reverb setting on track one and tell the history "Change reverb param", and then change a reverb setting on track 2 and tell the history "Change reverb param", it'll get consolidated.
So without the track name, it's as you described. With the track name:
- tweak effect on track 1: state is modified (meaning if I close the project, I'm asked if I want to save).
- tweak effect with same name on track 1 again: nothing new happens.
- tweak effect with same name on track 2: new history item is created.
which I think is better, but please confirm.
There was a problem hiding this comment.
Another note: a new history item will only get added when I close an effect's UI. Testing this on @embarc-gabriel 's branch, not sure it's the same on master. Seems strange to me. Maybe we should polish this, too, before totally freezing audacity 3.
There was a problem hiding this comment.
I have added the track name as well as discussed here. This totally make sense.
But I don´t know exactly what is the best place to add the item to the history.
IMO to apply it only when the UI is closed is fine but for sure I appreciate any feedback on this.
@LWinterberg @saintmatthieu
ddb9572 to
be94bd5
Compare
Resolves: #10141 Resolves: #8686 Resolves: #11708 Resolves: #11712 Fixes: - Crash when a realtime effect dialog saves settings on close. In some situations (applying destructive effect, undo/redo, etc) the dialog closes when the effect state is destroyed. Regression from #7873. - Master effect settings were not restored with undo/redo, because master effect state is a project-wide singleton, and the state saved in the undo system is the same state being edited by the dialog. - Memory corruption on closing AudioUnit dialog <!-- Use "x" to fill the checkboxes below like [x] --> - [x] I signed [CLA](https://www.audacityteam.org/cla/) - [x] The title of the pull request describes an issue it addresses - [x] If changes are extensive, then there is a sequence of easily reviewable commits - [x] Each commit's message describes its purpose and effects - [x] There are no behavior changes unnecessary for the stated purpose of the PR Recommended: - [ ] Each commit compiles and runs on my machine without known undesirable changes of behavior QA: - [ ] Testflow test cases have been run
Resolves: #4169
By cloning a RealtimeEffectList a shallow copy of the effect state is created.
In the current implementation if the user copy and paste a track the effect list state for both tracks will point to the same memory location.
This PR modifies the code to use a deep copy instead.
We should also add the effect settings change to the history to avoid just losing the modification after undoing some other action.
Recommended: