diff --git a/src/_mpv b/src/_mpv new file mode 100644 index 0000000..1c5a340 --- /dev/null +++ b/src/_mpv @@ -0,0 +1,457 @@ +#compdef mpv +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for mpv 0.2.3 (http://mpv.io) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Valodim +# +# ------------------------------------------------------------------------------ + +local suf ret=1 curcontext="$curcontext" +local -a vals state line expl +typeset -A opt_args + +if [[ -prefix --ass-* ]]; then + + _arguments -C \ + '--ass-force-style=[Override some style or script info parameters]:style parameters' \ + '--ass-hinting=[Set font hinting type]:font hinting style' \ + '--ass-line-spacing=[Set line spacing value for SSA/ASS renderer]:line spacing' \ + '--ass-shaper=[Set the text layout engine used by libass]:text layout engine' \ + '--ass-styles=[Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles]:styles file:_files' \ + '--ass-style-override=[Control whether user style overrides should be applied]:apply overrides:(yes no)' \ + '--ass-use-margins[Enables placing toptitles and subtitles in black borders when they are available]' \ + '--ass-vsfilter-aspect-compat=[Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior]:' \ + '!--ass-vsfilter-blur-compat=[Scale blur tags by video resolution instead of script resolution]:' \ + '--ass-vsfilter-color-compat=[Mangle colors like (xy-)vsfilter do (default\: basic)]:' && ret=0 + +elif [[ -prefix --demuxer-* ]]; then + + _arguments -C \ + '--demuxer-lavf-analyzeduration=[Maximum length in seconds to analyze the stream properties]:' \ + '--demuxer-lavf-probescore=[Minimum required libavformat probe score]:' \ + '--demuxer-lavf-allow-mimetype=[Allow deriving the format from the HTTP MIME type (default\: yes)]:' \ + '--demuxer-lavf-format=[Force a specific libavformat demuxer]:' \ + '--demuxer-lavf-genpts-mode=[Mode for deriving missing packet PTS values from packet DTS]:' \ + '--demuxer-lavf-o=[Pass AVOptions to libavformat demuxer]:' \ + '--demuxer-lavf-probesize=[Maximum amount of data to probe during the detection phase]:' \ + '--demuxer-lavf-buffersize=[Size of the stream read buffer allocated for libavformat in bytes (default\: 32768)]:' \ + '--demuxer-lavf-cryptokey=[Encryption key the demuxer should use]:' \ + '--demuxer-rawaudio-channels=[Number of channels (or channel layout) if --demuxer=rawaudio is used (default\: stereo)]:' \ + '--demuxer-rawaudio-format=[Sample format for --demuxer=rawaudio (default\: s16le)]:' \ + '--demuxer-rawaudio-rate=[Sample rate for --demuxer=rawaudio (default\: 44KHz)]:' \ + '--demuxer-rawvideo-fps=[Rate in frames per second for --demuxer=rawvideo (default\: 25.0)]:' \ + '--demuxer-rawvideo-w=[Image width in pixels for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-h=[Image height in pixels for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-format=[Colorspace (fourcc) in hex or string for --demuxer=rawvideo (default\: YV12)]:' \ + '--demuxer-rawvideo-mp-format=[Colorspace by internal video format for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-codec=[Set the video codec instead of selecting the rawvideo codec when using --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-size=[Frame size in bytes when using --demuxer=rawvideo]:' && ret=0 + +elif [[ -prefix --input-* ]]; then + + _arguments -c \ + '--input-conf=[Specify input configuration file other than default]:input config file:_files' \ + '--input-ar-delay[Delay in milliseconds before we start to autorepeat a key (0 to disable)]' \ + '--input-ar-rate[Number of key presses to generate per second on autorepeat]' \ + '--input-keylist[Prints all keys that can be bound to commands]' \ + '--input-cmdlist[Prints all commands that can be bound to keys]' \ + '--input-js-dev[Specifies the joystick device to use (default\: /dev/input/js0)]' \ + '--input-file=[Read commands from the given file]:command file:_files' \ + '--input-test[Input test mode]' && ret=0 + +elif [[ -prefix --osd-* ]]; then + + _arguments -C \ + '--osd-bar-align-x=[Specify x or y position of the OSD bar]:osd x position (pixels)' \ + '--osd-bar-align-y=[Specify x or y position of the OSD bar]:osd y position (pixels)' \ + '--osd-bar-w=[Width or height of OSD bar, in percentage of the screen]:width percentage (default 75)' \ + '--osd-bar-h=[Width or Height of OSD bar, in percentage of the screen]:height percentage (default 3)' \ + '--osd-back-color=[Set osd background color]:background color' \ + '--osd-blur=[Gaussian blur factor]:blur factor' \ + '--osd-border-color=[Set osd border color]:border color' \ + '--osd-border-size[=[Size of the OSD/sub font border in scaled pixels]:osd font border (scaled pixels)' \ + '--osd-color=[Specify the color used for OSD/unstyled text subtitles]:osd text color' \ + '--osd-duration=[Set the duration of the OSD messages]:osd duration (ms, default 1000)' \ + '--osd-font=[Specify font to use for OSD and for subtitles that do not themselves specify a particular font]:' \ + '--osd-font-size=[Specify the OSD/sub font size]:' \ + '--osd-fractions[Show OSD times with fractions of seconds]' \ + '--osd-level=[Specifies which mode the OSD should start in]:' \ + '--osd-margin-x=[Left and right screen margin for the OSD/subs in scaled pixels]:' \ + '--osd-margin-y=[Top and bottom screen margin for the OSD/subs in scaled pixels]:' \ + '--osd-scale=[OSD font size multiplicator, multiplied with --osd-font-size value]:' \ + '--osd-shadow-color=[set osd shadow color]:' \ + '--osd-shadow-offset[=[Displacement of the OSD/sub text shadow in scaled pixels (see --osd-font-size for details)]:' \ + '--osd-spacing=[Horizontal OSD/sub font spacing in scaled pixels (see --osd-font-size for details)]:' \ + '--osd-status-msg=[Show a custom string during playback instead of the standard status text]:' && ret=0 + +elif [[ -prefix --sub-* ]]; then + + _arguments -C \ + '--sub-fix-timing[TODO]' \ + '--sub-demuxer=[Force subtitle demuxer type for --sub]:' \ + '--sub-paths=[Specify extra directories to search for subtitles matching the video]:' \ + '--sub-delay=[Delays subtitles by number of seconds]:subtitle delay (seconds)' \ + '--sub-gauss=[Apply gaussian blur to image subtitles]:subtitle image blur (-100 to 100, default 0)' \ + '--sub-gray[Convert image subtitles to grayscale]' \ + '--sub-pos=[Specify the position of subtitles on the screen]:subtitle position' \ + '--sub-scale=[Factor for the text subtitle font size]:subtitle size factor (default 1.0)' \ + '--sub-speed=[Multiply the subtitle event timestamps with the given value]:subtitle event timestamp factor (default 1.0)' && ret=0 + +elif [[ -prefix --vd-* ]]; then + + _arguments -C \ + '--vd-lavc-bitexact[Only use bit-exact algorithms in all decoding steps (for codec testing)]' \ + '--vd-lavc-fast[Enable MPEG2 optimizations which do not comply with the format specification and potentially cause problems]' \ + '--vd-lavc-o=[Skips the loop filter (AKA deblocking) during H]:' \ + '--vd-lavc-skipidct=[Skips the IDCT step]:' \ + '--vd-lavc-skipframe=[Skips decoding of frames completely]:' \ + '--vd-lavc-threads=[Number of threads to use for decoding]:' && ret=0 + +elif [[ -prefix --video-* ]]; then + + _arguments -C \ + '--video-align-x=[Move video padding on x or y axis]:x align (pixels)' \ + '--video-align-y=[Move video padding on x or y axis]:y align (pixels)' \ + '--video-pan-x=[Moves the displayed video rectangle by the given value in the X or Y direction]:x pan (pixels)' \ + '--video-pan-y=[Moves the displayed video rectangle by the given value in the X or Y direction]:y pan (pixels)' \ + '--video-unscaled[Disable scaling of the video]' \ + '--video-zoom=[Adjust the video display scale factor by the given value]:zoom factor' && ret=0 + +elif [[ -prefix --no-* ]]; then + + _arguments -C \ + '--no-embeddedfonts[Do not use fonts embedded in Matroska container files and ASS scripts]' \ + '--no-ass[Do not render ASS subtitles natively]' \ + '--no-consolecontrols[Prevent player from reading key events from standard input]' \ + '--no-fixed-vo[Enforce closing and reopening the video window for multiple files]' \ + '--no-input-default-bindings[Disable mpv default (builtin) key bindings]' \ + '--no-keepaspect[Always stretch the video to window size]' \ + '--no-msgcolor[Disable colorful console output on terminals]' \ + '--no-aspect[Ignore aspect ratio information from video file and assume the video has square pixels]' \ + '--no-cache[Turn off input stream caching]' \ + '--no-config[Do not load default configuration files]' \ + '--no-idx[Do not use index present in the file even if one is present]' \ + '--no-audio[Do not play sound]' \ + '--no-resume-playback[Do not restore playback position from ~/.mpv/watch_later/]' \ + '--no-sub[Do not select any subtitle when the file is loaded]' \ + '--no-video[Do not play video]' \ + '--no-media-keys[OSX only: Disable media keys]' \ + '--no-osd-bar[Disable display of the OSD bar]' && ret=0 + +else + + local noadv + + # should we show advanced commands? + zstyle -s "$curcontext" show-advanced noadv + case $noadv in + 'always') noadv='' ;; + 'never') noadv='!' ;; + *) [[ -prefix --* ]] && noadv='' || noadv='!' ;; + esac + + # describe additional prefix-groups of options + if [[ -prefix --* ]]; then + local -a optgroups + optgroups=( + '--ass-:ass subtitles' + '--demuxer-:demuxer settings' + '--input-:input' + '--sub-:subtitles' + '--osd-:on-screen display' + '--vd-:lavc video decoding' + '--video-:video settings' + '--no-:negative flags' + ) + _describe -t option-prefixes "option groups" optgroups -S '' && ret=0 + fi + + ofopts=( + '--of=[Specify output format]:output format:->output_format' + '--ofopts=[Set output format options]:output format option' + '--ofopts-add=[Append output format option to list]' + '--ofopts-pre=[Prepend output format option to list]' + '--ofopts-del=[Delete output format option at index]:option index (zero-based)' + '--ofopts-clr[Clear output format option list]' + '--ofps=[Specify output forma time base]:time base (default 24000)' + '--oautofps[Try to guess output format time base from input video]' + '--omaxfps=[Set output format maximum fps]:maximum fps (default 0, ie no limit)' + '--oharddup[Duplicate frames instead of skipping time codes to increase frame rate]' + '--oneverdrop[Never drop frames]' + '--oac=[Specify output format audio codec]' + '--oaoffset=[Set audio data offset]:offset (seconds)' + '--oacopts=[Specify output audio codec options]:audio output format option' + '--oacopts-add=[Append audio output format option to list]:audio output format option' + '--oacopts-pre=[Prepend audio output format option to list]:audio output format option' + '--oacopts-del=[Delete audio output format option at index]:option index (zero-based)' + '--oacopts-clr[Clear audio output format option list]' + '--oafirst[Force audio stream as first output stream]' + '--ovc=[Specify output format video codec]' + '--ovoffset=[Set video offset]:offset (seconds)' + '--ovc=[Specify output format video codec]' + '--ovcopts=[Specify output video codec options]:video output format option' + '--ovcopts-add=[Append video output format option to list]:video output format option' + '--ovcopts-pre=[Prepend video output format option to list]:video output format option' + '--ovcopts-del=[Delete video output format option at index]:option index (zero-based)' + '--ovcopts-clr[Clear video output format option list]' + '--ovfirst[Force video stream as first output stream]' + '--ocopyts[Copy input pts to output video, but fix discontinuities]' + '--orawts[Copy input pts to output video, leave discontinuities as-is]' + ) + + # don't show these if there is no -o yet + (( $+words[(r)-o(|=*)] )) || ofopts=( !$^ofopts ) + + _arguments -C \ + '-o[Enable encoding mode to specified output filename]:output file:_files' \ + $ofopts \ + $noadv'--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name]:audio decoders:->audio-decoders' \ + $noadv'--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams]:compression level' \ + $noadv'--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes)]:downmixing:(yes no)' \ + $noadv'--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ + $noadv'--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is]:' \ + '--af=[Specify a list of audio filters to apply to the audio stream]:audio filters:->audio-filters' \ + '--aid=[Select audio channel]:audio channel' \ + '--alang=[Specify a priority list of audio languages to use]:audio language list' \ + '--ao=[Specify a priority list of audio output drivers to be used]:audio driver(s):->audio-drivers:' \ + $noadv'--ar[Enable/disable AppleIR remote support]' \ + '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played]:aspect ratio' \ + $noadv'--audio-demuxer=[Use this audio demuxer type when using --audiofile]:audio demuxer' \ + $noadv'--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie]:external audio file:_files -g "*.(wav|mp3|ogg)"' \ + $noadv'--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory]:cache (bytes)' \ + $noadv"(--autofit-larger)--autofit=[Set initial window size]:initial window size (WxH)" \ + $noadv'(--autofit)--autofit-larger=[Set maximum initial window size]:initial window size(WxH)' \ + '--autosub[Load additional subtitle files matching the video filename]' \ + $noadv'--autosub-match=[Adjust matching fuzziness when searching for subtitles]:subtitle fuzziness' \ + $noadv'--autosync=[Gradually adjusts the A/V sync based on audio delay measurements]:' \ + $noadv'--untimed[Do not sleep when outputting video frames]' \ + $noadv'--bluray-angle=[Specify Blu-ray view angle]:bluray view angle' \ + $noadv'--bluray-device=[Specify Blu-ray disc location]:bluray disc location (device, iso or directory):_files' \ + $noadv'--border[Play movie with window border and decorations]' \ + '--brightness=[Adjust the brightness of the video signal]:additional brightness (default 0)' \ + '--cache=[Set size of the cache]:cache size (no, auto or integer in kb; default auto)' \ + '!--cache-default=[Set size of the cache]:cache size (kb, default 320)' \ + $noadv'--cache-pause=[Pause if cache percentage goes below specified value]:cache percentage' \ + $noadv'--cache-min=[Playback will start when the cache has been filled up to percentage]:cache percentage (default 20)' \ + $noadv'--cache-seek-min=[Wait for cache fill to set percentage on seek]:cache percentage' \ + $noadv'--cdda=[This option can be used to tune the CD Audio reading feature of mpv]:cdda parameters' \ + $noadv'--cdrom-device=[Specify the CD-ROM device]:specify cdrom source (device, iso or directory; default /dev/cdrom):_files' \ + '--channels=[Request the number of playback channels]:playback channels' \ + '--chapter=[Specify which chapter to start playing at]:chapter' \ + $noadv'--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts]:chapter merge threshold (ms, default 100)' \ + $noadv'--chapter-seek-threshold=[Threshold to go to previous chapter on backwards seek]:chapter seek threshold (seconds, default 5.0)' \ + $noadv'--colormatrix=[Controls the YUV to RGB color space conversion when playing video]:' \ + $noadv'--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion]:' \ + $noadv'--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion]:' \ + '--contrast=[Adjust the contrast of the video signal]:contrast adjustment (-100 to 100, default 0)' \ + $noadv'--cookies[(network only) Support cookies when making HTTP requests]' \ + $noadv'--cookies-file=[File to read HTTP cookies from]:cookie file:_files' \ + $noadv'--correct-pts[switches mpv to a mode where video timing is determined using a fixed framerate value]' \ + $noadv'--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds]:cursor hide delay (ms)' \ + $noadv'--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode]' \ + $noadv'--audio-delay=[Specify an audio delay]:audio delay (signed float in seconds, default 0)' \ + '--deinterlace=[Enable or disable interlacing]:interlacing mode (default auto):(yes no auto)' \ + $noadv'--demuxer=[Force demuxer type]:demuxer type' \ + $noadv'--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere]' \ + $noadv'--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click]:doubleclick time (ms, default 300)' \ + $noadv'--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:dvb input parameters' \ + $noadv'--dvd-device=[Specify the DVD source]:dvd source (device, iso or directory):_files' \ + $noadv'--dvd-speed=[Try to limit DVD speed]:dvd speed limit (default 0, ie. no change)' \ + $noadv'--dvdangle=[Specify view angle (DVD only)]:dvd angle' \ + $noadv'--edition=[(Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first]:edition' \ + '--end=[Stop at given absolute time]:stop time' \ + $noadv'--field-dominance=[Set first field for interlaced content]:' \ + $noadv'--flip[Flip image upside-down]' \ + $noadv'--force-rgba-osd-rendering[Change how some video outputs render the OSD and text subtitles]' \ + $noadv'--force-window[Create a video output window even if there is no video]' \ + $noadv"--force-window-position[Forcefully move mpv's video output window to default location whenever there is a change in video parameters, video stream or file]" \ + $noadv'--sub-forced-only[Display only forced subtitles for the DVD subtitle stream selected by e]' \ + $noadv'--forceidx[Force index rebuilding]' \ + $noadv'--format=[Select the sample format used for output from the audio filter layer to the sound card]:output sample format' \ + '--fps=[Override video framerate]:video framerate (fps)' \ + '--framedrop=[Skip displaying some frames to maintain A/V sync on slow systems]:framedrop:(no yes hard)' \ + $noadv'--frames=[Play/convert only first video frames, then quit]:number of frames' \ + '--fullscreen[Fullscreen playback]' \ + $noadv'--fs-screen=[Fullscreen mode goes to specified screen]:screen id for fullscreen' \ + '!--fsmode-dontuse=[OBSOLETE, use the --fs option]:' \ + $noadv'--fstype=[Specify a priority list of fullscreen modes to be used]:fullscreen modes (list)' \ + $noadv"--native-fs[(OS X only) Use OS X Mission Control's fullscreen feature instead of the custom one provided by mpv]" \ + '--gamma=[Adjust the gamma of the video signal]:gamma value (default 0)' \ + '--gapless-audio[Try to play consecutive audio files with no silence or disruption at the point of file change]' \ + $noadv'--geometry=[Adjust the initial window position or size]:window geometry' \ + $noadv'--heartbeat-cmd=[Command that is executed every n seconds during playback]:command to run' \ + $noadv'--heartbeat-interval=[Time between --heartbeat-cmd invocations]:heartbeat interval (seconds, default 30)' \ + '(*)--help[Show short summary of options]' \ + $noadv'--hr-seek=[Select when to use precise seeks that are not limited to keyframes]:' \ + $noadv'--hr-seek-demuxer-offset=[This option exists to work around failures to do precise seeks (as in --hr-seek) caused by bugs or limitations in the demuxers for some file formats. Some demuxers fail to seek to a keyframe before the given target position, going to a later position instead]:' \ + $noadv'--http-header-fields=[Set custom HTTP fields when accessing HTTP stream]:' \ + '--hue=[Adjust the hue of the video signal (default\: 0)]:' \ + $noadv'--hwdec=[Specify the hardware video decoding API that should be used if possible]:video decoding api:( no auto vdpau vda crystalhd vaapi vaapi-copy )' \ + $noadv'--hwdec-codecs=[Allow hardware decoding for a given list of codecs only]:codecs:' \ + '!--identify[Deprecated]' \ + $noadv'--idle[Makes mpv wait idly instead of quitting when there is no file to play]' \ + $noadv'--idx[Force index rebuilding]' \ + $noadv'--include=[Specify configuration file to be parsed after the default ones]:additional configuration file:_files' \ + $noadv'--initial-audio-sync[Sync by modifying audio stream instead of readjusting from different timestamps]' \ + $noadv'--joystick[Enable joystick support]' \ + $noadv'--keep-open[Do not terminate when playing or seeking beyond the end of the file]' \ + $noadv'--key-fifo-size=[Specify the size of the FIFO that buffers key events]:key fifo size (default 7)' \ + '--length=[Stop after a given time relative to the start time]:play time' \ + $noadv'--lirc[Enable/disable LIRC support]' \ + $noadv'--lircconf=[(LIRC only) Specify a configuration file for LIRC]:lirc config file:_files' \ + $noadv'(*)--list-options[Print all available options]' \ + $noadv'(*)--list-properties[Print a list of available properties]' \ + '--load-unsafe-playlists[allow loading of playlists from untrusted sources]' \ + '--loop=[Loops playback N times]:number of loops' \ + $noadv'--lua=[Load a Lua script]:lua script file:_files -g "*.lua"' \ + $noadv'--mc=[Maximum A-V sync correction per frame]:max sync correction (seconds)' \ + $noadv'--mf=[TODO Used when decoding from multiple PNG or JPEG files with mf://]:' \ + $noadv'--monitoraspect=[Set the aspect ratio of your monitor or TV screen]:aspect ratio' \ + $noadv'--monitorpixelaspect=[Set the aspect of a single pixel]:pixel aspect (default 1)' \ + $noadv'--mouse-movements[Permit mpv to receive pointer events reported by the video output driver]' \ + $noadv'--msglevel=[Control verbosity directly for each module]:verbosity level (-1 to 9)' \ + $noadv'--msgmodule[Prepend module name in front of each console message]' \ + '--mute=[Set startup audio mute status]:status (default auto):(yes no auto)' \ + $noadv'--name[Set the window class name for X11-based video output methods]:window class name' \ + $noadv'--native-keyrepeat[Use system settings for keyrepeat delay and rate, instead of --input-ar-delay and --input-ar-rate]' \ + $noadv'--sub-visibility[Can be used to disable display of subtitles, but still select and decode them]' \ + '--ontop[Makes the player window stay on top of other windows]' \ + '!--ordered-chapters[Enabled by default]' \ + '!--osc[Whether to load the on-screen-controller (default\: yes)]' \ + $noadv'--panscan=[Enables pan-and-scan functionality]:panscan (default 0):(0 1)' \ + $noadv'--playing-msg=[Print out a string after starting playback]:outpust string' \ + $noadv'--status-msg=[Print out a custom string during playback instead of the standard status line]:status line' \ + $noadv'--stream-capture=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ + $noadv'--stream-dump=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ + '--playlist=[Play files according to a playlist file (ASX, Winamp, SMIL, or one-file-per-line format)]:load playlist:_files' \ + '--pp=[Enable postprocessing with parameters]:postprocessing parameters' \ + '(*)--pphelp[Display postprocessing help]' \ + '--profile=[Use given profile(s)]:profile:->profiles' \ + $noadv'--pts-association-mode=[Select the method used to determine which container packet timestamp corresponds to a particular output frame from the video decoder]:' \ + $noadv'--pvr=[This option tunes various encoding properties of the PVR capture module]:' \ + '--quiet[Make console output less verbose; in particular, prevents the status line (i]' \ + '--quvi-format=[Video format/quality that is directly passed to libquvi]:quvi quality (default "best")' \ + $noadv'--radio=[These options set various parameters of the radio capture module]:' \ + $noadv'--really-quiet[Display even less output and status messages than with --quiet]' \ + $noadv'--referrer=[Specify a referrer path or URL for HTTP requests]:' \ + $noadv'--reset-on-next-file=[Normally, mpv will try to keep all settings when playing the next file on the playlist, even if they were changed by the user during playback]:' \ + $noadv'--rtsp-transport=[Select RTSP transport method]:transport method (default tcp):( lavf udp tcp http )' \ + '--saturation=[Adjust the saturation of the video signal (default\: 0)]:' \ + $noadv'--save-position-on-quit[Always save the current playback position on quit]' \ + $noadv'--sb=[Seek to byte position]:position (bytes)' \ + '--screen=[Screen to use in multi-monitor config]:' \ + $noadv'--screenshot-format=[Set the image file type used for saving screenshots]:format (default jpg)' \ + $noadv'--screenshot-jpeg-quality=[Set the JPEG quality level]:jpeg quality level' \ + $noadv'--screenshot-png-compression=[Set the PNG compression level]:png compression level' \ + $noadv'--screenshot-png-filter=[Set the filter applied prior to PNG compression]:png filter' \ + $noadv'--screenshot-template=[Specify the filename template used to save screenshots]:screenshot filename template' \ + $noadv'--screenh=[Specify screen width or height]:screen height (pixels)' \ + $noadv'--screenw=[Specify screen width or height]:screen width (pixels)' \ + '(*)--show-profile=[Show the description and content of a profile]::->profiles' \ + '--shuffle[Play files in random order]' \ + '--sid=[Display the subtitle stream specified by ]:subtitle stream id' \ + '--slang=[Specify a priority list of subtitle languages to use]:subtitle languages' \ + $noadv'--slave-broken[Switches on the old slave mode]' \ + $noadv'--softsleep[Time frames by repeatedly checking the current time instead of asking the kernel to wake up mpv at the correct time]' \ + $noadv'--softvol=[Control whether to use the volume controls of the audio output driver or the internal mpv volume filter]:' \ + $noadv'--softvol-max=[Set the maximum amplification level in percent]:maximum volume level (default 200)' \ + '--speed=[Slow down or speed up playback by the factor given as parameter]:speed factor (default 1.0)' \ + $noadv'--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:output sample rate' \ + '--start=[Seek to given time position]:time position (percent, seconds, or hh:mm:ss)' \ + $noadv'--ssf=[Specifies software scaler parameters]:software scaler parameters' \ + $noadv'--sstep=[Skip specified number of seconds after every frame]:skip step (seconds)' \ + $noadv'--stop-screensaver[Turns off the screensaver at startup and turns it on again on exit]' \ + '--sub=[Use/display these subtitle files]:subtitle file:_files' \ + $noadv'--subcp=[If your system supports iconv(3), you can use this option to specify the subtitle codepage]:subtitle codepage' \ + $noadv'--subfps=[Specify the framerate of the subtitle file (default\: movie fps)]:subtitle framerate' \ + $noadv'--sws=[Specify the software scaler algorithm to be used with --vf=scale]:software scaler algorithm' \ + $noadv'--term-osd[Display OSD messages on the console when no video output is available]' \ + $noadv'--term-osd-esc=[Specify the escape sequence to use before writing an OSD message on the console]:osd escape sequence' \ + $noadv'--title=[Set the window title]:window title' \ + $noadv'--tls-ca-file=[Certificate authority database file for use with TLS]:ca file:_files' \ + $noadv'--tls-verify[Verify peer certificates when using TLS]' \ + $noadv'--tv=[This option tunes various properties of the TV capture module]:tv tuner options' \ + $noadv'--tvscan=[Tune the TV channel scanner]:tv channel' \ + $noadv'--use-filedir-conf[Look for a file-specific configuration file in the same directory as the file that is being played]' \ + $noadv'--user-agent=[Use as user agent for HTTP streaming]:user agent (string)' \ + $noadv'--vd=[Specify a priority list of video decoders to be used]:video decoders:->video-decoders' \ + '(*)--version[Print version string and exit]' \ + '--vf=[Specify a list of video filters to apply to the video stream]:video filters:->video-filters' \ + '--vid=[Select video channel]:video channel' \ + '--vo=[Specify a priority list of video output drivers to be used]:video drivers:->video-drivers' \ + $noadv'--volstep=[Set the step size of mixer volume changes in percent of the full range]:volume step size (default 3)' \ + '--volume=[Set the startup volume]:volume' \ + '!--volume-restore-data=[Used internally for use by playback resume]:' \ + $noadv'--wid=[(X11 and Windows only) to attach existing window]:window' \ + '*:video file:->mfiles' && ret=0 + + case "$state" in + mfiles) + _tags files urls + while _tags; do + _requested files expl 'video file' _files -g \ + "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|webm|wma|wmv)(-.)" && ret=0 + if _requested urls; then + while _next_label urls expl URL; do + _urls "$expl[@]" && ret=0 + compadd -S '' "$expl[@]" {dvd,vcd,cdda,cddb,tv}:// && ret=0 + done + fi + (( ret )) || return 0 + done + ;; + audio-drivers) + compset -P '*,' + _message "format: " + vals=( help ${${${(f)"$(_call_program audio-drivers $words[1] --ao=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t audio-drivers 'audio drivers' vals -S '' && ret=0 + ;; + + audio-decoders) + compset -P '*,' + compset -P '(+|-)' + _message "format: <[+|-]family1:(*|decoder1),[+|-]family2:(*|decoder2),...[-]>" + vals=( help ${${${${(f)"$(_call_program audio-decoders $words[1] --ad=help 2>/dev/null)"}[(r) *,-1]## #}/:/\\:}/ - /:} ) + _describe -t audio-decoders 'audio decoders' vals -S '' && ret=0 + ;; + + audio-filters) + compset -P '*,' + _message "format: " + vals=( help ${${${(f)"$(_call_program audio-filters $words[1] --af=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t audio-filters 'audio filters' vals -S '' && ret=0 + ;; + + video-drivers) + compset -P '*,' + _message "format: " + vals=( help ${${${(f)"$(_call_program video-drivers $words[1] --vo=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t video-drivers 'video drivers' vals -S '' && ret=0 + ;; + + video-decoders) + compset -P '*,' + compset -P '(+|-)' + _message "format: <[+|-]family1:(*|decoder1),[+|-]family2:(*|decoder2),...[-]>" + vals=( help ${${${${(f)"$(_call_program video-decoders $words[1] --vd=help 2>/dev/null)"}[(r) *,-1]## #}/:/\\:}/ - /:} ) + _describe -t video-decoders 'video decoders' vals -S '' && ret=0 + ;; + + video-filters) + compset -P '*,' + _message "format: " + vals=( help ${${${(f)"$(_call_program video-filters $words[1] --vf=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t video-filters 'video filters' vals -S '' && ret=0 + ;; + esac + +fi + +return $ret