Skip to content

EffectOutputTracks copies clip IDs when duplicating - #7871

Merged
saintmatthieu merged 1 commit into
audacity:masterfrom
saintmatthieu:7799-effect-output-tracks-copy-clip-IDs
Dec 10, 2024
Merged

saintmatthieu merged 1 commit into
audacity:masterfrom
saintmatthieu:7799-effect-output-tracks-copy-clip-IDs

Conversation

@saintmatthieu

Copy link
Copy Markdown
Contributor

Resolves: #7799

Addresses the case of EffectOutputTracks, where, when duplicating the original track, the clip IDs should match the original.
Problem discussed internally here.

  • I signed CLA
  • 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

@saintmatthieu
saintmatthieu requested a review from kryksyh December 9, 2024 15:06
@saintmatthieu saintmatthieu self-assigned this Dec 9, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this makes me think that there are other places where duplicated track should also duplicate clip ids. I'm not opposed to have this merged, but what do you think about introduce this as an optional behavior to Duplicate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You find that this PR solves this ID problem only in the context of effects but that preserving clip IDs might be desired in other situations, too?
Where Duplicate() is called (I changed the name to something silly and fixed compilation to make sure I haven't missed any):

  • EffectOutputTracks: IDs must be copied
  • ProjectCloudExtension::OnSyncStarted() : I think it doesn't matter?
  • PendingTracks: outdated ;)
  • Undo/Redo: at the moment new IDs are given, and it seems to work (I don't know why)
  • In WaveTrack::ClearAndPaste: new IDs are given, which is correct
  • Au3Interaction::duplicateTracks: new IDs are given, correct.

So for now at least it would seem that we're good?

Yes, in the future a situation may arise where we need to duplicate with equal IDs. I'm not sure how to change the Duplicate API, though, as this is a Track API, and other track types may not have clips (e.g. label tracks).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Undo/Redo: at the moment new IDs are given, and it seems to work (I don't know why)

Now I wonder why applying an effect breaks the project while undo doesn't. If I understand correctly, undo does the same thing as an effect does: it creates a new track and replaces the original track, including all of its clips.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right. Maybe I was too quick to come to the conclusion that undo/redo was working properly. There are bug tickets related to undo/redo: #7845, #7839, #7838, #7802, and maybe others.
I'll take a look tomorrow before merging : if it's also related, maybe a more generic solution would indeed be preferable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All things considered, I'll move this to QA already: having this merged would unblock the other ticket I'm working on.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@saintmatthieu
saintmatthieu force-pushed the 7799-effect-output-tracks-copy-clip-IDs branch from 70dd7ae to b506d3f Compare December 10, 2024 09:59
@saintmatthieu
saintmatthieu merged commit d307e27 into audacity:master Dec 10, 2024
@saintmatthieu
saintmatthieu deleted the 7799-effect-output-tracks-copy-clip-IDs branch August 28, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A project cannot be opened once an effect has been applied to its audio

2 participants