mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Fix loading movie not playing again after first time
This commit is contained in:
+14
-3
@@ -1417,7 +1417,6 @@ class abogen(QWidget):
|
||||
if self.preview_playing:
|
||||
try:
|
||||
import pygame
|
||||
|
||||
pygame.mixer.music.stop()
|
||||
except Exception:
|
||||
pass
|
||||
@@ -1432,8 +1431,20 @@ class abogen(QWidget):
|
||||
self.voice_combo.setEnabled(False)
|
||||
self.btn_voice_formula_mixer.setEnabled(False) # Disable mixer button
|
||||
self.btn_start.setEnabled(False) # Disable start button during preview
|
||||
# start loading animation
|
||||
self.loading_movie.start()
|
||||
|
||||
# Start loading animation - ensure signal connection is always active
|
||||
if hasattr(self, 'loading_movie'):
|
||||
# Disconnect previous connections to avoid multiple connections
|
||||
try:
|
||||
self.loading_movie.frameChanged.disconnect()
|
||||
except TypeError:
|
||||
pass # Ignore error if not connected
|
||||
|
||||
# Reconnect the signal
|
||||
self.loading_movie.frameChanged.connect(
|
||||
lambda: self.btn_preview.setIcon(QIcon(self.loading_movie.currentPixmap()))
|
||||
)
|
||||
self.loading_movie.start()
|
||||
|
||||
def pipeline_loaded_callback(np_module, kpipeline_class, error):
|
||||
self._on_pipeline_loaded_for_preview(np_module, kpipeline_class, error)
|
||||
|
||||
Reference in New Issue
Block a user