aboutsummaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-24 14:26:44 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-24 14:26:44 +0200
commit92cc4ce2e6d3372c167117c55069cad8a2e69965 (patch)
treec6db4c0aeb9288f1ff5a203be78604530e23166e /helpers
parentb58b8220c1f3f20e97ca806cf8db0e334b920f4c (diff)
downloadMusicSampler-92cc4ce2e6d3372c167117c55069cad8a2e69965.tar.gz
MusicSampler-92cc4ce2e6d3372c167117c55069cad8a2e69965.tar.zst
MusicSampler-92cc4ce2e6d3372c167117c55069cad8a2e69965.zip
Fix fade_out
Diffstat (limited to 'helpers')
-rw-r--r--helpers/action.py2
-rw-r--r--helpers/music_file.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/helpers/action.py b/helpers/action.py
index 1cb1686..42a08d0 100644
--- a/helpers/action.py
+++ b/helpers/action.py
@@ -69,7 +69,7 @@ class Action:
69 music.stop(fade_out = fade_out) 69 music.stop(fade_out = fade_out)
70 else: 70 else:
71 if fade_out > 0: 71 if fade_out > 0:
72 pygame.fadeout(fade_out * 1000) 72 pygame.fadeout(int(fade_out * 1000))
73 else: 73 else:
74 pygame.mixer.stop() 74 pygame.mixer.stop()
75 75
diff --git a/helpers/music_file.py b/helpers/music_file.py
index 1078459..667c169 100644
--- a/helpers/music_file.py
+++ b/helpers/music_file.py
@@ -42,7 +42,7 @@ class MusicFile:
42 else: 42 else:
43 sound = pygame.mixer.Sound(self.raw_data) 43 sound = pygame.mixer.Sound(self.raw_data)
44 44
45 self.channel().play(sound, fade_ms = fade_in * 1000) 45 self.channel().play(sound, fade_ms = int(fade_in * 1000))
46 self.flag_paused = False 46 self.flag_paused = False
47 47
48 def pause(self): 48 def pause(self):
@@ -55,7 +55,7 @@ class MusicFile:
55 55
56 def stop(self, fade_out = 0): 56 def stop(self, fade_out = 0):
57 if fade_out > 0: 57 if fade_out > 0:
58 self.channel().fadeout(fade_out * 1000) 58 self.channel().fadeout(int(fade_out * 1000))
59 else: 59 else:
60 self.channel().stop() 60 self.channel().stop()
61 61