mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
small refactor
This commit is contained in:
parent
fa1bcb1f70
commit
0e85518099
@ -137,7 +137,7 @@ func (p *Player) Run() {
|
||||
p.done = done
|
||||
|
||||
sstreamer := beep.Seq(streamer, beep.Callback(func() {
|
||||
// prevents from sending done channel is the song is skipped
|
||||
// prevents from sending done channel if the song is skipped
|
||||
if !p.isSkipped {
|
||||
done <- true
|
||||
} else {
|
||||
@ -145,6 +145,7 @@ func (p *Player) Run() {
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
ctrl := &beep.Ctrl{Streamer: sstreamer, Paused: false}
|
||||
|
||||
resampler := beep.ResampleRatio(4, 1, ctrl)
|
||||
@ -203,10 +204,10 @@ next:
|
||||
select {
|
||||
case <-done:
|
||||
close(done)
|
||||
p.position = 0
|
||||
p.current = ""
|
||||
p.position = 0
|
||||
p.current = ""
|
||||
p.IsRunning = false
|
||||
p.format = nil
|
||||
p.format = nil
|
||||
|
||||
if len(p.queue) != 0 {
|
||||
go p.Run()
|
||||
|
Loading…
x
Reference in New Issue
Block a user