added LoopState datatype for more precise control
This commit is contained in:
18
props_get.go
18
props_get.go
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user