mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Free ScrubbingToolBar from cycles...
... by having it update itself in idle time, not needing a push from Scrubber Shrinking that remnant of the big strongly connected component to 6
This commit is contained in:
@@ -52,6 +52,7 @@ EVT_COMMAND_RANGE( STBFirstButton,
|
||||
STBFirstButton + STBNumButtons - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
ScrubbingToolBar::OnButton )
|
||||
EVT_IDLE( ScrubbingToolBar::OnIdle )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
//Standard contructor
|
||||
@@ -223,7 +224,6 @@ void ScrubbingToolBar::EnableDisableButtons()
|
||||
seekButton->SetEnabled(true);
|
||||
|
||||
AudacityProject *p = &mProject;
|
||||
if (!p) return;
|
||||
|
||||
auto &scrubber = Scrubber::Get( *p );
|
||||
const auto canScrub = scrubber.CanScrub();
|
||||
@@ -262,6 +262,12 @@ void ScrubbingToolBar::EnableDisableButtons()
|
||||
scrubber.CheckMenuItems();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::OnIdle( wxIdleEvent &evt )
|
||||
{
|
||||
evt.Skip();
|
||||
EnableDisableButtons();
|
||||
}
|
||||
|
||||
static RegisteredToolbarFactory factory{ ScrubbingBarID,
|
||||
[]( AudacityProject &project ){
|
||||
return ToolBar::Holder{ safenew ScrubbingToolBar{ project } }; }
|
||||
|
||||
@@ -72,6 +72,8 @@ private:
|
||||
wxImage *downImage;
|
||||
wxImage *hiliteImage;
|
||||
|
||||
void OnIdle( wxIdleEvent &evt );
|
||||
|
||||
public:
|
||||
|
||||
DECLARE_CLASS(ScrubbingToolBar)
|
||||
|
||||
Reference in New Issue
Block a user