Fix #12 An audio sample can be paused and a different one can be
played without a program crash
This commit is contained in:
@@ -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.
|
The first release is [3.0.0] because this is actually the third major version (completely rewritten) of the software.
|
||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [3.0.1] - 2019-8-1
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ class AudioPlayer(QObject):
|
|||||||
|
|
||||||
def _reset_audio_widget(self):
|
def _reset_audio_widget(self):
|
||||||
"""Reset the widget. Stop all playing samples."""
|
"""Reset the widget. Stop all playing samples."""
|
||||||
|
self._first_call = True
|
||||||
|
self._paused = False
|
||||||
if mixer.get_init():
|
if mixer.get_init():
|
||||||
if mixer.music.get_busy():
|
if mixer.music.get_busy():
|
||||||
mixer.music.stop()
|
mixer.music.stop()
|
||||||
@@ -123,7 +125,6 @@ class AudioPlayer(QObject):
|
|||||||
|
|
||||||
def set_audio_player(self, fname=""):
|
def set_audio_player(self, fname=""):
|
||||||
"""Set the current audio sample."""
|
"""Set the current audio sample."""
|
||||||
self._first_call = True
|
|
||||||
self._reset_audio_widget()
|
self._reset_audio_widget()
|
||||||
full_name = os.path.join(
|
full_name = os.path.join(
|
||||||
Constants.DATA_FOLDER,
|
Constants.DATA_FOLDER,
|
||||||
|
|||||||
Reference in New Issue
Block a user