-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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.lua: open select.lua by clicking buttons #15031
Conversation
Download the artifacts for this pull request: |
I think right now choosing middle button is the right way, since it would be considered a sudden change. It's very unfortunate, but many are not aware of In time, can easily switch it to right click. Hell, lazy future scenario, make it a Edit: Left, right and middle. |
36032f5
to
51af459
Compare
Now that I think about it, mbtn_mid is not that discoverable, especially on mobile devices, like laptops. But making breaking changes for OSC, like changing mbtn_right might not be welcome by users, but maybe it is better thing to do? |
It's a tough decision to make, any choice will have its downsides and caveats. Getting it out there in a mid safe way is honestly a wise choice. Then wait for feedback and hear the dominating request, or more realistically, once it's actively used, the "choice" will become obvious. Because, and I'm assuming here, this will be a solid replacement for If anything, this is a temporary confusion of a choice. |
Rebinding |
Personally, I'm used to using the middle button to show playlist and available tracks. The new behavior is also annoying that after the middle click brings up the console, I can't dismiss it without using the keyboard. Previously the list will disappear by itself after a few seconds. And the playlist selector doesn't show the current item: it only highlights initially, and it changes with the slightest mouse movement. I think it's better to make these bindings user configurable instead. There are too much hard coding in OSC in this regard. |
I can bind Making everything configurable would be tricky since most clicks call internal functions rather than string commands and there are dozens of handlers. |
Sounds reasonable.
Lots of them already have associated script messages which can be invoked with |
I guess when changing UI code we cannot avoid changes. Else we will keep the same osc.lua forever. |
Hear, hear. Embrace it. This is the same hesitation I was talking about when users fear a new change, In fact, the only thing that would stop this from being "main" from the get-go, is the font size scale to window issue. I simply added a note about it. |
I think we can add
I can reopen #14088 if requested. |
Remove it, if you don't like it. |
Requested in mpv-player#14087 (comment) and mpv-player#15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works, as expected.
I thought we were going to make bindings configurable first? |
Ok, if you prefer to do this in this pr. |
Requested in mpv-player#14087 (comment) and mpv-player#15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
Requested in mpv-player#14087 (comment) and mpv-player#15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
Requested in mpv-player#14087 (comment) and mpv-player#15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
After a discussion at mpv that started with this: mpv-player/mpv#15016 It has lead to a complete removal of redundant functions that mpv is already capable of doing from the osc. References: mpv-player/mpv#15031 mpv-player/mpv#15038 Also, increased title max character limit to fix #9
Requested in mpv-player#14087 (comment) and mpv-player#15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
Requested in mpv-player#14087 (comment) and mpv-player#15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
Requested in #14087 (comment) and #15031 (comment) This is mainly useful to keep highlighting the current playlist entry after moving the mouse.
player/lua/osc.lua
Outdated
mp.command("script-binding select/select-" .. type) | ||
|
||
if user_opts.visibility == "auto" then | ||
osc_visible(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is merely an opinion that might match the use case for you guys:
On my OSC fork, I'm hiding the osc osc_visible(false)
without checking if user_opts.visibility == auto
Reason:
Like we talked before, the OSC is at the bottom and select/console
also renders at the bottom. I instantly got reports that OSC interferes (ie: hovering over area)
Thought I'd let you know, just in case. Since it would make sense to hide osc on open_selector
regardless of visibility mode, because you want the focus to be on select
once it is triggered without interference until ESC/leave select
.
local function open_selector(type)
mp.command("script-binding select/select-" .. type)
state.selector = true
osc_visible(false)
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that what the osc/margins
user_property is for? To allow console/select to draw text above the OSC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it is, just thought I'd share it. I've opted for completely hiding osc while selector is on.
Like I said, merely an opinion that might match your use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OSC with visibility always does not interfere because the console is rendered above it so I don't understand your point. If users intentionally make the OSC always visible why should we override their preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 To each their own, just sharing an opinion
This will be used to hide it when opening select.lua.
Done, but you can still cycle tracks with the wheel. |
adb2a49
to
81aea6e
Compare
Right click on sub tracks could be bound to select a secondary subtitle but I don't know how many use those. |
Some preliminary thoughts:
|
717605a
to
cdf3ae8
Compare
Works fine for me, I'm sure there are details that we can bikesheed, but there is not much interest in this. So I'm inclined to merge it to gather more feedback and we can work iteratively on this.
there is also a right click that cancels select. @guidocella: what do you think about adding click action on |
67c809d
to
9d2fd93
Compare
Showing cache stats is cute but I'm not sure it would be useful if the cache seconds and the cached regions are already shown? |
I was going to suggest to render controls similar to window controls with a I'm not sure how viable that would be, especially because you can predict that once this becomes more popular, one of requests would be opts for background-box/opacity for visibility in console/select and maybe even stats. Poor Guido has been flooded with notes lately xD, though it's probably because it's a great addition |
Well you can now close by clicking anywhere on the top line so an X would only be an indication. You can already give the console and stats a background with |
Yup, one of the first things I've added for osd since I started using select/console a lot.
What I meant was, they'll request it specifically and only for console/select. Though this is me overthinking things yet again. |
Now that the playlist counter is shown by default there is no use in showing it again, so repurpose the binding to show the stats page with file and track info.
8bf5548 added mouse support to the console's select menu, so open it from OSC buttons. Left click on the title opens the playlist selector and showing the stats is moved to right click. Right click on chapter buttons opens the chapter selector. Left click on track buttons opens the track selectors because seeing which track you're selecting beforehand is useful. Fixes mpv-player#10621.
This makes it consistent with most other bindings and lets you cancel the operation by moving the cursor away (the seekbar bind mouse down so you can keep seeking to different timestamps).
Give buttons nicer names before exposing script-opts for their bindings. In particular, rename cy_audio and cy_sub to audio_track and sub_track because their left click binding no longer cycles.
There is a consensus that showing these list when navigating is distracting. Also if you set --osd-playing-msg, the playlist is briefly displayed and then overwritten by the msg. The chapter list can even contain spoilers: mpv-player#4675 (comment) The next commit will remove these completely in favoring of making the commands customizable.
This adds several script-opts to configure what OSC buttons do when clicked. It lets you restore the bindings present before they were changed to call select.lua. The script-opts are listed one per line in the manual to not make that section huge. skip_backward and skip_forward script-opts are omitted to lower the script-opts number because they are only in box layout and undocumented. I'm not sure if it's worth adding script-opts for the wheel on the seekbar. script-opts for the current and remaining time and fullscreen are not added to not add more script messages. Closes mpv-player#6291 and mpv-player#11878.
Inspired by ModernX. Closes mpv-player#5067.
9d2fd93
to
f7235dd
Compare
Make the console easier to read because the current default is too small. See for example mpv-player#14903 (reply in thread) or mpv-player#15036 (comment) or mpv-player#15145 (comment) or mpv-player#15031 (comment). This also prevents libass from decreasing performance by printing many lines.
Make the console easier to read because the current default is too small. See for example #14903 (reply in thread) or #15036 (comment) or #15145 (comment) or #15031 (comment). This also prevents libass from decreasing performance by printing many lines.
When hovering certain elements over the OSC, using the mouse wheel can result in special commands (such as seeking, changing audio tracks, etc.) Not everyone neccessarily wants this feature, so add an option to make it possible to disable all of it. Maybe more fine-tuned control would be more ideal, but probably not worth it. Fixes #13096.
8bf5548 added mouse support to selectors, so open them from OSC buttons.
It's up for debate where middle or right click should be bound. By binding middle click
show_message(get_tracklist())
is no longer bound. By binding right click, it no longers cycles tracks backwards, though scrolling with the wheel still does.Closes #5067, closes #6291, closes #10621, closes #11878.