From f9bfa1fc433cd85d1ee99c213deb49212b911d5b Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 15 Aug 2007 20:41:57 +0000 Subject: [PATCH] Workaround to #503 - UI no longer semi-freezes (becomes almost completely unresponsive to input) when karaoke mode is enabled and a blank line is selected. The workaround is to simply make sure that blank lines never happen, by turning them into one empty syllable instead. Originally committed to SVN as r1492. --- aegisub/audio_box.cpp | 3 +-- aegisub/audio_karaoke.cpp | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aegisub/audio_box.cpp b/aegisub/audio_box.cpp index a4fbe9fde..6b81a01a8 100644 --- a/aegisub/audio_box.cpp +++ b/aegisub/audio_box.cpp @@ -519,7 +519,6 @@ void AudioBox::OnKaraoke(wxCommandEvent &event) { } karaokeMode = false; audioKaraoke->enabled = false; - SetKaraokeButtons(); audioDisplay->SetDialogue(); audioKaraoke->Refresh(false); } @@ -528,9 +527,9 @@ void AudioBox::OnKaraoke(wxCommandEvent &event) { wxLogDebug(_T("AudioBox::OnKaraoke: karaoke disabled, enabling")); karaokeMode = true; audioKaraoke->enabled = true; - SetKaraokeButtons(); audioDisplay->SetDialogue(); } + SetKaraokeButtons(); wxLogDebug(_T("AudioBox::OnKaraoke: returning")); } diff --git a/aegisub/audio_karaoke.cpp b/aegisub/audio_karaoke.cpp index b3be87669..7e8f5259d 100644 --- a/aegisub/audio_karaoke.cpp +++ b/aegisub/audio_karaoke.cpp @@ -201,6 +201,10 @@ void AudioKaraoke::AutoSplit() { newText += wxString::Format(_T("{\\k%i}"),curlen) + token; } + // Workaround for bug #503 + // Make the line one blank syllable if it's completely blank + if (newText == _T("")) newText = wxString::Format(_T("{\\k%d}"), timelen); + // Load must_rebuild = true; AssDialogue newDiag(diag->GetEntryData());