diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-25 11:30:32 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-07-25 11:30:32 +0200 |
commit | 108f858fcb8794b2d1c9ce75216458bd7e0a80f2 (patch) | |
tree | 9b90673569aedbbee89b17690f742e2db40e6c19 | |
parent | 3d7a5539c3e56897743d8b18f386893294a51523 (diff) | |
download | MusicSampler-108f858fcb8794b2d1c9ce75216458bd7e0a80f2.tar.gz MusicSampler-108f858fcb8794b2d1c9ce75216458bd7e0a80f2.tar.zst MusicSampler-108f858fcb8794b2d1c9ce75216458bd7e0a80f2.zip |
Cleanup Machine use
-rw-r--r-- | helpers/music_file.py | 12 |
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 | ||
15 | file_lock = Lock("file") | 15 | file_lock = Lock("file") |
16 | 16 | ||
17 | class MusicFile(Machine): | 17 | class 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 | ||