aboutsummaryrefslogtreecommitdiff
path: root/music_sampler.py
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-27 10:27:35 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2016-06-27 10:27:35 +0200
commit98ff43054fe94f333e2deda2906cd62593ded1d8 (patch)
treee8cfe3df72c6a02bd1d8fbe565b1a8b9185c79b2 /music_sampler.py
parent65ec4d2a87bfe0dcf1250ec8dc61225d4ed66325 (diff)
downloadMusicSampler-98ff43054fe94f333e2deda2906cd62593ded1d8.tar.gz
MusicSampler-98ff43054fe94f333e2deda2906cd62593ded1d8.tar.zst
MusicSampler-98ff43054fe94f333e2deda2906cd62593ded1d8.zip
Put time duration in playlist
Diffstat (limited to 'music_sampler.py')
-rw-r--r--music_sampler.py12
1 files changed, 9 insertions, 3 deletions
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):
18 third_key = StringProperty("") 18 third_key = StringProperty("")
19 19
20 def append(self, value): 20 def append(self, value):
21 self.keylist = [value] + self.keylist 21 self.keylist.insert(0, value)
22 22
23 def on_keylist(self, instance, new_key_list): 23 def on_keylist(self, instance, new_key_list):
24 if len(self.keylist) > 0: 24 if len(self.keylist) > 0:
@@ -44,10 +44,16 @@ class PlayList(RelativeLayout):
44 for music_file in open_files.values(): 44 for music_file in open_files.values():
45 if not music_file.is_playing(): 45 if not music_file.is_playing():
46 continue 46 continue
47
48 text = "{}/{}".format(
49 helpers.duration_to_min_sec(music_file.sound_position),
50 helpers.duration_to_min_sec(music_file.sound_duration)
51 )
52
47 if music_file.is_paused(): 53 if music_file.is_paused():
48 self.playlist.append(["⏸", music_file.name, False]) 54 self.playlist.append(["⏸", music_file.name, text, False])
49 else: 55 else:
50 self.playlist.append(["⏵", music_file.name, True]) 56 self.playlist.append(["⏵", music_file.name, text, True])
51 57
52 58
53class ActionList(RelativeLayout): 59class ActionList(RelativeLayout):