Repository navigation
Issue 3792: Various play commands do not exit play mode - #3844
Conversation
|
@DavidBailes please rebase this onto the release-3.2.2 branch and change the base branch of the pull request (the Edit button for the bug title does this) |
|
Testing on W10 with @DavidBailes 's branch build with the the fix for this: audacity-win-3.3.0-alpha-20221025+77e4692-x64 This now works properly with
So looks properly fixed to me @crsib @LWinterberg |
This affects "play cut preview", and most of the play before/after commands on the transport sub menu of the extra menu. Whether or not the commands exit play mode depends in some apparently random way on one or more values of selection start, selection end, and in the playback page of preferences: the values of cut preview before and after cut region. Play cut preview: In CutPreviewPlaybackPolicy::GetPlaybackSlice(), in the initialization of Samples2, the fractional part of mDuration2 * mRate is disregarded. This can result in CutPreviewPlaybackPolicy::Done() never returning true. The fix is to round the value of the float, rather than disregarding the fractional part. The initialization of Samples1 was also changed, just for consistency. Play after/before commands. A similar issue. In PlaybackPolicy::GetPlaybackSlice(), assignment of toProduce was changed to include rounding, and the assignment of frames was changed for consistency. Note that in NewDefaultPlaybackPolicy::GetPlaybackSlice(), rounding is already used: toProduce = frames = 0.5 + (realTimeRemaining * mRate) / mLastPlaySpeed;
@Paul-Licameli . I've done this. |
|
@Paul-Licameli hi Paul - this appears to still need a Review before it makes it into a 3.2.2 build |
I have reviewed and approved it, but procedures have changed a little. I will merge it after our QA team confirm that it fixes the problem, not before. |
Resolves: #3792
This affects "play cut preview", and most of the play before/after commands on the transport sub menu of the extra menu.
Whether or not the commands exit play mode depends in some apparently random way on one or more values of selection start, selection end, and in the playback page of preferences: the values of cut preview before and after cut region.
Play cut preview:
In CutPreviewPlaybackPolicy::GetPlaybackSlice(), in the initialization of Samples2, the fractional part of mDuration2 * mRate is disregarded. This can result in CutPreviewPlaybackPolicy::Done() never returning true. The fix is to round the value of the float, rather than disregarding the fractional part. The initialization of Samples1 was also changed, just for consistency.
Play after/before commands.
A similar issue.
In PlaybackPolicy::GetPlaybackSlice(), assignment of toProduce was changed to include rounding, and the assignment of frames was changed for consistency.
Note that in NewDefaultPlaybackPolicy::GetPlaybackSlice(), rounding is already used: toProduce = frames = 0.5 + (realTimeRemaining * mRate) / mLastPlaySpeed;
Recommended: