Skip to content

Effect states shared on copy - #12187

Merged
saintmatthieu merged 5 commits into
audacity:masterfrom
kryksyh:effect-states-shared-on-copy
Sep 23, 2026
Merged

saintmatthieu merged 5 commits into
audacity:masterfrom
kryksyh:effect-states-shared-on-copy

Conversation

@kryksyh

@kryksyh kryksyh commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Resolves:

  • Realtime effect windows closing when the user edits the project, ie moves a clip
  • Realtime effect windows closing on undo/redo
  • Doing undo and redo when the project has many effects is slow
  • I signed CLA
  • This PR includes AI assistance
  • If the PR is AI-assisted, I have read, understood and complied with the guidelines for AI-assisted contributions
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • 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

@kryksyh
kryksyh marked this pull request as ready for review September 17, 2026 13:13
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 947a75be-f778-4c1e-b8c9-ba819938b412

📥 Commits

Reviewing files that changed from the base of the PR and between 2766c20 and b56cd59.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 4200e67b-79de-4646-a353-6f8ef4650a26

📥 Commits

Reviewing files that changed from the base of the PR and between da57764 and 2766c20.

📒 Files selected for processing (8)
  • au3/libraries/au3-realtime-effects/RealtimeEffectList.h
  • au3/libraries/au3-realtime-effects/RealtimeEffectState.h
  • au3/libraries/au3-wave-track/WaveTrack.h
  • src/effects/effects_base/internal/abstractviewlauncher.cpp
  • src/trackedit/internal/au3/au3clipsinteraction.cpp
  • src/trackedit/tests/CMakeLists.txt
  • src/trackedit/tests/au3clipsinteraction_tests.cpp
  • src/trackedit/tests/au3trackeditclipboard_tests.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

RealtimeEffectList now separates shallow list copying from explicit state cloning. WaveTrackUtilities::EmptyCopy supports reference and deep realtime-effect copies. Track duplication, splitting, paste, and effect-processing paths select the required copy mode. RealtimeEffectState cloning avoids implicit instance creation and creates independent output buffers. Effect hiding checks for an existing instance. Track replacement preserves its registered effect list. Tests cover copy modes, duplication, and undo/redo preservation.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TrackOperation
  participant WaveTrackUtilities
  participant RealtimeEffectList
  participant RealtimeEffectState
  TrackOperation->>WaveTrackUtilities: create EmptyCopy with Ref or Deep
  WaveTrackUtilities->>RealtimeEffectList: retain or clone effect states
  RealtimeEffectList->>RealtimeEffectState: clone each state for Deep copies
  RealtimeEffectState-->>RealtimeEffectList: return independent state
  RealtimeEffectList-->>WaveTrackUtilities: provide copied effect list
  WaveTrackUtilities-->>TrackOperation: return copied track
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: sharing effect states when tracks are copied.
Description check ✅ Passed The description states the addressed issues and completes the required checklist. The issue link after "Resolves:" and the recommended validation checkbox are missing, but the description is otherwise…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟠 Major · Preserve pending settings and messages before instance creation. · RealtimeEffectState.cpp:955

au3/libraries/au3-realtime-effects/RealtimeEffectState.cpp:955
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Preserve pending settings and messages before instance creation.

If Access::Set() runs before an instance exists, it stores settings in mLastSettings and the message in mChannelFromMain. MakeInstance() then calls AccessState::Initialize(), which restores mLastSettings from mMainSettings and overwrites both message-buffer slots. An unflushed settings update and any pending EffectInstance::Message are lost. Flush() can preserve the settings, but it does not preserve the message.

Preserve pending settings and messages during instance creation. Do not restore eager instance creation, because this change must keep the instance-free behavior.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: fe1fac89-4e21-4a95-b770-5f6d3145efa3

📥 Commits

Reviewing files that changed from the base of the PR and between 891c2dd and ebeb80c.

📒 Files selected for processing (12)
  • au3/libraries/au3-realtime-effects/RealtimeEffectList.cpp
  • au3/libraries/au3-realtime-effects/RealtimeEffectList.h
  • au3/libraries/au3-realtime-effects/RealtimeEffectState.cpp
  • au3/libraries/au3-realtime-effects/RealtimeEffectState.h
  • src/effects/effects_base/internal/abstractviewlauncher.cpp
  • src/effects/effects_base/internal/realtimeeffectservice.cpp
  • src/project/tests/mocks/dummyeffectinstancefactory.h
  • src/trackedit/internal/au3/au3clipsinteraction.cpp
  • src/trackedit/internal/au3/au3tracksinteraction.cpp
  • src/trackedit/tests/CMakeLists.txt
  • src/trackedit/tests/au3clipsinteraction_tests.cpp
  • src/trackedit/tests/au3tracksinteraction_tests.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@kryksyh kryksyh moved this from Ready For Dev to Ready for QA in [AU4] Release Maintenance Sep 17, 2026
@kryksyh
kryksyh force-pushed the effect-states-shared-on-copy branch from 2c65f39 to da57764 Compare September 17, 2026 15:40
@ianalarina ianalarina added this to the Audacity 4.0.1 milestone Sep 21, 2026
@grliszas14
grliszas14 force-pushed the effect-states-shared-on-copy branch from da57764 to 2766c20 Compare September 21, 2026 15:08
@chinakov chinakov moved this from Ready for QA to In QA in [AU4] Release Maintenance Sep 22, 2026
@chinakov chinakov moved this from In QA to Ready for Merge in [AU4] Release Maintenance Sep 22, 2026
@chinakov chinakov self-assigned this Sep 22, 2026
@saintmatthieu
saintmatthieu force-pushed the effect-states-shared-on-copy branch from 2766c20 to b56cd59 Compare September 23, 2026 09:13
Instead of deep copy everything we will make effect deep copies where it is needed

Assisted-by: Claude Code 2.1.273 (Claude Fable 5.1)
Assisted-by: Claude Code 2.1.273 (Claude Fable 5.1)
- duplicate tracks
- duplicate selection into new tracks
- split range selection into new tracks
- split stereo track to L/R mono
- split stereo track to center mono
- paste into a new track
- split clips into new tracks
- duplicate clips

Assisted-by: Claude Code 2.1.273 (Claude Fable 5.1)
Assisted-by: Claude Code 2.1.273 (Claude Fable 5.1)
@saintmatthieu
saintmatthieu force-pushed the effect-states-shared-on-copy branch from b56cd59 to 9fda05d Compare September 23, 2026 09:57
@saintmatthieu
saintmatthieu merged commit 5687278 into audacity:master Sep 23, 2026
2 of 6 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for Merge to Done in [AU4] Release Maintenance Sep 23, 2026
kryksyh added a commit that referenced this pull request Sep 23, 2026
Effect states shared on copy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants