mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +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)
|
if (!mLyricsWindow)
|
||||||
mLyricsWindow = new LyricsWindow(this);
|
mLyricsWindow = new LyricsWindow(this);
|
||||||
mLyricsWindow->Show();
|
mLyricsWindow->Show();
|
||||||
|
UpdateLyrics();
|
||||||
mLyricsWindow->Raise();
|
mLyricsWindow->Raise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3653,6 +3653,13 @@ void AudacityProject::UpdateLyrics()
|
|||||||
mLyricsWindow->Show(false); // Don't show it. Need to update content regardless.
|
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();
|
Lyrics* pLyricsPanel = mLyricsWindow->GetLyricsPanel();
|
||||||
pLyricsPanel->Clear();
|
pLyricsPanel->Clear();
|
||||||
for (int i = 0; i < pLabelTrack->GetNumLabels(); i++)
|
for (int i = 0; i < pLabelTrack->GetNumLabels(); i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user