All the Client related activities are in client.go

This commit is contained in:
aditya-K2 2021-10-09 17:21:47 +05:30
parent 17ad4df66b
commit c0f3b6e920

15
client.go Normal file
View 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
}