'command',
'pause',
'play',
+ 'seek',
'stop',
'stop_all_actions',
'unpause',
if not music.is_not_stopped():
music.play(volume = volume, fade_in = fade_in, start_at = start_at)
+ def seek(self, music = None, value = 0, delta = False, **kwargs):
+ for music in self.music_list(music):
+ music.seek(value = value, delta = delta)
+
def stop(self, music = None, fade_out = 0, wait = False, **kwargs):
previous = None
for music in self.music_list(music):
def stop_all_actions_print(self, **kwargs):
return "stopping all actions"
+ def seek_print(self, music = None, value = 0, delta = False, **kwargs):
+ if delta:
+ if music is not None:
+ return "moving music « {} » by {:+d}s".format(music.name, value)
+ else:
+ return "moving all musics by {:+d}s".format(value)
+ else:
+ if music is not None:
+ return "moving music « {} » to position {}s".format(music.name, value)
+ else:
+ return "moving all musics to position {}s".format(value)
+
def volume_print(self, music = None, value = 100, delta = False, **kwargs):
if delta:
if music is not None:
out_data[:] = audio_segment.ljust(len(out_data), b'\0')
+ def seek(self, value = 0, delta = False):
+ # We don't want to do that while stopping
+ if not (self.is_loaded_playing() or self.is_loaded_paused()):
+ return
+ with self.music_lock:
+ self.current_frame = max(0, int(delta) * self.current_frame + int(value * self.audio_segment.frame_rate))
+
def stop(self, fade_out = 0, wait = False):
if self.is_loaded_playing():
ms = int(self.sound_position * 1000)