aboutsummaryrefslogtreecommitdiff
path: root/music_sampler/actions/unload_music.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-09-19 15:57:26 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-09-19 16:00:43 +0200
commit6dc040edf2f31497d4492c159397c4634037be66 (patch)
tree93da3ca7f67fc3012e3793870c6f6a9b4e96220c /music_sampler/actions/unload_music.py
parenta9324e30da6292f53f008f1b827779c7f8e2fcdf (diff)
downloadMusicSampler-6dc040edf2f31497d4492c159397c4634037be66.tar.gz
MusicSampler-6dc040edf2f31497d4492c159397c4634037be66.tar.zst
MusicSampler-6dc040edf2f31497d4492c159397c4634037be66.zip
Add load_all_musics flag and corresponding actions
Diffstat (limited to 'music_sampler/actions/unload_music.py')
-rw-r--r--music_sampler/actions/unload_music.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/music_sampler/actions/unload_music.py b/music_sampler/actions/unload_music.py
new file mode 100644
index 0000000..b3de316
--- /dev/null
+++ b/music_sampler/actions/unload_music.py
@@ -0,0 +1,10 @@
1def run(action, music=None, **kwargs):
2 for music in action.music_list(music):
3 if music.is_unloadable():
4 music.unload()
5
6def description(action, music=None, **kwargs):
7 if music is not None:
8 return "unload music « {} » from memory".format(music.name)
9 else:
10 return "unload all music from memory"