mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-09 06:06:24 +01:00
Enable scrolling play by double-click on either play button or QP area of ruler
This commit is contained in:
@@ -741,16 +741,21 @@ void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
|
||||
auto doubleClicked = mPlay->IsDoubleClicked();
|
||||
mPlay->ClearDoubleClicked();
|
||||
|
||||
if (!CanStopAudioStream())
|
||||
return;
|
||||
auto p = GetActiveProject();
|
||||
|
||||
StopPlaying();
|
||||
if (doubleClicked)
|
||||
p->GetPlaybackScroller().Activate(true);
|
||||
else {
|
||||
if (!CanStopAudioStream())
|
||||
return;
|
||||
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (p) p->TP_DisplaySelection();
|
||||
StopPlaying();
|
||||
|
||||
PlayDefault();
|
||||
UpdateStatusBar(GetActiveProject());
|
||||
if (p) p->TP_DisplaySelection();
|
||||
|
||||
PlayDefault();
|
||||
UpdateStatusBar(p);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlToolBar::OnStop(wxCommandEvent & WXUNUSED(evt))
|
||||
@@ -781,9 +786,11 @@ void ControlToolBar::StopPlaying(bool stopStream /* = true*/)
|
||||
{
|
||||
AudacityProject *project = GetActiveProject();
|
||||
|
||||
if(project)
|
||||
if(project) {
|
||||
project->GetPlaybackScroller().Activate(false);
|
||||
// Let scrubbing code do some appearance change
|
||||
project->GetScrubber().StopScrubbing();
|
||||
}
|
||||
|
||||
if (!CanStopAudioStream())
|
||||
return;
|
||||
|
||||
@@ -479,11 +479,15 @@ void TranscriptionToolBar::OnPlaySpeed(wxCommandEvent & WXUNUSED(event))
|
||||
auto doubleClicked = button->IsDoubleClicked();
|
||||
button->ClearDoubleClicked();
|
||||
|
||||
// Let control have precedence over shift
|
||||
const bool cutPreview = mButtons[TTB_PlaySpeed]->WasControlDown();
|
||||
const bool looped = !cutPreview &&
|
||||
if (doubleClicked)
|
||||
GetActiveProject()->GetPlaybackScroller().Activate(true);
|
||||
else {
|
||||
// Let control have precedence over shift
|
||||
const bool cutPreview = mButtons[TTB_PlaySpeed]->WasControlDown();
|
||||
const bool looped = !cutPreview &&
|
||||
button->WasShiftDown();
|
||||
PlayAtSpeed(looped, cutPreview);
|
||||
PlayAtSpeed(looped, cutPreview);
|
||||
}
|
||||
}
|
||||
|
||||
void TranscriptionToolBar::OnSpeedSlider(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
Reference in New Issue
Block a user