def on_seek(player, song, pos): events.append(pos) during_events.append(player.get_position())
def on_started(player, song): assert player.get_position() == 0 player.seek(100)
def seek_relative(seconds): current = player.get_position() current += seconds * 1000 current = min(player.song("~#length") * 1000 -1, current) current = max(0, current) player.seek(current)