From b93717904ce75c6fc202528d9cf87eaaf3e449e6 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 25 Feb 2025 16:14:25 +0100 Subject: Remove stop functionality from player --- solo-tool-project/test/player_mock.py | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'solo-tool-project/test/player_mock.py') diff --git a/solo-tool-project/test/player_mock.py b/solo-tool-project/test/player_mock.py index 3162e0f..e9e9ead 100644 --- a/solo-tool-project/test/player_mock.py +++ b/solo-tool-project/test/player_mock.py @@ -1,10 +1,6 @@ class Player(): - STOPPED = 0 - PLAYING = 1 - PAUSED = 2 - def __init__(self): - self.state = Player.STOPPED + self.playing = False self.rate = 1.0 self.position = 0.0 self.volume = 1.0 @@ -13,25 +9,19 @@ class Player(): self.playbackVolumeChangedCallback = None def play(self): - previousState = self.state - self.state = Player.PLAYING - if previousState != Player.PLAYING: - self.playingStateChangedCallback() - - def stop(self): - previousState = self.state - self.state = Player.STOPPED - if previousState != Player.STOPPED: + previousState = self.playing + self.playing = True + if previousState != self.playing: self.playingStateChangedCallback() def pause(self): - previousState = self.state - self.state = Player.PAUSED - if previousState != Player.PAUSED: + previousState = self.playing + self.playing = False + if previousState != self.playing: self.playingStateChangedCallback() def isPlaying(self): - return self.state == Player.PLAYING + return self.playing def setPlaybackRate(self, rate): self.rate = rate @@ -55,7 +45,6 @@ class Player(): return self.volume def setCurrentSong(self, path): - self.stop() self.currentSong = path def setPlayingStateChangedCallback(self, callback): -- cgit v1.2.3