aboutsummaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'helpers')
-rw-r--r--helpers/music_file.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/helpers/music_file.py b/helpers/music_file.py
index b0e218f..017fc59 100644
--- a/helpers/music_file.py
+++ b/helpers/music_file.py
@@ -14,7 +14,7 @@ from .music_effect import GainEffect
14 14
15file_lock = Lock("file") 15file_lock = Lock("file")
16 16
17class MusicFile(Machine): 17class MusicFile:
18 def __init__(self, filename, mapping, name=None, gain=1): 18 def __init__(self, filename, mapping, name=None, gain=1):
19 states = [ 19 states = [
20 'initial', 20 'initial',
@@ -22,7 +22,13 @@ class MusicFile(Machine):
22 'failed', 22 'failed',
23 { 23 {
24 'name': 'loaded', 24 'name': 'loaded',
25 'children': ['stopped', 'playing', 'paused', 'stopping'] 25 'children': [
26 'stopped',
27 'playing',
28 'paused',
29 'stopping',
30 'stopped'
31 ]
26 } 32 }
27 ] 33 ]
28 transitions = [ 34 transitions = [
@@ -69,7 +75,7 @@ class MusicFile(Machine):
69 } 75 }
70 ] 76 ]
71 77
72 Machine.__init__(self, states=states, 78 Machine(model=self, states=states,
73 transitions=transitions, initial='initial', 79 transitions=transitions, initial='initial',
74 ignore_invalid_triggers=True) 80 ignore_invalid_triggers=True)
75 81