aboutsummaryrefslogtreecommitdiffstats
path: root/player_mock.py
diff options
context:
space:
mode:
Diffstat (limited to 'player_mock.py')
-rw-r--r--player_mock.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/player_mock.py b/player_mock.py
new file mode 100644
index 0000000..2fcb725
--- /dev/null
+++ b/player_mock.py
@@ -0,0 +1,42 @@
+class Player():
+ STOPPED = 0
+ PLAYING = 1
+ PAUSED = 2
+
+ def __init__(self):
+ self.state = Player.STOPPED
+ self.rate = 1.0
+ self.position = 0.0
+ self.volume = 1.0
+ self.currentSong = None
+
+ def play(self):
+ self.state = Player.PLAYING
+
+ def stop(self):
+ self.state = Player.STOPPED
+
+ def pause(self):
+ self.state = Player.PAUSED
+
+ def setPlaybackRate(self, rate):
+ self.rate = rate
+
+ def getPlaybackRate(self):
+ return self.rate
+
+ def setPlaybackPosition(self, position):
+ self.position = position
+
+ def getPlaybackPosition(self):
+ return self.position
+
+ def setPlaybackVolume(self, volume):
+ self.volume = volume
+
+ def getPlaybackVolume(self):
+ return self.volume
+
+ def setCurrentSong(self, path):
+ self.currentSong = path
+