added LoopState datatype for more precise control

This commit is contained in:
2025-08-30 15:23:33 +02:00
parent 95d2a1e1a4
commit 6fc6cec502
4 changed files with 86 additions and 10 deletions

View File

@ -157,10 +157,20 @@ func GetPropertyList(socket string) ([]string, error) {
return GetProperty[[]string](socket, "property-list")
}
func GetLoopFile(socket string) (bool, error) {
return GetProperty[bool](socket, "loop-file")
func GetLoopFile(socket string) (LoopState, error) {
value, err := GetProperty[any](socket, "loop-file")
if err != nil {
return LoopInvalid, err
}
return ParseLoopState(value)
}
func GetLoopPlaylist(socket string) (bool, error) {
return GetProperty[bool](socket, "loop-playlist")
func GetLoopPlaylist(socket string) (LoopState, error) {
value, err := GetProperty[any](socket, "loop-playlist")
if err != nil {
return LoopInvalid, err
}
return ParseLoopState(value)
}