From 998bdef1d03931aab88953107509bad233875dc0 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:01:32 -0500 Subject: [PATCH] DOCS/man/input.rst: add sections to categorize commands mpv has too many commands and they are unorganized in the documentation, making it difficult to navigate. This commit completely reorganizes the commands into several categories to make the documentation easier to navigate. The following categories are defined: - Playback Control: Seeking and stepping. - Property Manipulation: Changing property values. - Playlist Manipulation: Playlist navigation and editing. - Track Manipulation: Track navigation and editing. - Text Manipulation: Text printing, expansion, escaping. - Configuration: General configuration and related files. - OSD: Displaying contents as OSD. - Input and Keybind: Input configuration and key bindings. - Execution: Execution of mpv and subprocesses. - Scripting: Script loading and communication. - Screenshot: Taking screenshots. - Filter: Changing filters. - Miscellaneous: Other commands. --- DOCS/man/input.rst | 1101 +++++++++++++++++++++++--------------------- 1 file changed, 569 insertions(+), 532 deletions(-) diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 86bd7412f2..45f0e4c9fa 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -261,10 +261,8 @@ Don't add those to the actual command. Optional arguments are enclosed in Remember to quote string arguments in input.conf (see `Flat command syntax`_). -``ignore`` - Use this to "block" keys that should be unbound, and do nothing. Useful for - disabling default bindings, without disabling all bindings with - ``--input-default-bindings=no``. +Playback Control +~~~~~~~~~~~~~~~~ ``seek []`` Change the playback position. By default, seeks by a relative amount of @@ -316,6 +314,26 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_). Using it without any arguments gives you the default behavior. +``sub-seek `` + Change video and audio position such that the subtitle event after + ```` subtitle events is displayed. For example, ``sub-seek 1`` skips + to the next subtitle, ``sub-seek -1`` skips to the previous subtitles, and + ``sub-seek 0`` seeks to the beginning of the current subtitle. + + This is similar to ``sub-step``, except that it seeks video and audio + instead of adjusting the subtitle delay. + + Secondary argument: + + primary (default) + Seeks through the primary subtitles. + secondary + Seeks through the secondary subtitles. + + For embedded subtitles (like with Matroska), this works only with subtitle + events that have already been displayed, or are within a short prefetch + range. See `Cache`_ for details on how to control the available prefetch range. + ``frame-step`` Play one frame, then pause. Does nothing with audio-only playback. @@ -331,6 +349,19 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_). This does not work with audio-only playback. +``stop []`` + Stop playback and clear playlist. With default settings, this is + essentially like ``quit``. Useful for the client API: playback can be + stopped without terminating the player. + + The first argument is optional, and supports the following flags: + + keep-playlist + Do not clear the playlist. + +Property Manipulation +~~~~~~~~~~~~~~~~~~~~~ + ``set `` Set the given property or option to the given value. @@ -341,6 +372,10 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_). Add the given value to the property or option. On overflow or underflow, clamp the property to the maximum. If ```` is omitted, assume ``1``. +``multiply `` + Similar to ``add``, but multiplies the property or option with the numeric + value. + ``cycle []`` Cycle the given property or option. The second argument can be ``up`` or ``down`` to set the cycle direction. On overflow, set the property back to @@ -351,56 +386,38 @@ Remember to quote string arguments in input.conf (see `Flat command syntax`_). Currently properties with continuous values are repeatable by default (like ``volume``), while discrete values are not (like ``osd-level``). -``multiply `` - Similar to ``add``, but multiplies the property or option with the numeric - value. +``cycle-values [<"!reverse">] [ [...]]`` + Cycle through a list of values. Each invocation of the command will set the + given property to the next value in the list. The command will use the + current value of the property/option, and use it to determine the current + position in the list of values. Once it has found it, it will set the + next value in the list (wrapping around to the first item if needed). -``screenshot `` - Take a screenshot. + This command has a variable number of arguments, and cannot be used with + named arguments. - Multiple flags are available (some can be combined with ``+``): + The special argument ``!reverse`` can be used to cycle the value list in + reverse. The only advantage is that you don't need to reverse the value + list yourself when adding a second key binding for cycling backwards. - (default) - Save the video image, in its original resolution, and with subtitles. - Some video outputs may still include the OSD in the output under certain - circumstances. -