| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
This lets you press / in page 4 of the stats and type a keybinding or
part of its command to filter it by using mp.input.
This works badly without a VO because both stats.lua and console.lua use
show-text and only one can be displayed at a time, but it's still better
than not having the search available at all.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid having to configure both the OSD and the stats script opts when
you change the OSD options, in particular avoid having to convert colors
to BGR.
Also document the shadow options.
font_size, border_size and shadow offset defaults are kept because the
same values look much bigger in the stats than in the corresponding OSD
options.
osd-back-color is now respected without extra checks until you
explicitly set a shadow_color.
|
|
|
|
|
|
| |
Showing media titles in the playlist is pointless when sources are ill
tagged and media titles contain only garbage. Being able to opt for
file names at least gives us a choice in such cases.
|
|
|
|
|
|
|
|
| |
Turns out that adding more medatata like HDR10+ and Dolby Vision would
produce a lot of duplication and it is better to centralize it around
the track-list property.
Fixes: e720159f72be2a816db849acb286f36a1ac4622b
|
|
|
|
|
|
| |
May be interesting information for users.
Fixes: #13839
|
| |
|
| |
|
|
|
|
|
| |
Scrolling for page 2 was disabled in 777f69bee8aceadcd319edf046535e177ef43d48
but the keys were still bound, so this was clearly a mistake.
|
|
|
|
|
| |
Add support for the syntax introduced by 8708f4dc91 in the completion
system.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Escape all messages in osc.lua, because other than the title they
weren't being escaped at all. If for example you did mpv foo.mp4
'{\fs50}bar.mp4' and script-message osc-playlist, it would just render
the second entry as bar.mp4 in big text.
The title was escaped partially, now the escaping is complete because:
- It escapes \. Backslashes at the end of the title are escaped instead
of being stripped, and \n, \N and \h are now printed verbatim. In
particular, "\\n" is no longer converted to space and is printed
verbatim instead which is more correct.
- Newlines ("\n", not the "\\n" escape sequence) are converted to spaces
instead of rendering them and messing up the text positioning within
the OSC.
- Spaces at the start are preserved.
Fixes #11209, fixes #11275.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a command to escape ASS tags to remove code duplication
between sub/osd_libass.c, console.lua, osc.lua, stats.lua and any user
script that calls mp.create_osd_overlay().
A command is used instead of scripting functions so that all clients can
use this and not just use Lua and JS ones.
osd_mangle_ass() also interprets osd-sym-cc and osd-ass-cc/{0,1}, but
since they use invalid UTF-8 characters there is no risk of escape-ass
users using them by accident, like with any OSD message.
Always replacing \n with \\N in mangle_ass() even when it is not called
by escape-ass doesn't seem to cause any issue, but I made it conditional
anyway to avoid changing how all OSD messages are treated unnecessarily.
|
|
|
|
|
|
|
| |
The terminal output was static in size with no way of automatically
adjusting it to the current terminal size.
The new term-size property makes truly automatic adjustment possible.
|
|
|
|
|
|
|
|
| |
The scroll hint on page 4 had baked in ass tags, which shouldn't be
there in the terminal. Also the scroll hint on page 0 was missing.
Refactor scroll hint generation into a function and use that for
pages 2, 4 and 0.
|
|
|
|
|
| |
Page 4 might as well use the same line shortening function as the other
pages instead of rolling it's own.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The terminal is assumed to be 80x24 in size, the new options
`term_width_limit` and `term_height_limit` can be used to overwrite
that.
Lines longer then the terminal width cause problems with scrolling
pages and need to be shortened.
The algorithm used for shortening can deal with tabs and escape
sequences, has rudimentary support for UTF-8 and runs in O(n).
avih helped in the creation of the term_ellipsis() function and split()
is also from him.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pages 2 and 0 had their own scroll implementations, which worked fine
for ass, but didn't work well in the terminal.
Now they both use the same scroll function as page 4.
That scroll function requires each output line to be one entry
in the table. Page 0 did not adhere to that new requirement, instead
it generated two table entries for a single output line when a graph
is shown. To fulfill that requirement the generated graph now gets
directly appended to the same table entry that's used for the rest
of the line.
|
|
|
|
|
|
|
|
| |
This scrolling implementation will be used for other pages in future
commits.
The comment said it takes up 20 lines of the terminal, but in reality
it was 22 lines.
|
|
|
|
|
|
|
|
| |
- current AO
- AO device
- AO volume
- audio delay
- output format
|
| |
|
| |
|
|
|
|
|
| |
This is drawn with the same method as the stats.lua graphs so it's also
blurry. Fix this by using the "Default" style for cursor drawing.
|
|
|
|
|
|
|
|
| |
When --osd-blur is set to a nonzero value, the graphs also become
blurry. This is because they are rendered by the osd-overlay command
with the "OSD" style which has OSD blur applied, and are treated no
differently from texts. Fix this by using the "Default" style for
these graphs which uses the default OSD options.
|
|
|
|
|
|
| |
Move common_prefix_length() and related functions before the first call
to common_prefix_length(). It works now because it's global but if we
ever make all functions local for consistency it will stop working.
|
|
|
|
|
| |
But still read the deinterlacing option to distinguish between yes and
auto.
|
|
|
|
|
|
|
|
| |
Unlike set include mpv.conf, this works after playback has started. It
can be used to auto reload the configuration, e.g. in vim:
autocmd BufWritePost ~/.config/mpv/mpv.conf silent !echo load-config-file %:p | socat - /tmp/mpvsocket
Partially fixes #6362.
|
|
|
|
|
| |
This allows the title shown with the windowcontrols to be controlled
separately from the normal osc title. Fixes #13295.
|
|
|
|
|
|
| |
This displays the current GPU context when --vo=gpu or --vo=gpu-next
is used, which shows the platform and backend information of the vo
which are previously not available.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mp.observe_property('foo', nil, ...) calls the handler at least 2 times
on each playlist change even when the property doesn't change. This is
dangerous because if you haven't read observe_property's documentation
in a long time this is easy to forget, and you can end up using it for
handlers that are computationally expensive or that cause unintended
side effects.
Therefore, this commit discourages its use more explicitly in the
documentation, and replaces its usages in scripts.
For console.lua, observing focused with type nil leads to calling
mp.osd_message('') when changing file while playing in the terminal with
the console disabled. I don't notice issues from this, but it's safer to
avoid it.
For playlist and track-list this doesn't really matter since they
trigger multiple changes on each new file anyway, but changing it can
avoid encouraging people to imitate the code.
One usage of none in stats.lua is kept because according to b9084dfd47
it is a hack to replicate the deprecated tick event.
|
|
|
|
|
|
|
|
|
|
|
| |
When the mouse cursor is hovering over the (CSD) windowcontrols title,
the osc keeps displaying, but the cursor autohide isn't disabled like
other visible regions.
Fix this by disabling the cursor autohide in this region.
All other existing behaviors of the mouse cursor in this region
are unchanged, including triggering main window area input
and allowing VO dragging.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When running the console in the terminal, style log lines with the same
escape sequences as msg.c.
mp.input can also specify terminal escape sequences, e.g. a script to
select a playlist entry can invert the color of the selection.
Also add a missing newline to help's error message.
|
|
|
|
| |
This lets scripts get textual input from the user using console.lua.
|
|
|
|
|
|
|
| |
Makes Tab expand loadfile ~/ to loadfile /home/$USER/.
I used expand-path instead of os.getenv('HOME') to make it work on
Windows.
|
|
|
|
|
|
|
|
|
|
|
| |
This is commonly done to understand whether a window is focused. This
explicitly checks if focused is false instead of unavailable to not
break the cursor where focused is unimplemented like on --vo=drm.
The cursor is taller than the input text so it is made transparent
instead of completely removing it so that the log doesn't move up and
down while toggling focus. Alternatively, cheight = opts.font_size * 8
can be changed to 7.
|
|
|
|
|
|
|
| |
43ed0a83d0 avoided reinserting the string that is appended after certain
completions when it is already after the cursor when inserting the
longest common prefix of the suggestions. Do the same when cycling
through them.
|
|
|
|
|
|
|
|
|
|
|
| |
Reuse common_prefix_length() to make find_common_prefix() shorter and
faster by not creating many temporary strings.
The decrease in the average time to run find_common_prefix() over 1000
calls I measured is:
set \<Tab>: 1e-4s -> 1e-5s
set s\Tab>: 1e-5s -> 5e-6s
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Clear completion suggestions from functions that move the cursor, so
that you can't insert suggestions at the wrong spot by pressing Tab
again after moving the cursor,
Also clear suggestions from some editing functions that were never
updated. It is not actually necessary to clear suggestions from
functions that remove text in front of the cursor, but since
handle_del() already clears them, let's just clear them everywhere.
|
|
|
|
|
|
| |
Also inline option-info's sub-properties so we don't have to define
sub-properties at the top of the function for every one we decide to
complete.
|
|
|
|
|
|
| |
This is useful for completing files and more rarely for profiles. It
will also be useful to third-party scripts interacting with the console
once the API to do it is merged.
|
|
|
|
|
| |
This reverts commit af2635d8c9389504cb0b07a78f3999096d80a1ab, and
restores feature parity with VLC.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I honestly don’t care either way but I also don’t believe this innocent
and cute hat is worth repeatedly having people show up on the issue
tracker to aggressively virtue signal and then shit-talk the project
elsewhere when their “concerns” are ignored and made fun of.
For the record, I approve of neither brand of childish nonsense.
If your workflow depends on December festivities, feel free to use an
alternative OSC implementation.
Fixes #13082 and #9548
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A simplified version of the text width estimation code from uosc.
An osd_overlay is created with compute_bounds=true for measuring the
width of the lower case alphabet at what's estimated to be the largest
font size possible without clipping.
The lower case alphabet was chosen to get decent results for proportional
fonts, even if they aren't officially supported.
|
|
|
|
|
| |
This was a simpler fix to not print the console log to the OSD while
switching VO.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This property was never encouraged. The manual even stated that "You
should avoid using it, unless you absolutely have to." Since we now have
user-data which is superior in every single way and replaces this,
delete this property. The manual also has threatened people for years
with the line "It's a makeshift solution which could go away any time
(for example, when a better solution becomes available)." We were nice
and deprecated it in 1d00aee8e191c9689a20e67e3d6dfd2af6ad2588 for a
while to give script authors some time to update. Let's remove it for
good now.
|
|
|
|
|
|
|
|
|
|
|
| |
The "Resolution" property shows the storage resolution for videos with
non-square pixels.
Currently, display aspect ratio is shown for both "Resolution" and
"Output Resolution" properties which results in a duplicate,
and is incorrect for the "Resolution" property.
The correct aspect ratio is now shown using the sar and sar-name properties.
|
|
|
|
|
|
|
|
|
| |
String formatting of Lua crashes with widths greater then 99, so limit
the value to that.
A nicer solution would be to create our own string padding function that
can handle bigger widths, but such long suggestions aren't common enough
to be worth the effort.
|
| |
|
|
|
|
| |
056072bf95 deleted the only use of property_list.
|
|
|
|
| |
Fixes #12735, fixes #12839.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The previous commit was already a big improvement, but it was still
somewhat slow on the lua interpreter. By wrapping the table at the top
we loose the consistent placement of items while resizing (at least as
long as the column count didn't change), but we avoid taking all the
off screen items into account.
The fewer items fit on screen the faster this becomes.
|
|
|
|
|
|
|
|
|
|
|
| |
Showing all properties was terribly slow.
Instead of starting at one row and increasing the row count until it
fits, the column count can be increased until it doesn't fit anymore.
That alone already reduces the required iterations, but from the column
count an upper and lower bound for the row count can be calculated.
For large tables this dramatically reduces the amount of iterations.
|
|
|
|
|
|
| |
This way it is possible to get a list of all options or all properties,
instead of having to guess the first letter before any suggestions are
shown.
|
| |
|
|
|
|
|
|
| |
So far completing something like `${some-pro}` with the cursor between
`o}` would result in `${some-property}}`. Adding that superfluous `}` can
be avoided by checking if it's already in the string after the cursor.
|
| |
|
|
|
|
|
|
|
|
| |
This commit replaces all uses of sig_peak and maps all HDR metadata.
Form notable changes mixed usage of maxCLL and max_luma is resolved and
not always max_luma is used which makes vo_gpu and vo_gpu_next behave
the same way.
|
|
|
|
|
| |
Note this commit does not change all uses of sig-peak, this is for
future refactoring.
|
|
|
|
|
|
|
|
|
|
|
| |
For whatever reason, some of the lua code (particularly the osc and
ytdl_hook) is full of a bunch of stuff like if (foo), if not (foo ==
nil), etc. The parenthesis aren't needed in lua and actually just look
weird since nobody actually writes lua like this. You can see most of
the other conditionals are written normally. So cleanup the style to
match when the parenthesis clearly aren't doing anything. Not directly
related, but also add some spaces on a few math operations while we're
at it.
|