]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blob - music_sampler/actions/load_music.py
Add load_all_musics flag and corresponding actions
[perso/Immae/Projets/Python/MusicSampler.git] / music_sampler / actions / load_music.py
1 import threading
2
3 def run(action, music=None, **kwargs):
4 for music in action.music_list(music):
5 if not music.is_loaded(allow_substates=True):
6 threading.Thread(name="MSMusicLoad", target=music.load).start()
7
8 def description(action, music=None, **kwargs):
9 if music is not None:
10 return "load music « {} » to memory".format(music.name)
11 else:
12 return "load all music to memory"