diff --git a/client.go b/client.go new file mode 100644 index 0000000..819ead0 --- /dev/null +++ b/client.go @@ -0,0 +1,15 @@ +package main + +import ( + "github.com/fhs/gompd/mpd" +) + +func togglePlayBack(connection mpd.Client) error { + status, err := connection.Status() + if(status["state"] == "play" && err == nil){ + connection.Pause(true) + } else if(status["state"] == "pause" && err == nil) { + connection.Play(-1) + } + return err +}