Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
95d2a1e1a4 | |||
0a02d8ffc5 | |||
e5f6becf97 |
@ -53,10 +53,6 @@ func GetPlaylist(socket string) ([]PlaylistEntry, error) {
|
|||||||
return GetProperty[[]PlaylistEntry](socket, "playlist")
|
return GetProperty[[]PlaylistEntry](socket, "playlist")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPause(socket string) (bool, error) {
|
|
||||||
return GetProperty[bool](socket, "pause")
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetPlaylistPosition(socket string) (int, error) {
|
func GetPlaylistPosition(socket string) (int, error) {
|
||||||
return GetProperty[int](socket, "playlist-pos")
|
return GetProperty[int](socket, "playlist-pos")
|
||||||
}
|
}
|
||||||
|
18
props_set.go
18
props_set.go
@ -3,25 +3,33 @@ package mpvipc
|
|||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
func SetFullscreen(socket string, fullscreen bool) error {
|
func SetFullscreen(socket string, fullscreen bool) error {
|
||||||
return SetProperty[bool](socket, "fullscreen", fullscreen)
|
return SetProperty(socket, "fullscreen", fullscreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetPause(socket string, pause bool) error {
|
func SetPause(socket string, pause bool) error {
|
||||||
return SetProperty[bool](socket, "pause", pause)
|
return SetProperty(socket, "pause", pause)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetTimePos(socket string, timePos time.Duration) error {
|
func SetTimePos(socket string, timePos time.Duration) error {
|
||||||
return SetProperty[float64](socket, "time-pos", float64(timePos)/float64(time.Second))
|
return SetProperty(socket, "time-pos", float64(timePos)/float64(time.Second))
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetPercentPos(socket string, percentPos float64) error {
|
func SetPercentPos(socket string, percentPos float64) error {
|
||||||
return SetProperty[float64](socket, "percent-pos", percentPos)
|
return SetProperty(socket, "percent-pos", percentPos)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetVolume(socket string, volume float64) error {
|
func SetVolume(socket string, volume float64) error {
|
||||||
return SetProperty[float64](socket, "volume", volume)
|
return SetProperty(socket, "volume", volume)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetPlaylistPosition(socket string, index int) error {
|
func SetPlaylistPosition(socket string, index int) error {
|
||||||
return SetProperty(socket, "playlist-pos", index)
|
return SetProperty(socket, "playlist-pos", index)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetLoopFile(socket string, loopFile bool) error {
|
||||||
|
return SetProperty(socket, "loop-file", loopFile)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetLoopPlaylist(socket string, loopPlaylist bool) error {
|
||||||
|
return SetProperty(socket, "loop-playlist", loopPlaylist)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user