mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-05-08 19:29:50 +08:00
cleanup player.go
This commit is contained in:
parent
9b1de11d5b
commit
6e742dcfda
11
player.go
11
player.go
@ -52,11 +52,6 @@ func newPlayer() *Player {
|
|||||||
|
|
||||||
func (p *Player) run(currSong *AudioFile) error {
|
func (p *Player) run(currSong *AudioFile) error {
|
||||||
|
|
||||||
// if p.streamSeekCloser != nil {
|
|
||||||
// speaker.Lock()
|
|
||||||
// p.streamSeekCloser.Close()
|
|
||||||
// speaker.Unlock()
|
|
||||||
// }
|
|
||||||
p.isSkipped = make(chan bool, 1)
|
p.isSkipped = make(chan bool, 1)
|
||||||
f, err := os.Open(currSong.path)
|
f, err := os.Open(currSong.path)
|
||||||
|
|
||||||
@ -67,7 +62,6 @@ func (p *Player) run(currSong *AudioFile) error {
|
|||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
stream, format, err := mp3.Decode(f)
|
stream, format, err := mp3.Decode(f)
|
||||||
// p.streamSeekCloser, *(p.format), err = mp3.Decode(f)
|
|
||||||
|
|
||||||
p.streamSeekCloser = stream
|
p.streamSeekCloser = stream
|
||||||
p.format = &format
|
p.format = &format
|
||||||
@ -132,11 +126,6 @@ func (p *Player) run(currSong *AudioFile) error {
|
|||||||
p.position = p.getPosition()
|
p.position = p.getPosition()
|
||||||
p.isRunning = true
|
p.isRunning = true
|
||||||
|
|
||||||
// if p.isLoop {
|
|
||||||
// gomu.queue.enqueue(currSong)
|
|
||||||
// gomu.app.Draw()
|
|
||||||
// }
|
|
||||||
|
|
||||||
gomu.playingBar.newProgress(currSong.name, int(p.length.Seconds()))
|
gomu.playingBar.newProgress(currSong.name, int(p.length.Seconds()))
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user