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) }
func (p *Player) download(el *geddit.Children) { el.IsDownloading() UpdatePlayer(*p) switch p.runDownloadCmd(el) { case nil: el.Downloaded() default: el.CannotDownload() } UpdatePlayer(*p) }