Repository navigation
Make realtime effect settings of duplicated track independent... - #4325
Paul-Licameli wants to merge 1 commit into
Conversation
... Note that RealtimeEffectList::Clone() was correct as originally written when it held states by unique_ptr, but then the change to shared_ptr introduced this problem.
| auto result = std::make_unique<RealtimeEffectList>(); | ||
| for (auto &pState : mStates) | ||
| result->mStates.push_back(pState); | ||
| result->mStates.push_back(pState->Clone()); |
There was a problem hiding this comment.
I wonder if it breaks the undo/redo stack. I remember that shallow copy was used there for a reason. @dozzzzer can you please check?
There was a problem hiding this comment.
A good point.
Define what "break" means exactly, but there may be some other visible change of behavior. This code will also be visited when pushing undo items.
Undo items in memory may occupy more storage.
The state of sliders in dialogs, although not causing an undo push or pop when you change them directly, will be snap-shotted whenever the undo stack is pushed for other reasons, and restored to previous state when you undo.
I had raised the question whether this would be desired and intended undo/redo behavior or not. It was decided, not. But now, this change would make it so.
So there may be more work to pass more information about how Clone() is reached, and change its behavior only in the case you get there from the Duplicate editing command.
There was a problem hiding this comment.
Consider this PR just draft, then. The good new is that the cause of the reported bug is known and easily fixable but for the other side effects of the fix.
There was a problem hiding this comment.
As far as I remember the problem is that UI state is "pinned" to a specific RealtimeEffectState. So at some point UI modifies the state which is stored in the history, not the one used by the processor.
This might be no longer a problem, as we've made a lot of changes on top. We need to regress all effect families carefully, specifically when using Undo/Redo with UI open.
... Note that RealtimeEffectList::Clone() was correct as originally written when it held states by unique_ptr, but then the change to shared_ptr introduced this problem.
Resolves: #4169
(short description of the changes and the motivation to make the changes)
Recommended: