Commit Graph

53394 Commits

Author SHA1 Message Date
Guido Cella
9d67fc28e2 console.lua: don't complete DLLs on Windows
run completion on Windows is slow because system32 contains thousands of
DLLs, so filter executables with an extension in PATHEXT.
2024-12-02 20:56:49 +01:00
Guido Cella
3053797e3c defaults.lua: remove outdated comment
A client's input sections are destroyed along with it since bf385e1140.
2024-12-02 20:51:24 +01:00
Guido Cella
1f1c30146c console.lua: complete executables after run 2024-12-01 19:28:22 +01:00
Guido Cella
43ff1c1af6 console.lua: complete filter labels for {a,v}f-command 2024-12-01 19:28:22 +01:00
Guido Cella
15e7a1184a console.lua: complete command flags 2024-12-01 19:28:22 +01:00
Guido Cella
220de247b8 console.lua: remove code repetition in complete() 2024-12-01 19:28:22 +01:00
der richter
11186374a0 mac/option: explicitly include and define type of global init variable
the mpv_global struct is a public struct defined in common/global.h. in
the case that this header is included directly or indirectly into our
swift bridging header, code that uses that struct as an OpaquePointer
will fail to build, because swift would now be aware of its actual type.

preemptively include the header and properly define the type to prevent
such errors in the future.

i also checked all other usages of OpaquePointers and this is the only
case where this is relevant.

See e1d30c4 and 4ff9f50 as reference
2024-12-01 19:25:37 +01:00
nanahi
0114281627 DOCS/man/mpv.rst: add documentation for the numpad +/- key bindings 2024-12-01 18:55:50 +01:00
nanahi
8c6ad1dc81 etc/input.conf: add KP_PLUS/KP_SUBTRACT key bindings
Same as d06f3d39cb.
2024-12-01 18:55:50 +01:00
Guido Cella
c8d9f37b27 command: fix --osd-selected{,-outline}-color
Using 3 %x in a row can produce colors like 0ff0 which are interpreted
incorrectly, so ensure each colors has 2 digits.
2024-12-01 18:54:50 +01:00
llyyr
744cd70640 DOCS/options.rst: specify that gpu-sw only works with OpenGL/Vulkan 2024-12-01 12:22:15 +01:00
llyyr
1a03d6ab84 vulkan/context: propagate --gpu-sw on vulkan contexts 2024-12-01 12:22:15 +01:00
Kacper Michajłow
d673356990 common: ensure MP_HANDLE_OOM is used only on pointers
To make it clear it should be used for memory allocation and not generic
error checking.
2024-11-30 17:08:42 +02:00
Kacper Michajłow
7b114d7d54 ad_lavc: remove unnecesary variable 2024-11-30 17:08:42 +02:00
der richter
7e519397a1 options: note that --gamma-auto is only implemented on vo=gpu 2024-11-30 02:32:39 +01:00
der richter
dec0d02f9f vo_gpu: undeprecate --gamma-factor
deprecated since 0.35 in ac39661 and 2207236.
2024-11-30 02:32:39 +01:00
moi15moi
a283f66ede sd_ass: add application/x-font-otf to font_mimetypes 2024-11-28 17:35:22 +01:00
Kacper Michajłow
6ea2cd72ec vf_format: fix format=dolbyvision=no metadata stripping
If p->colormatrix is 0 if not set by user, so it would always override
_orig parameters with Dolby Vision ones and restore that erroneously.

Fixes: e2365bfece
2024-11-28 17:33:31 +01:00
Kacper Michajłow
4ff9f50b6b player/clipboard/clipboard: don't include global.h in header
This header should not be included except when really needed.

Fixes: e1d30c4c5a
2024-11-28 00:45:27 +01:00
nanahi
7899a28699 defaults.js: support custom arg in mp.add_key_binding() 2024-11-27 20:40:41 +01:00
nanahi
06670298b3 defaults.lua: support custom arg in mp.add_key_binding()
The information is available in the table.
2024-11-27 20:40:41 +01:00
nanahi
0874f81b31 command: add custom arg for script-binding
This allows passing arbitrary information in the script-binding
command. The content is available as a new message argument.
2024-11-27 20:40:41 +01:00
nanahi
aeb637b33b DOCS/man/input.rst: document that WHEEL_* are scalable
This documents the scalable keys (currently WHEEL_*) and notes
how the keys work with scalable commands. Mention touch pad
as a common source of scalable input source.
2024-11-27 20:40:41 +01:00
nanahi
0d6c979220 DOCS/man/input.rst: document the scalable commands 2024-11-27 20:40:41 +01:00
nanahi
62e434ac7f input/cmd: add comment for scalable and is_ignore 2024-11-27 20:40:41 +01:00
nanahi
5fd4bfb4a0 defaults.js: support scalable mp.add_key_binding() 2024-11-27 20:40:41 +01:00
nanahi
e3e22de2ca defaults.lua: support scalable mp.add_key_binding()
For complex key bindings, the table now contains a new member
of the current key scale. mp.add_key_binding() now accepts the
scalable flag to make the binding scalable.
2024-11-27 20:40:41 +01:00
nanahi
34571e7882 command: make script-binding command scalable
script-binding command is currently not scalable, so script
registered key bindings also cannot be scalable, unlink input.conf
bindings.

This makes script-binding command scalable so that it's possible to
define scalable key bindings in scripts. It now calls script-message
command with an extra argument with the scale of the key.
2024-11-27 20:40:41 +01:00
nanahi
b97e3b9e4b DOCS: add clipboard documentations 2024-11-27 20:31:41 +01:00
nanahi
510d634b5b console.lua: use native clipboard property on win32 and wayland
Since native clipboard is implemented on win32 and wayland,
use the clipboard property instead.

This fixes the problems with commandline implementations of clipboard:
- On win32, the powershell implementation is complex, and it can take
  several seconds to run for the first time.
- On wayland, it requires wl-paste to be installed, which isn't always
  available. It also works poorly on GNOME.
2024-11-27 20:31:41 +01:00
nanahi
d9f30cc079 video/out/wayland_common: support clipboard monitoring
Works by notifying property update when clipboard content is
updated.
2024-11-27 20:31:41 +01:00
nanahi
593d437dae command: notify-property command
Since VOCTRL is not suitable for frequent data query
(see 477a0f8318 for details),
it's not suitable to be used by the VO clipboard backend.
Instead, since the VO does the clipboard monitoring by itself,
it can notify the player when the clipboard is updated.

This adds an internal notify-property command so that VOs
can notify player when the clipboard is updated, so that clipboard
monitoring works.
2024-11-27 20:31:41 +01:00
nanahi
625900687e clipboard-win: implement clipboard monitoring
This uses GetClipboardSequenceNumber() to detect clipboard
content changes. Clipboard Format Listener is a better way to
do this according to MS docs, but sequence number works and
the listener requires creating a dedicated thread and HWND
for monitoring, so I will save it for a later time.
2024-11-27 20:31:41 +01:00
nanahi
1d36f7be05 clipboard: add clipboard monitoring API
This adds a clipboard monitoring API for backends which use polling
to monitor clipboard updates. --clipboard-monitor option can turn
clipboard monitoring on and off at runtime.
2024-11-27 20:31:41 +01:00
nanahi
dcde47e15b clipboard-win: add Windows clipboard backend
This adds a Windows clipboard backend. This doesn't depend on
VO, so it can be used even when no video window is created.
2024-11-27 20:31:41 +01:00
nanahi
d47ce38e20 video/out/wayland_common: implement VOCTRL_GET_CLIPBOARD
This adds support for VOCTRL_GET_CLIPBOARD which makes the VO
clipboard backend be able to get clipboard content for Wayland.
2024-11-27 20:31:41 +01:00
nanahi
b93d3046e2 video/out/wayland_common: implement clipboard support
Clipboard contents are available as selection data offers under
Wayland. The offer can become invalid at any time, so request the
text format content immediately when an offer is received,
and cache the content for later use.
2024-11-27 20:31:41 +01:00
nanahi
fa3a167347 video/out/wayland_common: generalize check_fd 2024-11-27 20:31:41 +01:00
nanahi
23b8fb3d9c clipboard-vo: implement VO clipboard backend
This adds a generic VO clipboard backend based on VOCTRLs
to get and set clipboard data.
2024-11-27 20:31:41 +01:00
nanahi
240ebd6ad3 vo: add VOCTRL_GET/SET_CLIPBOARD
This adds VOCTRLs needed for VO-based clipboard backend.
2024-11-27 20:31:41 +01:00
nanahi
6e848a0b3c command: add clipboard property
This adds clipboard property which uses the clipboard
API to get and set clipboard contents. Currently only
clipboard text is implemented, but this can be extended in
the future to cover primary selection and other formats.
2024-11-27 20:31:41 +01:00
nanahi
e1d30c4c5a clipboard: add clipboard API
This adds a clipboard API with multiple backend and format support.
--clipboard-enable option can be toggled at runtime to turn native
clipboard on and off.
2024-11-27 20:31:41 +01:00
llyyr
af82f7cf29 DOCS/interface-changes: specify that new additions have to be listed
This has been happening for a while now apparently, so change it to
accurately reflect reality. I chose the next release as the point to
formally make this change, because I was under the impression that we
didn't have to list new options so I never did it and there may be
others like that too.
2024-11-27 20:28:51 +01:00
Kacper Michajłow
15ea3728a5 osc.lua: show file and track info on title left-click 2024-11-27 20:26:06 +01:00
Kacper Michajłow
92a98f1ce2 osc.lua: cycle sub/audio down on shift+L-click / middle-click 2024-11-27 20:26:06 +01:00
Kacper Michajłow
62db90634e osc.lua: cycle sub/audio on left-click, select on right-click 2024-11-27 20:26:06 +01:00
der richter
639ef09807 mac: implement VOCTRL_BEGIN_DRAGGING
this removes the old isMovableByWindowBackground mechanism with the
newer performDrag(with:) function.
2024-11-27 18:48:47 +01:00
Guido Cella
f7e2a8c1cc bstr: add bstr_xappend0 2024-11-27 15:37:42 +01:00
Guido Cella
b9e6030053 command: highlight selected list items with color
Instead of printing circles in show-text ${playlist}, ${chapter-list}
and ${edition-list}, introduce --osd-selected-color and
--osd-selected-outline-color to reduce clutter, make the selected item
easier to differentiate, and have visual consistency with select.lua.

The defaults are taken from the style of the selected item in the
console. These new options are also used there, replacing the hardcoded
styles. Due to being user-configurable, selected item styles are changed
to take priority over default item styles.

The default selected style is yellow and bold. The bold (hardcoded)
allows differentiating the selected item with color blindness. There is
also a separate --osd-selected-outline-color option defaulting to black,
since without it if the user changes --osd-outline-color yellow text
becomes unreadable without a black border. --osd-selected-back-color is
omitted for now.

Text and background colors are inverted for the selected item in the
terminal. This is hardcoded, adding an option is overkill.

A disadvantage of this commit is that if you run print-text ${playlist}
with a VO, the selected style ASS is printed to the terminal (but ASS
printed in the console is interpreted). This commit avoids printing the
reset ASS sequence for non-selected items to reduce clutter in this
case.
2024-11-27 15:37:42 +01:00
Guido Cella
d54a45d075 console.lua: enable runtime updates of script-opts 2024-11-27 15:32:10 +01:00