Commit Graph

28 Commits

Author SHA1 Message Date
nanahi 85b3a6e567 {stats,osc}.lua: respect --osd-scale-by-window by default
This lets these scripts scale the elements with OSD by default.
2024-05-20 18:29:44 +02:00
nanahi 1f29d037a0 stats.lua: add add auto value to vidscale option
This adds auto to vidscale script option, which lets the scale be
inherited from OSD --osd-scale-by-window option.
2024-05-20 18:29:44 +02:00
nanahi 0c74199a8f osc.lua: add auto value to vidscale option
This adds auto to vidscale script option, which lets the scale be
inherited from OSD --osd-scale-by-window option.
2024-05-20 18:29:44 +02:00
nanahi bc5863a631 input/cmd: add nonrepeatable prefix
This allows forcing certain commands to be non-repeatable, e.g. volume.
2024-05-20 17:47:01 +02:00
Guido Cella c4b03700e1 player: add option-info/<name>/expects-file
This will allow console.lua to complete files after e.g. set
glsl-shaders <Tab>.
2024-05-12 22:29:40 +02:00
Kacper Michajłow aa3cf6d57b command: add dolby-vision-profile and dolby-vision-level to track-list 2024-05-10 01:26:30 +02:00
Guido Cella 2354d876da scripting: add mp.input.select()
This allows scripts to make the user choose from a list of entries by
typing part of their text and/or by navigating them with keybindings,
like dmenu or fzf.

Closes #13964.
2024-05-07 22:34:22 +02:00
Guido Cella 6ec3e1549d command: add normalize-path command
This can be used e.g. by a bookmarking script to show normalized paths.
2024-05-05 20:29:27 +02:00
nanahi 807a6d875a options: add --native-touch option
For platforms which send emulated mouse inputs for touch-unaware clients,
such as Win32 and X11, this option enables the native multitouch handling
and disables emulated mouse inputs. This enables interested scripts to
handle multitouch events while keeping compatibility with touch-unaware
scripts.
2024-05-03 16:14:03 +02:00
nanahi 77809faea1 input: add --input-touch-emulate-mouse option
This adds --input-touch-emulate-mouse option, which controls whether to
enable legacy touch handling where touch inputs are emulated as mouse
inputs. This establishes a primary touch point (the one with the lowest
index) as the emulated mouse position, and MBTN_LEFT up/down with the
appearance of the first touch point and the disappearance of the last
touch point.

This fixes some problems with touch handling on Wayland, for example
attempting to pinch results in a double click.
2024-05-03 16:14:03 +02:00
nanahi 46cca1a67f command: add touch-pos property
This adds touch-pos property, which contains the information of all
current touch points. The property has sub properties:

touch-pos/count: the number of current touch points
touch-pos/N/x,y: the position of touch point N
touch-pos/N/id: unique identifier of the touch point
2024-05-03 16:14:03 +02:00
rcombs 99f1b2b7b4 player/command: add sub-text/ass-full sub-property
This is like sub-text/ass, but it returns a full ASS line, making it suitable for some more advanced scripting use-cases.
2024-04-27 01:19:56 +02:00
rcombs 437fff9f21 player/command: move sub-text-ass to a sub-property 2024-04-27 01:19:56 +02:00
sunpenghao 503a0f184c ao_wasapi: add `--wasapi-exclusive-buffer` option
This allows users to set buffer duration in exclusive mode. We have
been using the default device period as the buffer size and it is
robust enough in most cases. However, on some devices there are
horrible glitches after a stream reset. Unfortunately, the issue is not
consistently reproducible, but using a smaller buffer size (e.g., the
minimum device period) seems to resolve the problem.

Fixes #13715.
2024-04-19 02:28:23 +02:00
rcombs d3a63e16d2 command: use property_time() for sub-start and sub-end
This gives these properties the "time" type, which allows them to be pretty-printed as HH:MM:SS easily (but also still allows raw formatting using e.g. ${=sub-start}).
2024-04-18 13:11:01 +02:00
Kacper Michajłow a569c3ce0c player/command: add track-list/N/decoder 2024-04-18 01:20:32 +02:00
nanahi c9a53780cf DOCS: document --show-in-taskbar option 2024-04-18 00:09:09 +02:00
sfan5 02254b92dd
Release 0.38.0 2024-04-17 21:18:44 +02:00
Kacper Michajłow d23f641bb3 player/command: remove codec-info and use track-list directly
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: e720159f72
2024-04-16 21:58:55 +02:00
Kacper Michajłow e720159f72 player/command: add video-codec-info and audio-codec-info
Adds support for extracting codec profile. Old properties are redirected
to new one and removed from docs. Likely will stay like that forever as
there is no reason to remove them.

As a effect of unification of properties between audio and video,
video-codec will now print codec (format) descriptive name, not decoder
long name as it were before. In practice this change fixes what docs
says. If you really need decoder name, use the `track-list/N/decoder-desc`.
2024-04-15 19:34:40 +02:00
Kacper Michajłow 5a53fa7cad vo_tct: add --vo-tct-buffering option 2024-04-07 20:23:04 +02:00
Shuanglei Tao 3c1e983351 vo: add win32 context menu support 2024-04-06 08:24:06 +02:00
sfan5 8e3737ab63 ao_pulse: reenable latency hacks by default
As far as I can tell PulseAudio introduced a bug in 16.0
where if a stream is (un)paused too often the reported latency
will momentarily spike by 3000% or more. Apparently in certain cases
just pausing once and waiting can also cause this.

Save the remaining users of PA the trouble of debugging the various
obscure issues that can arise from this (desync is a harmless example)
by enabling the latency hack code again.

ref: <https://github.com/mpv-player/mpv/issues/12057>
     <https://github.com/mpv-player/mpv/issues/10333>
2024-03-24 09:58:41 +01:00
Dudemanguy 91489c9466 options: add --input-commands option
Basically a simple way to perform any command/property action from the
command line. This takes the exact same syntax as input.conf but not
including the key naturally. Potentially useful for weird properties
that don't map well to options (like ao-volume). Fixes #12353.
2024-03-21 14:48:53 +00:00
Kacper Michajłow 8708f4dc91 m_property: add `>` for fixed precision floating-point expansion
This enhancement makes it easier to create constant width property
expansions, useful for the `--term-status-msg`. Additionally, it changes
to `%f` printing with manual zero trimming, which is easier to control
than `%g`. With this method, we can directly specify precision, not just
significant numbers. This approach also avoids overly high precision for
values less than 1, which is not necessary for a generic floating-point
print function.

A new print helper function is added, which can be used with adjusted
precision for specific cases where a different default is needed. This
also unifies the code slightly.
2024-03-21 03:50:11 +01:00
Guido Cella d6610a5b2f command: add escape-ass
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.
2024-03-21 03:20:14 +01:00
Christoph Heinrich 0c8f3bc73c player/command: add term-size/[w,h] property
There was no way for scripts to know the current size of the terminal,
which is essintial if they want to provide a good user experience even
without a window.
2024-03-21 03:08:52 +01:00
Dudemanguy 58363d209c DOCS: document the new way to handle interface changes
Manually editing interface-changes.rst is a giant maintenance pain that
causes merge conflicts all the time. Stop doing that nonsense and
instead have changes be written to files in DOCS/interface-changes. Also
remove that one sentence in changes.rst because it's just not true.
2024-03-20 22:38:56 +00:00