from . import interrupt_wait
+from . import load_music
from . import pause
from . import pause_wait
from . import play
from . import seek
from . import stop
from . import stop_all_actions
+from . import unload_music
from . import unpause
from . import unpause_wait
from . import volume
--- /dev/null
+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"
--- /dev/null
+def run(action, music=None, **kwargs):
+ for music in action.music_list(music):
+ if music.is_unloadable():
+ music.unload()
+
+def description(action, music=None, **kwargs):
+ if music is not None:
+ return "unload music « {} » from memory".format(music.name)
+ else:
+ return "unload all music from memory"
'help_no': _("Don't show warning when focus is lost"),
'type': 'boolean'
},
+ 'load_all_musics': {
+ 'default': True,
+ 'help_yes': _("Load all the musics at launch time (default)"),
+ 'help_no': _("Don't load all the musics at launch time (use it if you \
+ have memory problems)"),
+ 'type': 'boolean'
+ },
'list_devices': {
'help': _("List available sound devices"),
'type': 'action'
'language',
'list_devices',
'device',
+ 'load_all_musics',
]
def parse_args():
argv = sys.argv[1 :]