- if not music.is_not_stopped():
- music.play(volume = volume, fade_in = fade_in, start_at = start_at)
-
- def stop(self, music = None, fade_out = 0, **kwargs):
- for music in self.music_list(music):
- if music.is_loaded_paused() or music.is_loaded_playing():
- music.stop(fade_out = fade_out)
-
- def stop_all_actions(self, **kwargs):
- self.key.parent.stop_all_running()
-
- def volume(self, music = None, value = 100, **kwargs):
- if music is not None:
- music.set_volume(value)
- else:
- # FIXME: todo
- pass
-
- def wait(self, duration = 0, music = None, **kwargs):
- self.sleep_event = threading.Event()
-
- if music is not None:
- music.wait_end()
-
- threading.Timer(duration, self.sleep_event.set).start()
- self.sleep_event.wait()
-
- # Action messages
- def command_print(self, command = "", **kwargs):
- return "running command {}".format(command)
-
- def pause_print(self, music = None, **kwargs):
- if music is not None:
- return "pausing « {} »".format(music.name)