about summary refs log tree commit diff
path: root/Completion/X/Command/_mplayer
blob: d4918f5dfd84b1deb778c3cd5fbf46b5ebb89b3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#compdef mplayer gmplayer

local suf ret=1 curcontext="$curcontext"
local -a vals state line

_x_arguments -C -s \
  '!-abs:buffer size' \
  '-ac[force usage of a specific audio codec]:audio codec attachment:->audio-codecs' \
  '-af[activate audio filters]:filter' -af-adv:option \
  '-afm[force usage of a specific audio codec family]:audio codec family:->audio-codec-families' \
  '-aid:audio channel id' \
  '-alang[select the DVD audio language]:country code' \
  '(-nosound)-ao[specify audio driver]:audio-driver attachment:->audio-drivers' \
  '-aofile:file:_files' \
  '(-nosound)*-aop[specify audio output filter]:audio output filter:->audio-plugins' \
  '-aspect:ratio' \
  '-audiofile:audio file:_files -g "(#i)*.(wav|mp3|ogg)(-.)"' \
  -autoq:quality -autosync:factor \
  -bandwidth:bandwidth\ value -benchmark -bpp:depth \
  '(-nocache)-cache:cache size (kb)' \
  '-cdda:audio CD options:(spped paranoia generic-dev sector-size overlap toc-bias toc-offset skip noskip)' \
  '-cdrom-device:cdrom device:_files -g "*(-%b)"' \
  '-channels:playback channels:((2\:stereo 4\:surround 6\:full\ 5.1))' \
  '-chapter:chapter' -contract:value \
  '-csslib:libcss.so location:_files' \
  -cuefile -delay:delay -demuxer:number -dfbopts:value \
  '(-nodouble)-double[enable double buffering]' \
  '-dr[enable direct rendering]' \
  -dxr2:option -dumpaudio -dumpstream -dumpvideo \
  '-dumpfile:output file:_files' \
  -dumpmicrodvdsub -dumpmpsub -dumpsrtsub -dumpjacosub -dumpsami -dumpsub \
  '-dvd:title id' '-dvdauth:DVD device' \
  '-dvd-device:dvd device:_files -g "*(-%b)"' \
  '-dvdangle:angle id' '-dvdkey:key' \
  '-edl:edl file:_files' '-edlout:edl file:_files' -enqueue \
  '-fbmode:video mode' '-fbmodeconfig:config file:_files' \
  '-fb[specify framebuffer device to use]:device:_files -g "*(-%b)"' \
  '-ffactor:factor:(0 0.75 1 10)' \
  -flip '-font:font.desc file:_files' -forceidx -forcexv -format:format \
  '-fps[force frame rate]:frame-rate' \
  '-framedrop' \
  '-frames:frame number' \
  '-fs[fullscreen]' -fstype:type \
  -gui -{,gui}'wid:X window:_x_window' \
  {-h,-help,--help}'[display help info]' \
  -hardframedrop \-hr-mp3-seek \
  '-hue:video signal hue adjustment' \
  '(-rootwin)-icelayer:icewm layer:((0\:Desktop 2\:Below 4\:Normal 6\:OnTop 8\:Dock 10\:AboveDock 12\:Menu))' \
  '(-use-stdin)-idx[rebuild index of the avi]' \
  '-ifo:ifo file:_files' '-include:config-file:_files' \
  '-input:command:(conf ar-delay ar-rate keylist cmdlist js-dev file)' \
  '-jpeg:option' -lavdopts:option \
  '-lircconf:lirc config file:_files' '-loop:repetitions' \
  '-mc[specify max sync correction]:max sync correction' \
  '-mf[specify option when decoding multiple PNG or JPEG files]:option' \
  '-mixer:mixer device:_files -g "*(-%b)"' \
  '-monitoraspect:ratio' -monitor_dotclock -monitor_{h,v}freq:frequency \
  '-ni[force usage of non-interlaced avi parser]' \
  -noaspect -noautosub -overlapsub -nooverlapsub -nowaveheader \
  '(-cache)-nocache' -nobps \
  '(-double)-nodouble' -nodshow -noextbased -noframedrop \
  -nograbpointer -nokeepaspect -noslices -nojoystick -nolirc -nortc \
  '(-ao -aop)-nosound' \
  '-osdlevel:osd-level:((0\:subtitles\ only 1\:volume\ +\ seek 2\:volume\ +\ seek\ +\ timer\ +\ percentage 3\:volume\ +\ seek\ +\ timer\ +\ percentage\ +\ total\ time))' \
  -panscan:value \
  '-passwd[specify password for http authentication]:password' \
  '-playlist:file:_files' \
  '-pp[apply postprocess filter]:filter attachment' -pphelp \
  -quiet -really-quiet -rootwin \
  -rawaudio:option -rawvideo:option \
  '-rtsp-stream-over-tcp' -saturation:value \
  '-sb[seek to byte position]:byte' \
  -screen{w,h}:pixels \
  '-sdp[input file is a SDP file]' -shuffle \
  '-skin[skin directory]:skin directory:_directories' \
  -skipopening -slave \
  '-sid[turn on DVD subtitles]:language id' \
  '-speed[set playback speed rate]:playback speed rate' \
  '-srate[specify frequency of audio playback]:frequency (Hz)' \
  '-ss[seek to given time position]:position (hh:mm\[:ss\])' \
  '-sstep[specify time between displayed frames]:time (seconds)' \
  -ssf:mode -stop_xscreensaver \
  '-stereo:mode:((0\:stereo 1\:left\ channel 2\:right\ channel))' \
  '-sub[use specified subtitle file]:subtitle file:_files' \
  -subfps:rate -sub-bg-alpha:value -sub-bg-color:value -subcc  -subcp:codepage -subdelay:seconds \
  -subpos:vertical\ position -s{ub,pu}'align:alignment:((0\:top 1\:center 2\:bottom))' \
  '-subfont-autoscale:mode:((0\:no\ autoscale 1\:proportional\ to\ height 2\:proportional\ to\ width 3\:proportional\ to\ diagonal))' \
  -subfont-blur:radius -subfont-encoding:encoding -subfont-osd-scale:coefficient -subfont-outline:thickness -subfont-text-scale:coefficient \
  -sub-no-text-pp -spuaa:mode  -spugauss:gauss -sws:scalar\ type \
  '-tv[TV grabbing]:option' \
  -unicode -utf8 \
  '-user[specify username for http authentication]' \
  '(-idx)-use-stdin' \
  '-vcd[play video cd track]:track' \
  '-vc[force usage of a specific video codec]:video-codec attachment:->video-codecs' \
  '-v[enable verbose output]' \
  '*-vf[video output filters]:video output filters:->video-output-plugins' \
  '-vfm[force usage of a specific video codec family]:video-codec-family:(1 2 3 4 5)' \
  '-vid[select video channel]:video-channel' \
  '-vm[try to change to a better video mode]' \
  '-vo[specify video driver]:video-driver attachment:->video-drivers' \
  '-vop[specify video output filters]:video output filters:->video-output-plugins' \
  -vobsub:vobsub\ file -vobsubid:id -vsync \
  '-x[scale image to x width if driver supports]:width' \
  -xineramascreen:screen -xvidopts:option \
  '-xy[scale image by factor if driver supports]:factor' \
  '-y[scale image to y height if driver supports]:height' \
  '-z[specify compression level for png output]:compression-level:((0\:no\ compression 1 2 3 4 5 6\:default\ compression 7 8 9\:max\ compression))' \
  '-zoom[use software scaling, where available (use with -nofs)]' \
  -zrbw -zrcrop -zrdev -zrfd -zrhelp -zrnorm -zrquality -zr{h,v}dec -zr{x,y}doff \
  '(-use-stdin)*:video file:->mfiles'

case "$state" in
  mfiles)
    _tags files urls
    while _tags; do
      _requested files expl 'video file' _files -g \
          "*.(#i)(avi|mp3|mpg|mpe|mpeg|m1v|mov|asf|vob|mjpg|wma|wmv|asx|qt|rm|mkv|mka|ogm|ogg)(-.)" && 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-codecs)
    vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -ac help -quiet 2>/dev/null)"}[(r)ac:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} )
    _describe -t audio-codecs 'audio codec' vals && ret=0
  ;;
  audio-drivers)
    vals=( help ${${${(f)"$(_call_program audio-drivers mplayer -ao help 2>/dev/null)"}[(r)	*,-1]#?}/	/:} )
    _describe -t audio-drivers 'audio drivers' vals && ret=0
  ;;
  audio-codec-families)
    compset -P '*,'
    compset -S ',*'
    vals=( help ${${${(f)"$(_call_program audio-codec-families mplayer -afm help 2>/dev/null)"}[(r) [^:]#,-1]## ##}/ ##/:} )
    _describe -t audio-codec-families 'audio drivers' vals && ret=0
  ;;
  audio-plugins)
    _values -s : 'audio output plugin' \
      'list[specify list of plugins]:plugin:(resample surround format volume extrastereo volnorm delay)' \
      'format[output format]:format' \
      'fout[output frequency]:frequency (Hz)' \
      'volume[volume level]:volume <0-255>' \
      'mul[stereo coefficient]:coefficient' \
      'softclip[compressor]' && ret=0
  ;;
  video-codecs)
    vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -vc help -quiet 2>/dev/null)"}[(r)vc:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} )
    _describe -t video-codecs 'video codec' vals && ret=0
  ;;
  video-drivers)
    vals=( help ${${${(f)"$(_call_program video-drivers mplayer -vo help 2>/dev/null)"}[(r)	*,-1]#?}/	/:} )
    _describe -t video-drivers 'video drivers' vals && ret=0
  ;;
  video-output-plugins)
    vals=( help ${${${${(f)"$(_call_program video-output-plugins mplayer -vop help 2>/dev/null)"}[(r)	*,-1]}/	/}/ #: /:} )
    _describe -t video-output-plugins 'video output plugin' vals && ret=0
  ;;
esac

return ret