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

Enable scrolling play by double-click on either play button or QP area of ruler

This commit is contained in:
Paul Licameli 2016-05-03 22:39:31 -04:00
parent f48694ef47
commit ad2b4c3446
3 changed files with 25 additions and 13 deletions

View File

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

View File

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

View File

@ -85,7 +85,7 @@ array of Ruler::Label.
#include "../tracks/ui/Scrubbing.h"
//#define SCRUB_ABOVE
//#define RULER_DOUBLE_CLICK
#define RULER_DOUBLE_CLICK
using std::min;
using std::max;
@ -2393,6 +2393,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
void AdornedRulerPanel::HandleQPDoubleClick(wxMouseEvent &evt, wxCoord mousePosX)
{
mProject->GetPlaybackScroller().Activate(true);
}
void AdornedRulerPanel::HandleQPClick(wxMouseEvent &evt, wxCoord mousePosX)