From 98ff43054fe94f333e2deda2906cd62593ded1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 27 Jun 2016 10:27:35 +0200 Subject: Put time duration in playlist --- helpers/action.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'helpers/action.py') 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: def run(self): print(self.description()) getattr(self, self.action)(**self.arguments) - #pygame.event.post(pygame.event.Event(pygame.USEREVENT)) def description(self): return getattr(self, self.action + "_print")(**self.arguments) @@ -43,13 +42,17 @@ class Action: if music is not None: music.pause() else: - pygame.mixer.pause() + for music in self.key.parent.open_files.values(): + if music.is_playing() and not music.is_paused(): + music.pause() def unpause(self, music = None, **kwargs): if music is not None: music.unpause() else: - pygame.mixer.unpause() + for music in self.key.parent.open_files.values(): + if music.is_playing() and music.is_paused(): + music.unpause() def play(self, music = None, fade_in = 0, start_at = 0, restart_if_running = False, volume = 100, **kwargs): -- cgit v1.2.3