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

Scrub play button becomes a stop button when pressed...

... also the corresponding menu command can stop as well as start the scrub
or seek
This commit is contained in:
Paul Licameli
2016-06-06 02:11:12 -04:00
parent fd9d6a8fcf
commit d1fe0a89b5
4 changed files with 31 additions and 13 deletions

View File

@@ -427,8 +427,8 @@ void ScrubbingToolBar::Populate()
MakeButtonBackgroundsSmall();
/* Buttons */
AddButton(bmpPlay, bmpPlay, bmpPlayDisabled, STBStartID,
_("Start scrubbing"), false);
AddButton(bmpPlay, bmpStop, bmpPlayDisabled, STBStartID,
_("Start scrubbing"), true);
AddButton(bmpScrub, bmpScrub, bmpScrubDisabled, STBScrubID,
_("Scrub"), true);
AddButton(bmpSeek, bmpSeek, bmpSeekDisabled, STBSeekID,
@@ -456,7 +456,23 @@ void ScrubbingToolBar::RegenerateTooltips()
"Scrubbing" is variable-speed playback, ...
"Seeking" is normal speed playback but with skips
*/
mButtons[STBStartID]->SetToolTip(_("Start scrubbing or seeking"));
auto project = GetActiveProject();
if (project) {
auto startStop = mButtons[STBStartID];
auto &scrubber = project->GetScrubber();
if(scrubber.HasStartedScrubbing() || scrubber.IsScrubbing()) {
if (scrubber.Seeks())
startStop->SetToolTip(_("Stop seeking"));
else
startStop->SetToolTip(_("Stop scrubbing"));
}
else {
if (scrubber.Seeks())
startStop->SetToolTip(_("Start seeking"));
else
startStop->SetToolTip(_("Start scrubbing"));
}
}
mButtons[STBScrubID]->SetToolTip(_("Scrub"));
mButtons[STBSeekID]->SetToolTip(_("Seek"));
#endif
@@ -472,8 +488,7 @@ void ScrubbingToolBar::OnButton(wxCommandEvent &event)
switch (id) {
case STBStartID:
mButtons[STBStartID]->PopUp();
scrubber.OnStart(event);
scrubber.OnStartStop(event);
break;
case STBScrubID:
scrubber.OnScrub(event);

View File

@@ -136,6 +136,8 @@ public:
void EnableDisableButtons();
void UpdatePrefs();
void RegenerateTooltips();
private:
AButton *AddButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
@@ -143,8 +145,6 @@ private:
void MakeButtons();
void RegenerateTooltips();
AButton *mButtons[STBNumButtons];
wxImage *upImage;