Пример #1
0
func (p *Player) runPlayCmd(el *geddit.Children) {
	el.IsPlaying()
	UpdatePlayer(*p)

	args := append(p.playerArgs, el.Data.FileLoc)
	cmd := execCommand(p.playerCmd, args...)
	p.currSong = cmd
	cmdRun(cmd)

	deleteFile(el.Data.FileLoc)
	el.FinishedPlaying()
	UpdatePlayer(*p)
}
Пример #2
0
func (p *Player) download(el *geddit.Children) {
	el.IsDownloading()
	UpdatePlayer(*p)

	switch p.runDownloadCmd(el) {
	case nil:
		el.Downloaded()
	default:
		el.CannotDownload()
	}

	UpdatePlayer(*p)
}