X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git;a=blobdiff_plain;f=music_sampler.py;h=c10b6349701210a2ce583bb88543559a6fb0dd4f;hp=fd5bd908daf3b81ebe67f9e0b7128d451278e932;hb=6226efcadfe8c3a932c7a948032b433afb0d981d;hpb=cc008de481bf1b67790d48b648d7c8207b9f50ea diff --git a/music_sampler.py b/music_sampler.py index fd5bd90..c10b634 100644 --- a/music_sampler.py +++ b/music_sampler.py @@ -45,15 +45,14 @@ class PlayList(RelativeLayout): open_files = self.parent.ids['Mapping'].open_files self.playlist = [] for music_file in open_files.values(): - if not music_file.is_playing(): + if not music_file.is_in_use(): continue text = "{}/{}".format( helpers.duration_to_min_sec(music_file.sound_position), - helpers.duration_to_min_sec(music_file.sound_duration) - ) + helpers.duration_to_min_sec(music_file.sound_duration)) - if music_file.is_paused(): + if music_file.is_loaded_paused(): self.playlist.append(["⏸", music_file.name, text, False]) else: self.playlist.append(["⏵", music_file.name, text, True]) @@ -63,21 +62,18 @@ class ActionList(RelativeLayout): action_title = StringProperty("") action_list = ListProperty([]) - def update_list(self, key, action_number = 0): + def update_list(self, key, action_descriptions): self.action_title = "actions linked to key {}:".format(key.key_sym) self.action_list = [] - action_descriptions = [action.description() for action in key.actions] - - for index, description in enumerate(action_descriptions): - if index < int(action_number): + for [action, status] in action_descriptions: + if status == "done": icon = "✓" - elif index + 0.5 == action_number: + elif status == "current": icon = "✅" else: icon = " " - - self.action_list.append([icon, description]) + self.action_list.append([icon, action]) class Screen(FloatLayout): pass