Fix #12 An audio sample can be paused and a different one can be

played without a program crash
This commit is contained in:
Alessandro
2019-08-04 11:12:58 +02:00
parent 1db7f14a27
commit 7e897bbb82
2 changed files with 4 additions and 1 deletions

View File

@@ -92,6 +92,8 @@ class AudioPlayer(QObject):
def _reset_audio_widget(self):
"""Reset the widget. Stop all playing samples."""
self._first_call = True
self._paused = False
if mixer.get_init():
if mixer.music.get_busy():
mixer.music.stop()
@@ -123,7 +125,6 @@ class AudioPlayer(QObject):
def set_audio_player(self, fname=""):
"""Set the current audio sample."""
self._first_call = True
self._reset_audio_widget()
full_name = os.path.join(
Constants.DATA_FOLDER,