All the Client related activities are in client.go
This commit is contained in:
parent
17ad4df66b
commit
c0f3b6e920
15
client.go
Normal file
15
client.go
Normal file
@ -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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user