property display-name added

This commit is contained in:
milarin 2023-12-20 23:22:21 +01:00
parent 6cd31fc715
commit 9baa6b17e7
2 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,10 @@ import "time"
// list of (almost) all properties can be found in official docs: // list of (almost) all properties can be found in official docs:
// https://mpv.io/manual/master/#properties // https://mpv.io/manual/master/#properties
func GetDisplayNames(socket string) ([]string, error) {
return GetProperty[[]string](socket, "display-names")
}
func IsFullscreen(socket string) (bool, error) { func IsFullscreen(socket string) (bool, error) {
return GetProperty[bool](socket, "fullscreen") return GetProperty[bool](socket, "fullscreen")
} }

View File

@ -7,6 +7,10 @@ import (
"git.milar.in/milarin/channel" "git.milar.in/milarin/channel"
) )
func ObserveDisplayNames(ctx context.Context, socket string) (<-chan []string, error) {
return ObserveProperty[[]string](ctx, socket, "display-names")
}
func ObserveFullscreen(ctx context.Context, socket string) (<-chan bool, error) { func ObserveFullscreen(ctx context.Context, socket string) (<-chan bool, error) {
return ObserveProperty[bool](ctx, socket, "fullscreen") return ObserveProperty[bool](ctx, socket, "fullscreen")
} }