]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Cleanup Machine use
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 25 Jul 2016 09:30:32 +0000 (11:30 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 25 Jul 2016 09:30:32 +0000 (11:30 +0200)
helpers/music_file.py

index b0e218fb77856917e8361cfcde5c231ce8577215..017fc596e236e14c700bff5bb88c746e56d38372 100644 (file)
@@ -14,7 +14,7 @@ from .music_effect import GainEffect
 
 file_lock = Lock("file")
 
 
 file_lock = Lock("file")
 
-class MusicFile(Machine):
+class MusicFile:
     def __init__(self, filename, mapping, name=None, gain=1):
         states = [
             'initial',
     def __init__(self, filename, mapping, name=None, gain=1):
         states = [
             'initial',
@@ -22,7 +22,13 @@ class MusicFile(Machine):
             'failed',
             {
                 'name': 'loaded',
             'failed',
             {
                 'name': 'loaded',
-                'children': ['stopped', 'playing', 'paused', 'stopping']
+                'children': [
+                    'stopped',
+                    'playing',
+                    'paused',
+                    'stopping',
+                    'stopped'
+                ]
             }
         ]
         transitions = [
             }
         ]
         transitions = [
@@ -69,7 +75,7 @@ class MusicFile(Machine):
             }
         ]
 
             }
         ]
 
-        Machine.__init__(self, states=states,
+        Machine(model=self, states=states,
                 transitions=transitions, initial='initial',
                 ignore_invalid_triggers=True)
 
                 transitions=transitions, initial='initial',
                 ignore_invalid_triggers=True)