aboutsummaryrefslogtreecommitdiff
path: root/music/playqueue.go
diff options
context:
space:
mode:
Diffstat (limited to 'music/playqueue.go')
-rw-r--r--music/playqueue.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/music/playqueue.go b/music/playqueue.go
index 7c21b9b..235007e 100644
--- a/music/playqueue.go
+++ b/music/playqueue.go
@@ -43,9 +43,17 @@ func (q *Queue) Append(s *subsonic.Child) {
43 q.songs = append(q.songs, s) 43 q.songs = append(q.songs, s)
44} 44}
45 45
46func (q *Queue) Insert(i int, s *subsonic.Child) {
47 q.songs = append(q.songs[:i], append([]*subsonic.Child{s}, q.songs[i:]...)...)
48}
49
46func (q *Queue) Clear() { 50func (q *Queue) Clear() {
47 q.songs = make([]*subsonic.Child, 0) 51 q.songs = make([]*subsonic.Child, 0)
48 speaker.Clear() 52 if q.isPaused {
53 q.TogglePause()
54 }
55 q.Stop()
56 q.triggerChange()
49} 57}
50 58
51func (q *Queue) PlaySong(s *subsonic.Child) error { 59func (q *Queue) PlaySong(s *subsonic.Child) error {