Repository navigation
Fix setting clip's project tempo after opening project - #11526
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 2cbd4c4 and 3717a17f06eadabb608602344e90dab37e05e5ec. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAfter successfully parsing a project without track errors, Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped 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. Comment |
Problem: After opening a project, clips can have the wrong tempo. The tempo of a clip is the clip's "RawAudioTempo" rather than the project tempo. So when these values are different, a clip has the wrong tempo. This issue was caused by PR audacity#10688, in which there was a change to publishing a TrackListEvent::ADDITION event immediately, rather than using CallAfter. When opening a project, ProjectTempoListener::ProjectTempoListener() responds to a TrackListEvent::ADDITION by calling DoProjectTempoChange(*track, tempo), which calls OnProjectTempoChange::Call(group, oldTempo, newTempo), where oldTempo is nullopt, and newTempo is the project tempo. This is an attached virtual function, and there are overrides for each type of track. For wavetracks, this function sets the clip's project tempo. However because of the change in timing of the publishing of the event, the clips have not yet been added to the track, and so their values of project tempo are not set. When the oldTempo is nullopt, the overrides for all the other track types do nothing, and so other tracks are not affected by the change in timing. Fix: Add another call to OnProjectTempoChange::Call(group, oldTempo, newTempo), after the clips have been added.
3717a17 to
134749e
Compare
Resolves: #11337
Problem:
After opening a project, clips can have the wrong tempo. The tempo of a clip is the clip's "RawAudioTempo" rather than the project tempo. So when these values are different, a clip has the wrong tempo.
This issue was caused by PR #10688, in which there was a change to publishing a TrackListEvent::ADDITION event immediately, rather than using CallAfter. When opening a project, ProjectTempoListener::ProjectTempoListener() responds to a TrackListEvent::ADDITION by calling DoProjectTempoChange(*track, tempo), which calls OnProjectTempoChange::Call(group, oldTempo, newTempo), where oldTempo is nullopt, and newTempo is the project tempo. This is an attached virtual function, and there are overrides for each type of track. For wavetracks, this function sets the clip's project tempo. However because of the change in timing of the publishing of the event, the clips have not yet been added to the track, and so their values of project tempo are not set. When the oldTempo is nullopt, the overrides for all the other track types do nothing, and so other tracks are not affected by the change in timing.
Fix:
Add another call to OnProjectTempoChange::Call(group, oldTempo, newTempo), after the clips have been added.
Recommended:
QA: