aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-21 23:25:09 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-07-21 23:35:58 +0200
commit513226699e5cb5776bd71ee6bb2ada87a43c4dee (patch)
tree52939eedb5d4b9f8a81830f17f6cbc6227c77802
parent940ccd88e7757e9bbb43288ed53a4ec4804bfbe8 (diff)
downloadMusicSampler-513226699e5cb5776bd71ee6bb2ada87a43c4dee.tar.gz
MusicSampler-513226699e5cb5776bd71ee6bb2ada87a43c4dee.tar.zst
MusicSampler-513226699e5cb5776bd71ee6bb2ada87a43c4dee.zip
Fix master volume fade
-rw-r--r--helpers/action.py2
-rw-r--r--helpers/mapping.py3
-rw-r--r--helpers/music_file.py3
3 files changed, 7 insertions, 1 deletions
diff --git a/helpers/action.py b/helpers/action.py
index 247e0a9..eaa419b 100644
--- a/helpers/action.py
+++ b/helpers/action.py
@@ -95,6 +95,8 @@ class Action:
95 if previous is not None: 95 if previous is not None:
96 previous.stop(fade_out=fade_out) 96 previous.stop(fade_out=fade_out)
97 previous = music 97 previous = music
98 else:
99 music.stop(fade_out=fade_out)
98 100
99 if previous is not None: 101 if previous is not None:
100 previous.stop(fade_out=fade_out, wait=wait) 102 previous.stop(fade_out=fade_out, wait=wait)
diff --git a/helpers/mapping.py b/helpers/mapping.py
index 3622f9d..43cacf2 100644
--- a/helpers/mapping.py
+++ b/helpers/mapping.py
@@ -39,6 +39,9 @@ class Mapping(RelativeLayout):
39 self.master_volume) 39 self.master_volume)
40 40
41 for music in self.open_files.values(): 41 for music in self.open_files.values():
42 if not (music.is_loaded_playing() or music.is_loaded_paused()):
43 continue
44
42 if fade > 0: 45 if fade > 0:
43 music.gain_effects.append(GainEffect( 46 music.gain_effects.append(GainEffect(
44 "fade", 47 "fade",
diff --git a/helpers/music_file.py b/helpers/music_file.py
index aef0adc..b26a1be 100644
--- a/helpers/music_file.py
+++ b/helpers/music_file.py
@@ -70,7 +70,8 @@ class MusicFile(Machine):
70 ] 70 ]
71 71
72 Machine.__init__(self, states=states, 72 Machine.__init__(self, states=states,
73 transitions=transitions, initial='initial') 73 transitions=transitions, initial='initial',
74 ignore_invalid_triggers=True)
74 75
75 self.volume = 100 76 self.volume = 100
76 self.mapping = mapping 77 self.mapping = mapping