select.lua: add this script
This adds script messages to select playlist entries, tracks, chapters and subtitle lines using the newly introduced mp.input.select().
This fully closes #13964.
Download the artifacts for this pull request:
Is this meant to replace https://github.com/guidocella/mpv-console-select, for example?
Yeah I just ported the code of that script.
I think we could extend it with "command palette" style input. That would list all defined keybinds/commands and allow to select one of them. With common ctrl+p binding.
Also we could have ctrl+shift+p to search in all of the properties and on selection send it to console as set foo and let user complete. Or something along those lines. Or allow fuzzy search in console itself, somehow.
Additional, I'm personally not a big fan of g-*, I prefer modifiers in such cases. We already have F8 and F9 so they could be extended to ctrl+F8 and ctrl+F9 for selection instead of display. But I don't like the use of function keys either, so probably this would be only alternative to main keys.
EDIT:
I think this selection should be bigger. Changing all console maybe is not best like #14088, but track selection and things like that should have the same size as F9 for example. It is impossible to see anything if you use it in HTPC setup.
Added listings of bindings and properties and separate font and border sizes.
Additional, I'm personally not a big fan of g-*, I prefer modifiers in such cases. We already have F8 and F9 so they could be extended to ctrl+F8 and ctrl+F9 for selection instead of display. But I don't like the use of function keys either, so probably this would be only alternative to main keys.
I prefer key sequences for being easier to press and allowing mnemonic groupings and use around 30 of them. I already find F8 and F9 bindings bad because they're arbitrary and therefore hard to remember, and we already have 4 ctrl+letter keybindings including ctrl+c and ctrl+s. It would be inconsistent to have e.g. playlist selection on ctrl but not chapter selection on ctrl+c and sub-seek on ctrl+s. We also already have 7 of these select keybindings and may add more so only g sequences guarantee us available keys, so I think it is the only sane option.
run script-binding select/* command in console takes no effect, you must write the console close command manually,
script-message-to console disable; script-binding select/select-playlist
I think we should auto close console.
This was shot down in https://github.com/mpv-player/mpv/pull/10282#issuecomment-1454702439
Just tested this a bit, works as described. I really like it so far.
But this is a feature change, should probably be mentioned somewhat prominently in the changelog. Alone for the fact that it uses a keybind (g) that was already bound by users (like me).
The chord-style input (g+..) works really well, though, definitely a good idea.
why is there no selected style in playlist, even though the current playing file is default item when opened, it's easy to forget which one is currently playing after searching and scrolling.
@verygoodlee What do you mean? The marked entry has been highlighted for me.
Which build are you using, exactly?
I mean this selected style
In playlist I don't know which one is currently playing
It's a bit noisy to have circles everywhere when the playing entry is already preselected, and it wouldn't be helpful after searching because the original order is not restored if you delete the input string anyway (though this can be easily changed). More opinions are needed on whether we want to add the circles.
another question, is it necessary to observe property changes during menu opening. example: during the track selection menu open, current file reached EOF and next file automatically plays, the track items are not updated, is it necessary to update it.
I don't think that's necessary.