1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Keyboard scrubbing: faster change of direction

If one of the keyboard scrubbing keys is being held down, and the other keyboard scrubbing key is pressed:
1. With current behaviour, scrubbing in the other direction only starts when the original key is released - scrubbing stops and then starts in the other direction.
2. With the new behaviour, scrubbing immediately changes direction, and does not stop when the original key is released - scrubbing does not stop and then start again.

New behaviour:
If one of the keyboard scrubbing keys is being held down,
This commit is contained in:
David Bailes
2020-01-13 13:40:59 +00:00
parent 6fd29ad863
commit 64079c3f55
5 changed files with 41 additions and 10 deletions

View File

@@ -198,7 +198,7 @@ void DoKeyboardScrub(AudacityProject& project, bool backwards, bool keyUp)
if (keyUp) {
auto &scrubber = Scrubber::Get(project);
if (scrubber.IsKeyboardScrubbing()) {
if (scrubber.IsKeyboardScrubbing() && scrubber.IsBackwards() == backwards) {
auto gAudioIO = AudioIOBase::Get();
auto time = gAudioIO->GetStreamTime();
auto &viewInfo = ViewInfo::Get(project);
@@ -221,7 +221,11 @@ void DoKeyboardScrub(AudacityProject& project, bool backwards, bool keyUp)
else { // KeyDown
auto gAudioIO = AudioIOBase::Get();
auto &scrubber = Scrubber::Get(project);
if (!gAudioIO->IsBusy() && !scrubber.HasMark()) {
if (scrubber.IsKeyboardScrubbing() && scrubber.IsBackwards() != backwards) {
// change direction
scrubber.SetBackwards(backwards);
}
else if (!gAudioIO->IsBusy() && !scrubber.HasMark()) {
auto &viewInfo = ViewInfo::Get(project);
auto &selection = viewInfo.selectedRegion;
double endTime = TrackList::Get(project).GetEndTime();