aboutsummaryrefslogblamecommitdiff
path: root/music_sampler/actions/load_music.py
blob: f3e02babb1e94c550116afa0568c69241d253f1b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                           
import threading

def run(action, music=None, **kwargs):
    for music in action.music_list(music):
        if not music.is_loaded(allow_substates=True):
            threading.Thread(name="MSMusicLoad", target=music.load).start()

def description(action, music=None, **kwargs):
    if music is not None:
        return "load music « {} » to memory".format(music.name)
    else:
        return "load all music to memory"