# Configure file for MozPlugger
# Version: Jan 20, 2013
#
# This file is part of mozplugger a fork of plugger, for list of developers 
# see the README file.
#
# Commands which are not installed on your system will not be used.
#
# NOTE!! After changing this file, mozplugger-update must be executed.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.


### m4 macros ###

changequote([,])

### Helpers

### MPlayer

##define(MP_CMD,[mplayer -quiet -nojoystick -nofs -zoom -osdlevel 0 $1 </dev/null])
define(MP_CMD,[env LD_LIBRARY_PATH=/home/samurai/mplayer:$LD_LIBRARY_PATH LIBVA_DRIVERS_PATH=/usr/lib/xorg/modules/drivers /home/samurai/mplayer/mplayer -va vaapi -vo vaapi -fs $1] )

define(MP_EMBED,[embed : MP_CMD(-xy $width -wid $window $1)])

define(MP_NOEMBED,[noembed noisy ignore_errors maxaspect swallow(MPlayer): MP_CMD($1)])

# If you want a small controls in top left corner of embedded window when using
# mplayer then uncomment the first and comment the second below 

#define(MP_VIDEO_STREAM,[controls stream MP_EMBED($1 "$file")
#	stream MP_NOEMBED($1 "$file")])

define(MP_VIDEO_STREAM,[stream MP_EMBED($1 "$file")
	stream MP_NOEMBED($1 "$file")])

define(MP_VIDEO_PLAYLIST, [fmatch($1) MP_EMBED(-playlist "$file")
	                   fmatch($1) MP_NOEMBED(-playlist "$file")])
# Special case for Quicktime
define(MP_LINKS,[stream links noisy ignore_errors: MP_CMD($1)])

define(MP_AUDIO,[mplayer -quiet -nojoystick $1 </dev/null])

define(MP_AUDIO_STREAM,[controls stream noisy ignore_errors: mplayer -quiet -nojoystick $1 "$file" </dev/null])

### Video ###

video/mpeg:mpeg,mpg,mpe:MPEG animation
video/x-mpeg:mpeg,mpg,mpe:MPEG animation
video/x-mpeg2:mpv2,mp2ve:MPEG2 animation
	MP_VIDEO_STREAM()

video/mp4:mp4:MPEG4 animation
video/msvideo:avi:AVI animation
video/x-msvideo:avi:AVI animation
video/fli:fli,flc:FLI animation
video/x-fli:fli,flc:FLI animation
	MP_VIDEO_STREAM()

video/x-theora:ogg:OGG stream with video
video/theora:ogg:OGG stream with video
video/ogg:ogg:OGG stream with video
video/x-ogg:ogm,ogv:OGG stream with video
	MP_VIDEO_STREAM()


application/pdf:pdf:PDF file
application/x-pdf:pdf:PDF file
text/pdf:pdf:PDF file
text/x-pdf:pdf:PDF file

#	display "epdfview" on your browser
#	needs_xembed repeat swallow(epdfview) fill : epdfview "$file"
	repeat swallow(epdfview) fill : epdfview "$file"
#	repeat : /bin/echo 
#       repeat controls swallow(acroread) fill stream : acroread -openInNewWindow /a "$fragment" "$file"
# repeat noisy swallow(kpdf) fill: kpdf "$file"
# repeat noisy swallow(Xpdf) fill: xpdf -g +9000+9000 "$file"
#
# GV()
# links : okular "$file"
# links noisy exits: evince "$file"
#   links exits: acroread /a "$fragment" "$file"
# We don't swallow evince, acroread or okular as those apps done play ball when swallowed
# http://www.mozdev.org/bugs/show_bug.cgi?id=20686, 24322,
