Skip to content

Commit

Permalink
osc: expose osc-visibility via shared-script-properties
Browse files Browse the repository at this point in the history
osc-visibility can already be changed at runtime via script-message
or other means, but until now there was no way to tell what the
current state is.

Now shared-script-properties/osc-visibility reflects this state.
It's output-only by the osc - changing it does not affect the osc.

Useful if a script wants to change osc-visibility temporarily, and
later restore to its original state.

There's no way to coordinate if more than one script wants to change
it, but that would be a hard problem to solve anyway, even if the
osc itself tried to coordinate such requests from different sources.
  • Loading branch information
avih committed Jul 6, 2021
1 parent f2afae5 commit d2dd4ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions player/lua/osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2803,6 +2803,7 @@ function visibility_mode(mode, no_osd)
end

user_opts.visibility = mode
utils.shared_script_property_set("osc-visibility", mode)

if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
mp.osd_message("OSC visibility: " .. mode)
Expand Down

0 comments on commit d2dd4ca

Please sign in to comment.