From 98ff43054fe94f333e2deda2906cd62593ded1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 27 Jun 2016 10:27:35 +0200 Subject: Put time duration in playlist --- music_sampler.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'music_sampler.py') diff --git a/music_sampler.py b/music_sampler.py index 5e61466..7bd7513 100644 --- a/music_sampler.py +++ b/music_sampler.py @@ -18,7 +18,7 @@ class KeyList(RelativeLayout): third_key = StringProperty("") def append(self, value): - self.keylist = [value] + self.keylist + self.keylist.insert(0, value) def on_keylist(self, instance, new_key_list): if len(self.keylist) > 0: @@ -44,10 +44,16 @@ class PlayList(RelativeLayout): for music_file in open_files.values(): if not music_file.is_playing(): continue + + text = "{}/{}".format( + helpers.duration_to_min_sec(music_file.sound_position), + helpers.duration_to_min_sec(music_file.sound_duration) + ) + if music_file.is_paused(): - self.playlist.append(["⏸", music_file.name, False]) + self.playlist.append(["⏸", music_file.name, text, False]) else: - self.playlist.append(["⏵", music_file.name, True]) + self.playlist.append(["⏵", music_file.name, text, True]) class ActionList(RelativeLayout): -- cgit v1.2.3