mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 09:00:07 +02:00
Fix: slowdown with many labels caused by LyricsWindow. (Bug 144)
This commit is contained in:
parent
8c805c03dd
commit
fd9ac6bf09
@ -4493,6 +4493,7 @@ void AudacityProject::OnKaraoke()
|
||||
if (!mLyricsWindow)
|
||||
mLyricsWindow = new LyricsWindow(this);
|
||||
mLyricsWindow->Show();
|
||||
UpdateLyrics();
|
||||
mLyricsWindow->Raise();
|
||||
}
|
||||
|
||||
|
@ -3653,6 +3653,13 @@ void AudacityProject::UpdateLyrics()
|
||||
mLyricsWindow->Show(false); // Don't show it. Need to update content regardless.
|
||||
}
|
||||
|
||||
// The code that updates the lyrics is rather expensive when there
|
||||
// are a lot of labels.
|
||||
// So - bail out early if the lyrics window is not visible.
|
||||
// We will later force an update when the lyrics window is made visible.
|
||||
if( !mLyricsWindow->IsVisible() )
|
||||
return;
|
||||
|
||||
Lyrics* pLyricsPanel = mLyricsWindow->GetLyricsPanel();
|
||||
pLyricsPanel->Clear();
|
||||
for (int i = 0; i < pLabelTrack->GetNumLabels(); i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user