Commit Graph

53271 Commits

Author SHA1 Message Date
llyyr 5b946ac360 player: don't load encoding mode profile twice
Also move the loading of profiles and input section activation in one
place. Leaving this in mp_initialize has the drawback that encoding
section profile will overwrite options set by the user in the command
line, since it's set after the CLI options are parsed and processed.
mp_parse_cfgfiles happens before parsing the CLI, so loading the profile
there is better.
2024-10-31 16:43:25 +01:00
llyyr e28bfadbea options: remove stale comment about encoding mode being compiled-in
Encoding mode used to be a compile time option, but now it's always
compiled in.
2024-10-31 16:43:25 +01:00
Guido Cella 00e223ccb6 console.lua: refine the hovered item calculation
Calculate the hovered item from the bottom of the screen where the
console is anchored. This is simpler and accurate because it accounts
for the fact that the empty line between the log and the input line
isn't as tall as a full line, for the exact height of an always visible
OSC bottombar, and for the empty top pixels present because the height
isn't an integer multiple of the font size.
2024-10-31 16:40:56 +01:00
Guido Cella e1680167fd console.lua: factor OSC margins before the bottom margin
OSC margins are relative to the whole height before subtracting the
bottom left margin.
2024-10-31 16:40:56 +01:00
Kacper Michajłow 41cff490ad drm: don't print extra newline on connectors/modes help 2024-10-30 11:49:22 +01:00
Guido Cella b40241889b console.lua: use math.ceil in determine_hovered_item()
Replace the rounding to calculate the hovered line with ceil which is
what you would expect to work. Rounding worked better before because it
compensated for the errors fixed by the previous 2 commits.
2024-10-29 22:13:40 +01:00
Guido Cella ce4a804a7d console.lua: factor the bottom margin in line calculations
This is more important now that the margin is bigger due to the scaling
with the window.
2024-10-29 22:13:40 +01:00
Guido Cella 10789fae1f Revert "console.lua: fix the max log lines calculation"
This reverts commit 5e65999eb2.

This was wrong because an empty line doesn't occupy as much height as a
filled line. But update the comment so it is not unclear like before why
1.5 is subtracted.
2024-10-29 22:13:40 +01:00
nanahi f476c0275b DOCS/man/osc.rst: fix binding documentation
The documentation doesn't agree with the implementation and
commit message (which agree with each other).
2024-10-29 20:36:38 +01:00
nanahi 1b2aed0b5a etc/restore-old-bindings.conf: fix comment description
The file also provides changed key bindings.
2024-10-29 20:36:38 +01:00
nanahi 5a3ac5bfae meson.build: add restore-osc-bindings.conf to conf_files 2024-10-29 20:36:38 +01:00
nanahi 4c93447dbb DOCS: mention restore-osc-bindings.conf 2024-10-29 20:36:38 +01:00
nanahi e21e1c3180 etc/restore-osc-bindings.conf: add file to restore old osc bindings
The OSC changed to use select.lua for various tasks, resulting in a
significant change in user interaction. This adds a config file
which records OSC behavior changes so that the old behavior can be
restored.
2024-10-29 20:36:38 +01:00
Guido Cella 3986f34e2a stats.lua: calculate sizes like --osd-*-size options
Currently --script-opt=stats-font_size=n is much bigger than
--osd-font-size=n, which can confuse users, so calculate sizes the same
way.

The \fs value to replicate --osd-font-size is
${osd-font-size} * 288 / 720 with --osd-scale-by-window, and
\fs${osd-font-size} * 288 / ${osd-height}
with --osd-scale-by-window=no. This is because
sub/osd_libass.c:update_playres() sets
track->PlayResY = ass->res_y ? ass->res_y : MP_ASS_FONT_PLAYRESY,
where MP_ASS_FONT_PLAYRESY is 288.

This also works with persistent_overlay=yes.

{\fscx100}{\fscy100} would also replicate --osd-font-size with show-text
and with osd-verlay + --osd-scale-by-window, but not with osd-overlay +
--osd-scale-by-window=no.

The default sizes are multiplied by 720/288 = 2.5 to keep them the same
as before.
2024-10-29 20:35:35 +01:00
Wertzui123 daf52f9761 DOCS/contribute.md: fix a typo 2024-10-29 20:25:47 +01:00
Kacper Michajłow 0c5420b412 console.lua: update selected item under the cursor on mouse wheel action 2024-10-29 16:23:21 +01:00
nanahi 98ed972246 video/mp_image: fix original param copy implementation
Fixes: 9b571a7aa7
2024-10-29 16:22:14 +01:00
Kacper Michajłow 059f78b517 ci/msys2: enable sanitizers for clang build 2024-10-29 16:07:17 +01:00
rkscv 8cd69e6de8 DOCS/man/lua: correct example syntax 2024-10-29 12:26:04 +02:00
Kacper Michajłow 466b5530c9 DOCS/man/osc: remove non-existent options
Fixes: a80f535a6d
2024-10-29 00:45:59 +01:00
Guido Cella 934bfd2b7e console.lua: restore the bigger default font size
Fixes aa66f0dced.
2024-10-29 00:13:32 +01:00
Guido Cella aa66f0dced console.lua: default to a proportional font for select
In the select menu there are no completions to align in a grid, so the
better looking proportional font of --osd-font can be used by default.
It is also easier to read for the visually impaired.

The text width calculation is no longer performed if the console is only
opened through select, it is only performed the first time something is
completed. This avoids having to pass an argument to get_font() to make
it use the monospace font regardless of selectable_items.

Fixes #15176.
2024-10-28 23:30:34 +01:00
Guido Cella cb8e3ba959 osc.lua: hide immediately without animation for select.lua
Requested by llyyr.
2024-10-28 23:28:50 +01:00
Guido Cella bf3382b083 console.lua: fix the hovered line calculation without scale with window
If not scaling with the window the hidpi scale needs to be factored into
mouse-pos. Follow up to a670f75679 and a2106396bc.
2024-10-28 23:17:21 +01:00
Guido Cella 940ab99055 osc.lua: make shift+mbtn_left an alias of mbtn_mid
...instead of the opposite. This simplifies bind_mouse_buttons().
2024-10-28 23:16:54 +01:00
Guido Cella dc85266aff osc.lua: remove code repetition for mouse bindings 2024-10-28 23:16:54 +01:00
Guido Cella 4b97e723d6 osc.lua: rename the tog_fs button
Make it consistent with the command script-opt names.
2024-10-28 23:16:54 +01:00
Guido Cella a2106396bc console.lua: fix the clicked line calculation
e00d8dcb03 factored hidpi-scale in get_scaled_osd_dimensions(), so
max_lines was dividing by it a second time.
2024-10-27 21:36:32 +00:00
Guido Cella 29cffadf60 console.lua: document the new hipdi scaling behavior
Update the docs for the changes of a670f75679.
2024-10-27 21:36:32 +00:00
nanahi a670f75679 console.lua: don't scale with display dpi if scaling with window size
Fixes overly large text on hidpi displays.
2024-10-27 21:43:36 +01:00
Guido Cella 423e8f2711 osc.lua: increase the title font size in box layout
It is too small.
2024-10-27 21:10:36 +01:00
Guido Cella d2fd394036 console.lua: increase the font and border size
Make the console easier to read because the current default is too
small. See for example
https://github.com/mpv-player/mpv/discussions/14903#discussioncomment-10794701
or https://github.com/mpv-player/mpv/pull/15036#discussion_r1794178379
or https://github.com/mpv-player/mpv/pull/15145#issuecomment-2428762898
or https://github.com/mpv-player/mpv/pull/15031#issuecomment-2402289600.

This also prevents libass from decreasing performance by printing many
lines.
2024-10-27 21:07:37 +01:00
Guido Cella e00d8dcb03 console.lua: add scale_with_window script-opt
If this is set to yes or auto and --osd-scale-by-window is true, console
scales with the window height like everything else in mpv.

Defaults to auto.
2024-10-27 21:07:37 +01:00
Guido Cella fbf869584c osc.lua: cycle tracks on right click
This might be more useful than having the same binding as middle click.
Suggested by llyyr.
2024-10-27 01:24:03 +02:00
Guido Cella 897c04afe1 osc.lua: don't print auto before tracks are selected
While files are loading, track options have the value "auto". Print "-"
in that case.

Fixes 1a558bf5c2.
2024-10-27 01:23:20 +02:00
Guido Cella 99e4979b01 mac/menu: use show-text instead of old osc script messages
1a558bf5c2 made osc-*list script messages aliases to show-texting the
relative properties, so use show-text directly in the menu. Also
increase the duration to be the same as the OSC buttons because the
default of 1 second is too short.
2024-10-26 20:09:57 +02:00
nanahi c6883c4a56 options: add option to control OSD bar marker style
This adds --osd-bar-marker-style option which can be used to
customize OSD bar marker style. In addition to the existing triangle
style, a new style option is added to draw markers as lines.
2024-10-26 20:02:04 +02:00
nanahi ea8ac49f11 options: add options to control OSD bar marker size
This adds --osd-bar-marker-scale and --osd-bar-marker-min-size
options which can be used to customize OSD bar marker size.
2024-10-26 20:02:04 +02:00
nanahi 085a816c80 osd_libass: rename marker size variable
The size won't be dent anymore once other marker styles are
added.
2024-10-26 20:02:04 +02:00
Earnestly 9f6cca624f ytdl_hook.lua: track playlist metadata
Add support for tracking playlist_title and playlist_id metadata
corresponding to a given playlist url and the entries associated
with it.

This allows the inclusion of ytdl_playlist_title and ytdl_playlist_id
in the metadata property for single videos which have a corresponding
playlist-path property.

This commit also resolves yt-dlp/yt-dlp#11234
2024-10-26 19:59:26 +02:00
nanahi 9af491fc80 Copyright: fix -Dgpl=false description
Even with -Dgpl=false, some files including the documentation,
mpv.desktop, and some key binding files are still being built.
This means that mpv as a whole might not be LGPL even when the
program itself is LGPL.

Also the description that mpv is licensed under LGPLv2.1+
"if built with the -Dgpl=false configure switch" is incorrect
as it appears to give a license grant as long as the switch is
used, regardless if there is a bug in the build system that
results in a GPL file being compiled in.

Change the description to clarify this.
2024-10-25 14:01:16 +02:00
nanahi 246be60401 Copyright: remove some redundant texts
The same information is already covered by the second and the last
paragraphs.
2024-10-25 14:01:16 +02:00
nanahi 71ccc45188 Copyright: clean up nonexistent features
Remove some of the features that no longer exist or aren't directly
supported in the mpv code: Linux analog TV (DVB still supported),
SMB, bootstrap.py.
Also fix the path for mpv.desktop.
2024-10-25 14:01:16 +02:00
Guido Cella 5c59f8accc command: remove an extra space from track formatting 2024-10-24 22:04:44 +02:00
Guido Cella 4598ceb3f2 osc.lua: show track-list for one more second
Useful now that track metadata is printed. This now uses the same
duration as playlist and chapter-list.
2024-10-24 22:04:09 +02:00
der richter 96095bd591 github: add newline at end of file of pull request template 2024-10-24 17:40:26 +02:00
der richter e661165ead github/workflows: add editorconfig linting 2024-10-24 17:40:26 +02:00
Guido Cella ef6eda32a2 command: print track metadata when changing track 2024-10-24 17:39:46 +02:00
Guido Cella f0a852cda3 command: print lang in track-list 2024-10-24 17:39:46 +02:00
Guido Cella b1037f5d63 loadfile: reuse circle definitions in command.h 2024-10-24 17:39:46 +02:00