From ddb1e3af17f3cb96b6e772fa4ed8db393bb530fc Mon Sep 17 00:00:00 2001 From: milarin Date: Sat, 13 Jan 2024 17:13:14 +0100 Subject: [PATCH] added volume getter and setter --- props_get.go | 4 ++++ props_set.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/props_get.go b/props_get.go index f850a76..6b1ab1a 100644 --- a/props_get.go +++ b/props_get.go @@ -17,6 +17,10 @@ func IsPaused(socket string) (bool, error) { return GetProperty[bool](socket, "pause") } +func GetVolume(socket string) (float64, error) { + return GetProperty[float64](socket, "volume") +} + func GetFilename(socket string) (string, error) { return GetProperty[string](socket, "filename") } diff --git a/props_set.go b/props_set.go index c0dc0d1..dee492b 100644 --- a/props_set.go +++ b/props_set.go @@ -17,3 +17,7 @@ func SetTimePos(socket string, timePos time.Duration) error { func SetPercentPos(socket string, percentPos float64) error { return SetProperty[float64](socket, "percent-pos", percentPos) } + +func SetVolume(socket string, volume float64) error { + return SetProperty[float64](socket, "volume", volume) +}