-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSC logo conflict #55
Comments
How about I store the browser open status in the
This would just be easier than adding extra commands and options. |
I just checked and |
I didn't really know about shared-script-properties and profiles is something I've never used. I'll take a look, thanks! |
I think it would be ideal if things would work without every user having to search for a solution. Maybe determine if a logo issue is possible by checking:
If a logo issue is possible, hide and restore the OSC. |
Maybe it would be totally fine to always hide and restore the osc when the logo is visible (playlist-pos is -1), because the moment a user shows the menu, he is interested in the menu and not in the logo, simple and good solution. |
It's true that I could automatically hide the OSC from within the script, and it might add a little extra functionality over using the auto-profiles. But, that would require me to implement and maintain support for the enabling/disabling logic (when to enable/disable, what to do if the user changes the settings, etc), which puts an extra burden on me for generally pretty insignificant improvements. On the other hand, leaving it up to the user's auto-profiles gives them full control over what conditions are required (and I don't have to maintain anything). In addition, it allows for setting any arbitrary option using the profile rather than just being limited to the OSC visibility. What you suggested about hiding the OSC only when So what I'm thinking is: save the What do you think? |
This is the example I'd give, seems to work quite well: [hide-logo]
profile-cond=shared_script_properties["file_browser-open"] == "yes" and idle_active
profile-restore=copy-equal
script-opts-append=osc-visibility=never Edit: changed |
If it works, and you document it, then it might indeed be a great solution. |
This allows users to set conditional auto-profiles depending on the open state of the browser Also added a section of the README that explains this and shows an example.
I have pushed support for the feature. Please test it out and let me know what you think. |
It works, with adjustment in mpv.net too, thanks! |
Out of curiosity, what adjustments were needed? |
The mpv.net logo is added with overlay-add, I had to add: ObservePropertyString("script-opts", value => {
if (value.ContainsEx("osc-visibility=never"))
HideLogo();
else if (GetPropertyInt("playlist-pos") == -1)
ShowLogo();
}); I found it astounding how your solution works, I didn't know about shared_script_properties and did not expect that changes to it can be observed, since it's a dictionary, and I also did not expect the osc reacts to changes of script-opts. |
It could make sense, renaming the variable to |
Are there any edge cases that not using |
The issue is that Both options have positives and downsides, and it is up to the user to decide which they want to use. I chose to use A 3rd solution to this issue is to use two profiles instead of one: [hide-logo]
profile-cond=shared_script_properties["file_browser-open"] == "yes" and idle_active
script-opts-append=osc-visibility=never
[unhide-logo]
profile-cond=shared_script_properties["osc-visibility"] == "never" and ( shared_script_properties["file_browser-open"] == "no" or not idle_active )
script-opts-append=osc-visibility=auto This will successfully avoid any conflicts with other This is what I meant when I said above that implementing the feature inside the script would be slightly more powerful, but in practice I doubt the vast majority of people are going to run into these problems. |
Seems making a standalone script to control osc's visibility would be more safe. (If upstream show no interest in improving original osc script.) |
This is actually more difficult to implement because it needs to adapt to other OSC scripts. |
If other menu scripts put their status in |
I have done it people, I have come up with a way to exploit lua syntax and the auto-profiles script to save a record of the original [hide-logo]
profile-cond=shared_script_properties["file_browser-open"] == "yes" and idle_active and (function() osc_visibility_original = osc_visibility_original or shared_script_properties["osc-visibility"] ; return true end )()
script-opts-append=osc-visibility=never
[unhide-logo-auto]
profile-cond=shared_script_properties["osc-visibility"] == "never" and osc_visibility_original == "auto" and ( shared_script_properties["file_browser-open"] == "no" or not idle_active ) and (function() osc_visibility_original = nil ; return true end )()
script-opts-append=osc-visibility=auto
[unhide-logo-always]
profile-cond=shared_script_properties["osc-visibility"] == "never" and osc_visibility_original == "always" and ( shared_script_properties["file_browser-open"] == "no" or not idle_active ) and (function() osc_visibility_original = nil ; return true end )()
script-opts-append=osc-visibility=always Theoretically you could use this method to add any Lua logic inside the inline function and be able to write any script behaviour directly in mpv.conf. Edit: it would just be all impossible to read since it is all in one line |
This is mainly for other user scripts that may conflict with the osc logo in some way. While you can use script-message and shared-script-properties (highly discouraged in the documentation for some reason) to work around this, there's still some brittle edge cases and complicated logic that can pop up. Adding an option for these two things (the logo and the "drop files..." text) is really trivial and would make things easier for scripts. Discussed in a couple of issues below: mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. While you can use script-message and shared-script-properties (highly discouraged in the documentation for some reason) to work around this, there's still some brittle edge cases and complicated logic that can pop up. Adding an option for these two things (the logo and the "drop files..." text) is really trivial and would make things easier for scripts. Discussed in a couple of issues below: mpv-player#10201 CogentRedTester/mpv-file-browser#55
Another option that I just became aware of is to use the [hide-logo]
profile-cond=shared_script_properties["file_browser-open"] == "yes" and idle_active
profile-restore=copy
osc=no This bypasses all of the gotchas that come from modifying script-opts and may be the cleanest solution, though there might be other side-effects that I'm not aware of. Edit: I may replace the example in the README with this one unless someone knows about any problems with it. |
It is suggested to add the following: [hide-logo]
profile-cond=shared_script_properties["file_browser-open"] == "yes" and idle_active
profile-restore=copy-equal
script-opts-append=scriptname*-visibility=never |
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlelogo option disables all logo related things (including the santa hat) if it is set to "no". A new script message (osc-idlelogo) is also added so users and scripts can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found on the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. #10201 CogentRedTester/mpv-file-browser#55
What I do now is send:
This is supported by osc.lua and also by the upcoming mpv.net release. One problem I had is that osc.lua generates an unwanted OSD message, which I suppress with a script: silent-invoke.lua:
So my full input command is:
In my osm script, I also send the message with ensured silence:
|
You can use |
That makes it much easier, thanks for pointing out! |
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player/mpv#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
This is mainly for other user scripts that may conflict with the osc logo in some way. Although it is possible to listen for shared-script-properties, this has many edge cases that could easily pop up. A user could want other OSC things to happen at the same time (say osc-message). They just don't want the logo. The idlescreen option disables all idlescreen related things (including the santa hat) if it is set to "no". A new script message (osc-idlescreen) is also added so users can easily toggle the value (passing "cycle" or just explictly setting "yes" or "no"). Some more discussion on this is found in the below github issues. mpv-player#10201 CogentRedTester/mpv-file-browser#55
Proposed solution which is not perfect but good enough:
Provide 2 new conf options:
show-command
Command executed before show.
Users can set this to:
script-message osc-visibility never
hide-command
Command executed after hide.
Users can set this to:
script-message osc-visibility auto
More info:
mpv-player/mpv#10201
The text was updated successfully, but these errors were encountered: