added volume getter and setter

This commit is contained in:
milarin 2024-01-13 17:13:14 +01:00
parent 930caa62c2
commit ddb1e3af17
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,10 @@ func IsPaused(socket string) (bool, error) {
return GetProperty[bool](socket, "pause") return GetProperty[bool](socket, "pause")
} }
func GetVolume(socket string) (float64, error) {
return GetProperty[float64](socket, "volume")
}
func GetFilename(socket string) (string, error) { func GetFilename(socket string) (string, error) {
return GetProperty[string](socket, "filename") return GetProperty[string](socket, "filename")
} }

View File

@ -17,3 +17,7 @@ func SetTimePos(socket string, timePos time.Duration) error {
func SetPercentPos(socket string, percentPos float64) error { func SetPercentPos(socket string, percentPos float64) error {
return SetProperty[float64](socket, "percent-pos", percentPos) return SetProperty[float64](socket, "percent-pos", percentPos)
} }
func SetVolume(socket string, volume float64) error {
return SetProperty[float64](socket, "volume", volume)
}