]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Fix master volume fade
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 21 Jul 2016 21:25:09 +0000 (23:25 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 21 Jul 2016 21:35:58 +0000 (23:35 +0200)
helpers/action.py
helpers/mapping.py
helpers/music_file.py

index 247e0a9c50ff765cdf73d33490a5895930575a53..eaa419b8d10e237aefd2ec3d4949660d6779f834 100644 (file)
@@ -95,6 +95,8 @@ class Action:
                 if previous is not None:
                     previous.stop(fade_out=fade_out)
                 previous = music
+            else:
+                music.stop(fade_out=fade_out)
 
         if previous is not None:
             previous.stop(fade_out=fade_out, wait=wait)
index 3622f9d8d42086369d59702cf45e6e3cd03fa9d5..43cacf2990a2c0f3f6d70573ce0225dcb765abb1 100644 (file)
@@ -39,6 +39,9 @@ class Mapping(RelativeLayout):
                 self.master_volume)
 
         for music in self.open_files.values():
+            if not (music.is_loaded_playing() or music.is_loaded_paused()):
+                continue
+
             if fade > 0:
                 music.gain_effects.append(GainEffect(
                     "fade",
index aef0adce00c4f55f539b67dd07479bdae7327b7e..b26a1beea56fdcdd440b6f66539d60ec2657d02e 100644 (file)
@@ -70,7 +70,8 @@ class MusicFile(Machine):
         ]
 
         Machine.__init__(self, states=states,
-                transitions=transitions, initial='initial')
+                transitions=transitions, initial='initial',
+                ignore_invalid_triggers=True)
 
         self.volume = 100
         self.mapping = mapping