1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-09 06:06:24 +01:00

Play buttons can detect double clicks (but don't do anything special yet)

This commit is contained in:
Paul Licameli
2016-05-03 21:28:39 -04:00
parent 67d3bb89cb
commit 039aaa13a0
4 changed files with 17 additions and 1 deletions

View File

@@ -738,6 +738,9 @@ void ControlToolBar::OnKeyEvent(wxKeyEvent & event)
void ControlToolBar::OnPlay(wxCommandEvent & WXUNUSED(evt))
{
auto doubleClicked = mPlay->IsDoubleClicked();
mPlay->ClearDoubleClicked();
if (!CanStopAudioStream())
return;

View File

@@ -474,10 +474,15 @@ void TranscriptionToolBar::PlayAtSpeed(bool looped, bool cutPreview)
// Come here from button clicks only
void TranscriptionToolBar::OnPlaySpeed(wxCommandEvent & WXUNUSED(event))
{
auto button = mButtons[TTB_PlaySpeed];
auto doubleClicked = button->IsDoubleClicked();
button->ClearDoubleClicked();
// Let control have precedence over shift
const bool cutPreview = mButtons[TTB_PlaySpeed]->WasControlDown();
const bool looped = !cutPreview &&
mButtons[TTB_PlaySpeed]->WasShiftDown();
button->WasShiftDown();
PlayAtSpeed(looped, cutPreview);
}