Skip to content

Issue 3792: Various play commands do not exit play mode - #3844

Merged
LWinterberg merged 1 commit into
audacity:release-3.2.2from
DavidBailes:playback
Oct 31, 2022
Merged

LWinterberg merged 1 commit into
audacity:release-3.2.2from
DavidBailes:playback

Conversation

@DavidBailes

@DavidBailes DavidBailes commented Oct 25, 2022 •

Copy link
Copy Markdown
Collaborator

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;

  • 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

@Paul-Licameli

Copy link
Copy Markdown
Collaborator

@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)

@petersampsonaudacity

petersampsonaudacity commented Oct 25, 2022 •

Copy link
Copy Markdown

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

  1. Play Cut Preview
    and also
  2. Play before selection start
  3. Play after selection start
  4. Play before selection end
  5. Play after selection end.

So looks properly fixed to me

@crsib @LWinterberg
And I agree with David's request in #3792 that if possible this fix should be pulled into 3.2.2 maintenance release

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;
@DavidBailes
DavidBailes changed the base branch from master to release-3.2.2 October 26, 2022 09:05
@DavidBailes

Copy link
Copy Markdown
Collaborator Author

@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)

@Paul-Licameli . I've done this.

@petersampsonaudacity

Copy link
Copy Markdown

@Paul-Licameli hi Paul - this appears to still need a Review before it makes it into a 3.2.2 build

@Paul-Licameli

Copy link
Copy Markdown
Collaborator

@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.

@LWinterberg
LWinterberg merged commit 7a2df4f into audacity:release-3.2.2 Oct 31, 2022
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.

"Play Cut Preview" does not exit "play mode"

4 participants