blob: 2fcb7255db10dcc249d66d6b5aa6403c48d1ea0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
|