home
·
contact
·
privacy
projects
/
plomrogue2
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f77cab
)
Add song deletion to MusicPlayer.
author
Christian Heller
<c.heller@plomlompom.de>
Mon, 7 Dec 2020 03:16:52 +0000
(
04:16
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Mon, 7 Dec 2020 03:16:52 +0000
(
04:16
+0100)
plomrogue/things.py
patch
|
blob
|
history
diff --git
a/plomrogue/things.py
b/plomrogue/things.py
index c49b204f1c2e320036ab5cd19b4d2b330fec980c..31820541a7ad46a51a76b8a07bf2f412d3b39267 100644
(file)
--- a/
plomrogue/things.py
+++ b/
plomrogue/things.py
@@
-225,6
+225,14
@@
class Thing_MusicPlayer(Thing):
return ['playing']
else:
return ['paused']
+ elif command == 'REMOVE':
+ if len(self.playlist) == 0:
+ return ['playlist already empty']
+ del self.playlist[max(0, self.playlist_index)]
+ self.playlist_index -= 1
+ if self.playlist_index < -1:
+ self.playlist_index = -1
+ return ['removed song']
elif command == 'REWIND':
self.playlist_index = -1
self.next_song_start = datetime.datetime.now()