aboutsummaryrefslogtreecommitdiff
path: root/helpers/action.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-27 10:27:35 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-27 10:27:35 +0200
commit98ff43054fe94f333e2deda2906cd62593ded1d8 (patch)
treee8cfe3df72c6a02bd1d8fbe565b1a8b9185c79b2 /helpers/action.py
parent65ec4d2a87bfe0dcf1250ec8dc61225d4ed66325 (diff)
downloadMusicSampler-98ff43054fe94f333e2deda2906cd62593ded1d8.tar.gz
MusicSampler-98ff43054fe94f333e2deda2906cd62593ded1d8.tar.zst
MusicSampler-98ff43054fe94f333e2deda2906cd62593ded1d8.zip
Put time duration in playlist
Diffstat (limited to 'helpers/action.py')
-rw-r--r--helpers/action.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/helpers/action.py b/helpers/action.py
index aff61e7..327d42f 100644
--- a/helpers/action.py
+++ b/helpers/action.py
@@ -31,7 +31,6 @@ class Action:
31 def run(self): 31 def run(self):
32 print(self.description()) 32 print(self.description())
33 getattr(self, self.action)(**self.arguments) 33 getattr(self, self.action)(**self.arguments)
34 #pygame.event.post(pygame.event.Event(pygame.USEREVENT))
35 34
36 def description(self): 35 def description(self):
37 return getattr(self, self.action + "_print")(**self.arguments) 36 return getattr(self, self.action + "_print")(**self.arguments)
@@ -43,13 +42,17 @@ class Action:
43 if music is not None: 42 if music is not None:
44 music.pause() 43 music.pause()
45 else: 44 else:
46 pygame.mixer.pause() 45 for music in self.key.parent.open_files.values():
46 if music.is_playing() and not music.is_paused():
47 music.pause()
47 48
48 def unpause(self, music = None, **kwargs): 49 def unpause(self, music = None, **kwargs):
49 if music is not None: 50 if music is not None:
50 music.unpause() 51 music.unpause()
51 else: 52 else:
52 pygame.mixer.unpause() 53 for music in self.key.parent.open_files.values():
54 if music.is_playing() and music.is_paused():
55 music.unpause()
53 56
54 def play(self, music = None, fade_in = 0, start_at = 0, 57 def play(self, music = None, fade_in = 0, start_at = 0,
55 restart_if_running = False, volume = 100, **kwargs): 58 restart_if_running = False, volume = 100, **kwargs):