mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 07:59:27 +02:00
Modified version of Paul L's patch to correct play button state up/down looped/unlooped.
This commit is contained in:
parent
c0b3859249
commit
0ff4403911
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user