From 7e897bbb82ba8b59b5bd0ba66ab6bc17224219b5 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Sun, 4 Aug 2019 11:12:58 +0200 Subject: [PATCH] Fix #12 An audio sample can be paused and a different one can be played without a program crash --- CHANGELOG.md | 2 ++ src/audio_player.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5522a9e..980bc80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm The first release is [3.0.0] because this is actually the third major version (completely rewritten) of the software. ## [Unreleased] +### Fixed +- An audio sample can be paused and a different one can be played without a program crash ([#12](https://github.com/AresValley/Artemis/pull/12)) ## [3.0.1] - 2019-8-1 ### Added diff --git a/src/audio_player.py b/src/audio_player.py index e38f8b2..e1b8a90 100644 --- a/src/audio_player.py +++ b/src/audio_player.py @@ -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,