diff --git a/src/Menus.cpp b/src/Menus.cpp index af94b4441..78d4ffcf6 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -1865,7 +1865,7 @@ void AudacityProject::OnPlayStop() //update the playing area TP_DisplaySelection(); //Otherwise, start playing (assuming audio I/O isn't busy) - toolbar->SetPlay(true); + //toolbar->SetPlay(true); // Not needed as done in PlayPlayRegion. toolbar->SetStop(false); // Will automatically set mLastPlayMode @@ -1874,7 +1874,7 @@ void AudacityProject::OnPlayStop() } else if (!gAudioIO->IsBusy()) { //Otherwise, start playing (assuming audio I/O isn't busy) - toolbar->SetPlay(true); + //toolbar->SetPlay(true); // Not needed as done in PlayPlayRegion. toolbar->SetStop(false); // Will automatically set mLastPlayMode @@ -1932,7 +1932,7 @@ void AudacityProject::OnPlayStopSelect() } else if (!gAudioIO->IsBusy()) { //Otherwise, start playing (assuming audio I/O isn't busy) - toolbar->SetPlay(true); + //toolbar->SetPlay(true); // Not needed as set in PlayPlayRegion() toolbar->SetStop(false); // Will automatically set mLastPlayMode diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index 8eb52e6f2..0ea38b45e 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -406,11 +406,12 @@ void ControlToolBar::EnableDisableButtons() mPause->SetEnabled(true); } -void ControlToolBar::SetPlay(bool down) +void ControlToolBar::SetPlay(bool down, bool looped) { - if (down) + if (down) { + mPlay->SetAlternate(looped); mPlay->PushDown(); - else { + } else { mPlay->PopUp(); mPlay->SetAlternate(false); } @@ -449,7 +450,7 @@ void ControlToolBar::PlayPlayRegion(double t0, double t1, bool cutpreview /* = false */, TimeTrack *timetrack /* = NULL */) { - SetPlay(true); + SetPlay(true, looped); if (gAudioIO->IsBusy()) { SetPlay(false); @@ -634,8 +635,6 @@ void ControlToolBar::SetVUMeters(AudacityProject *p) void ControlToolBar::PlayCurrentRegion(bool looped /* = false */, bool cutpreview /* = false */) { - mPlay->SetAlternate(looped); - AudacityProject *p = GetActiveProject(); if (p) @@ -668,7 +667,7 @@ void ControlToolBar::OnKeyEvent(wxKeyEvent & event) StopPlaying(); } else if (!gAudioIO->IsBusy()) { - SetPlay(true); + SetPlay(true);// Not needed as done in PlayPlayRegion SetStop(false); PlayCurrentRegion(); } diff --git a/src/toolbars/ControlToolBar.h b/src/toolbars/ControlToolBar.h index 30de42ab4..713e789d2 100644 --- a/src/toolbars/ControlToolBar.h +++ b/src/toolbars/ControlToolBar.h @@ -60,7 +60,7 @@ class ControlToolBar:public ToolBar { void OnPause(wxCommandEvent & evt); //These allow buttons to be controlled externally: - void SetPlay(bool down); + void SetPlay(bool down, bool looped=false); void SetStop(bool down); void SetRecord(bool down);