[MPlayer-users] [contrib] zsh completion function

GoTaR gotar at poczta.onet.pl
Fri Jun 28 18:16:02 CEST 2002


Hi there!

I've just written sth, that can be useful, so here you are. I hope
someone will fix it;)

-- 
GoTaR <gotar at priv0.onet.pl>		USA sux
	...Dżahilijja... znowu? Nadal...
PLD stuff at http://mops.uci.agh.edu.pl/~gotar/
-------------- next part --------------
#compdef mplayer

# it's more template than complete solution
# anyway - I'm too lazy to learn how to write it right
# so feel free to fix it and please send me your changes
# GoTaR <gotar at priv0.onet.pl>

# wishlist
# - vo, ao and icelayer with [comments]
# - better vop and aop

_vo () {
	_tags values
	_all_labels values expl 'Video output' \
		compadd $(print ${(f)"$(mplayer -vo help 2>/dev/null | cut -f2 -d'	')"})
}

_ao () {
	_tags values
	_all_labels values expl 'Audio output' \
		compadd $(print ${(f)"$(mplayer -ao help 2>/dev/null | cut -f2 -d'	')"})
}

_vop () {
	compadd "$@" crop expand flip mirror rotate scale yuv2 rgb2bgr palette format pp lavc fame dvbscale cropdetect
}

_aop () {
	compadd "$@" list delay= format= fout= volume= mul= softclip
}

_osdlevel () {
	compadd "$@" 0 1 2
}

_icelayer () {
	compadd 0 2 4 6 8 10 12
}

_arguments \
	'-cache[cache size]:cache size' \
	'-flip[flip image]' \
	'-nosound[disable sound]' \
	'*-vop[video output filters]:video output filters:_vop' \
	'-zoom[enable software zoom]' \
	'-noautosub[disable automatic subtitles]' \
	'-osdlevel[OSD startpoint]:OSD level:_osdlevel' \
	'*-aop[audio output filters]:audio output filters:_aop' \
	'-double[enable doublebuffering]' \
	'-fs[enable fullscreen]' \
	'-icelayer:icelayer:_icelayer' \
	'-rootwin[play in root window]' \
	'-quiet' \
	'-framedrop[enable framedropping]' \
	'-vo[video output]:video output:_vo' \
	'-ao[audio output]:audio output:_ao' \
	'*-sub[subtitles]:subtitles:_files -/ -g \*.\(\#i\)txt' \
	'*:multimedia file:_files -/ -g \*.\(\#i\)\(mp3\|mpg\|mpe\|mpeg\|m1v\|avi\|asf\|wma\|wmv\|asx\|mov\|qt\|rm\)'


More information about the MPlayer-users mailing list