aboutsummaryrefslogtreecommitdiff
path: root/commands.go
diff options
context:
space:
mode:
authorNathan Perry <avaglir@gmail.com>2017-07-29 18:02:10 -0400
committerNathan Perry <avaglir@gmail.com>2017-07-29 18:02:10 -0400
commit9bd93434fbefc56ac6c154c569e064cc7e5f956d (patch)
treef1aee399f1fc0ecd3d61c64654c83b1bbbcd8fb4 /commands.go
parentdeac22dffb03829216138d90e74423384b4c2c80 (diff)
working on adding playback commandsgo
Diffstat (limited to 'commands.go')
-rw-r--r--commands.go39
1 files changed, 17 insertions, 22 deletions
diff --git a/commands.go b/commands.go
index 0157adb..428e87a 100644
--- a/commands.go
+++ b/commands.go
@@ -4,40 +4,35 @@ import "github.com/mammothbane/thulani-go/downloader"
var cmdMap = map[string]func(*messageCtx){
"help": printHelp,
- "skip": commandNotImplemented,
- "pause": commandNotImplemented,
- "resume": commandNotImplemented,
- "sudoku": commandNotImplemented,
- "die": commandNotImplemented,
- "list": commandNotImplemented,
- "queue": commandNotImplemented,
+ "skip": skip,
+ "pause": pause,
+ "resume": resume,
+ "sudoku": stop,
+ "die": stop,
+ "list": list,
+ "queue": list,
}
func printHelp(c *messageCtx) {
c.sendMessage(help, c.Tts)
}
-func commandNotImplemented(c *messageCtx) {
- log.Errorf("%q not implemented", c.Command)
- c.sendMessage("not implemented", c.Tts)
+func skip(_ *messageCtx) {
+ manager.PlayState <- downloader.Play
}
-func skip(c *messageCtx) {
- log.Error("skip not implemented")
+func resume(_ *messageCtx) {
+ manager.PlayState <- downloader.Play
}
-func resume(c *messageCtx) {
- log.Error("skip not implemented")
+func pause(_ *messageCtx) {
+ manager.PlayState <- downloader.Pause
}
-func pause(c *messageCtx) {
- log.Error("skip not implemented")
+func stop(_ *messageCtx) {
+ manager.PlayState <- downloader.Clear
}
-func stop(c *messageCtx) {
- log.Error("skip not implemented")
-}
-
-func list(c *messageCtx) {
- log.Error("skip not implemented")
+func list(_ *messageCtx) {
+ log.Error("list not implemented")
}