# Enrique's local_conf.py for Freevo 1.5.4 
# For more information about my HTPC see:
# http://www.rockhopper.dk/linux/hardware/htpc.html

CONFIG_VERSION = 5.15

# ======================================================================
# General freevo settings:
# ======================================================================

#CHILDAPP_DEBUG = 1 
#DEBUG = 1

# AUDIO_DEVICE        = '/dev/dsp'      # e.g.: /dev/dsp0, /dev/audio, /dev/alsa/?
# AUDIO_INPUT_DEVICE  = '/dev/dsp1'     # e.g.: /dev/dsp0, /dev/audio, /dev/alsa/?
MAJOR_AUDIO_CTRL    = 'PCM'           # Freevo takes control over one audio ctrl
                                        # 'VOL', 'PCM' 'OGAIN' etc.
CONTROL_ALL_AUDIO   = 1               # Should Freevo take complete control of audio
MAX_VOLUME          = 90              # Set what you want maximum volume level to be.
DEFAULT_VOLUME      = 84              # Set default volume level.
# TV_IN_VOLUME        = 60              # Set this to your preferred level 0-100.
# VCR_IN_VOLUME       = 90              # If you use different input from TV
DEV_MIXER           = ''    # mixer device 

START_FULLSCREEN_X  = 1               # Start in fullscreen mode if using x11 or xv.

ROM_DRIVES = [ ('/mnt/cdrom', '/dev/cdrom', 'DVD') ]
HIDE_UNUSABLE_DISCS = 1               

ROM_SPEED = 8

CONFIRM_SHUTDOWN    = 1               # ask before shutdown
ENABLE_SHUTDOWN_SYS = 1
#SHUTDOWN_SYS_CMD = 'sudo /usr/local/bin/suspend.sh'
SHUTDOWN_SYS_CMD = 'sudo /sbin/shutdown -h now'
RESTART_SYS_CMD  = 'sudo /sbin/shutdown -r now'
# choose your wakeup methode here:    
WAKEUP_METHODE = 'acpi'
# you also need root permissions for this, so you may need to use sudo here, too
WAKEUP_CMD = 'sudo /usr/local/bin/acpi_wakeup.sh'
# time your system needs for the boot process
BOOTTIME_PADDING = 400

# You can add more keybindings by adding them to the correct hash. 
# e.g. If you want to send 'contrast -100' to mplayer by pressing the '1' key, 
# just add the following line: 
#
# EVENTS['video']['1'] = Event(VIDEO_SEND_MPLAYER_CMD, arg='contrast -100')
# EVENTS['dvd']['XF86AudioNext'] = Event('NEXT')
# EVENTS['dvd']['XF86AudioPrev'] = Event('PREV')
# EVENTS['dvd']['XF86AudioPrev'] = Event('PREV')
# EVENTS['global']['XF86AudioRaiseVolume'] = Event('MIXER_VOLUP', arg=5)
# EVENTS['global']['XF86AudioLowerVolume'] = Event('MIXER_VOLDOWN', arg=5)
# EVENTS['global']['XF86AudioMute'] = Event('MIXER_MUTE')
# See src/event.py for a list of all possible events.

MENU_ARROW_NAVIGATION = 1

# Keymap to map keyboard keys to event strings. You can also add new keys
# here, e.g. KEYMAP[key.K_x] = 'SUBTITLE'. The K_-names are defined by pygame.

USE_NETWORK = 1

# Directory location to save files when the normal filesystem
# doesn't allow saving. This directory can save covers and fxd files
# for read only filesystems like ROM drives. Set this variable to your
# old MOVIE_DATA_DIR if you have one. It needs to be set to a directory
# Freevo can write to.
# OVERLAY_DIR = os.path.join(FREEVO_CACHEDIR, 'vfs')

UMASK = 002

# Suffix for playlist files
# PLAYLIST_SUFFIX = [ 'm3u' ]

MMPYTHON_CREATE_MD5_ID = 1

# Keep metadata in memory
# Setting this variable will keep all cache files in memory. Startup will be
# slower, but for large directories, this will speed up the display.
# 0 = Only keep current dir in memory. Use this if you have too much data
#     and not enough RAM
# 1 = Once loaded, keep cachefile for directory in memory
# 2 = Load all cachefiles on startup
#
# WARNING: you should not run 'freevo cache' when freevo is running.
#
MEDIAINFO_USE_MEMORY   = 1

CACHE_IMAGES = 1


# ======================================================================
# Plugins:
# ======================================================================
#plugin.remove('tv.generic_record')
#plugin.remove('tv.scheduled_recordings')
#plugin.remove('tv.view_favorites')
#plugin.remove('tv.manual_record')
#plugin.remove('tv.scheduled_recordings')
#plugin.remove('tv.mplayer')
plugin.remove('video.mplayer')

plugin.remove('tv.generic_record')
plugin_record = plugin.activate('tv.ivtv_record')
plugin.remove("mixer")

#plugin.activate('df')
#plugin.activate('video.mover', args=('/home/freevo/Video/Recordings', '/home/freevo/Video/Movies/TV-shows'))

#
plugin.remove('shutdown')
plugin.activate('wakeupshutdown',level=90)
#

#plugin.activate('wakeupshutdown.timer')
# after what time of idleness should the system shutdown (in secs)
#TIMER_DELAY = 1800
# do not shutdown, if the next recording starts in less than this 
#TIMER_NOSHUTDOWN_PADDING = 900
# do not shutdown if one of this programs is running
#EXTERNAL_CMDS = ['transcode','cdrecord','xine', 'cat']

#plugin.activate('shoppingcart')
#plugin.activate('weather', level=45)
#PLUGIN_WEATHER_LOCATIONS = [ ("DAXX0002", 1, "Aalborg") ]
#plugin.activate('usb')
#USB_HOTPLUG = [ ('0781:8888', 'Mounting USB stick', 'mount /dev/sda1 /mnt/usbstorage') ]
#plugin.activate('usbstorage', type='image', args=('USB Key', '/mnt/usbstorage'))

#plugin.activate('headlines', level=45) 
#HEADLINES_LOCATIONS = [ ('Slashdot', 'http://slashdot.org/index.rss') ] 

plugin.activate('video.appletrailers')

plugin.activate('command.CommandMainMenuItem', args=('/home/freevo/Firefox.fxd', ), level=45)
COMMAND_SPAWN_WM = 'pekwm &'
COMMAND_KILL_WM = 'pkill -KILL pekwm'

plugin.activate('idlebar' ) 
plugin.activate('idlebar.logo', level=5 )
plugin.activate('idlebar.clock', level=50, args=('%a %m %d %H:%M') )
plugin.activate('idlebar.system.sensors', level=40, args=(('temp2','@*30/43+25'), 'temp1', ''))

#plugin.remove('audio.mplayer')
#plugin.remove('audio')

#plugin.activate('audio.coversearch', args=('0XXEP25NFRDV7MHWGB02'))
plugin.activate('audio.cdbackup') 
AUDIO_FORMAT_STRING = '%(n)s-%(t)s' #sets the name of the file 
AUDIO_BACKUP_DIR = '/home/freevo/Pictures/music/' 
CD_RIP_PN_PREF= '%(artist)s/%(album)s/%(song)s' 
CDPAR_CMD = 'cdparanoia' 
LAME_CMD = 'lame'
CD_RIP_LAME_OPTS = '-q 2 --vbr-new -V 8 --lowpass 17'
OGGENC_CMD = 'oggenc'
CD_RIP_OGG_OPTS = '-q 2 --resample 22050'


# list of regexp to be ignored on a disc label
IMDB_REMOVE_FROM_LABEL = ('season[\._ -][0-9]+', 'disc[\._ -][0-9]+', 'd[\._ -][0-9]+', 'german', 'cd[\._ -][0-9]+')

# list of words to ignore when searching based on a filename
IMDB_REMOVE_FROM_SEARCHSTRING = ('the', 'a', '_')

# When searching for a movie title in imdb, should the result be
# autoaccepted if it is only one hit?
# 0 = show menu even if it is only one hit (gives you an opportunity to cancel)
# 1 = autoaccept
IMDB_AUTOACCEPT_SINGLE_HIT = True

# ======================================================================
# Freevo directory settings:
# ======================================================================

# Should directories sorted by date instead of filename?
# 0 = No, always sort by filename.
# 1 = Yes, sort by date
# 2 = No, don't sory by date for normal directories, 
#     but sort by date for TV_RECORD_DIR.
# DIRECTORY_SORT_BY_DATE = 2

# Should directory items be sorted in reverse order?
# DIRECTORY_REVERSE_SORT = 0

# Should we use "smart" sorting?
# Smart sorting ignores the word "The" in item names.
# DIRECTORY_SMART_SORT = 0

# Should Freevo autoplay an item if only one item is in the directory?
# DIRECTORY_AUTOPLAY_SINGLE_ITEM = 1

# Force the skin to use a specific layout number. -1 == no force. The layout
# toggle with DISPLAY will be disabled
# DIRECTORY_FORCE_SKIN_LAYOUT = -1

# Format string for the audio item names. 
# Possible strings:
# a = artist, n = tracknumber, t = title, y = year, f = filename
# Example:
# This will show the title and the track number:
# DIRECTORY_AUDIO_FORMAT_STRING = '%(n)s - %(t)s'
# DIRECTORY_AUDIO_FORMAT_STRING = '%(t)s'

# Use media id tags to generate the name of the item. This should be
# enabled all the time. It should only be disabled for directories with 
# broken tags.
# DIRECTORY_USE_MEDIAID_TAG_NAMES = 1

# The following settings determine which features are available for
# which media types.
# If you set this variable in a folder.fxd, the value is 1 (enabled)
# or 0 (disabled).
# Examples:
# To enable autoplay for audio and image files:
# DIRECTORY_AUTOPLAY_ITEMS = [ 'audio', 'image' ]
# To disable autoplay entirely:
# DIRECTORY_AUTOPLAY_ITEMS = []

# Make all items a playlist. So when one is finished, the next one will
# start. It's also possible to browse through the list with UP and DOWN
# DIRECTORY_CREATE_PLAYLIST      = [ 'audio', 'image' ]

# Add playlist files ('m3u') to the directory
# DIRECTORY_ADD_PLAYLIST_FILES   = [ 'audio', 'image' ]

# Add the item 'Random Playlist' to the directory
# DIRECTORY_ADD_RANDOM_PLAYLIST  = [ 'audio' ]

# Make 'Play' not 'Browse' the default action when only items and not
# subdirectories are in the directory
# DIRECTORY_AUTOPLAY_ITEMS       = [ ]


# ======================================================================
# Freevo movie settings:
# ======================================================================
# Where the movie files can be found.
# This is a list of items (e.g. directories, fxd files). The items themselves
# can also be a list of (title, file)
VIDEO_ITEMS = [ ('Movies', '/home/freevo/Video/Movies') ]
#                 ('funny stuff', '/files/movies/comedy') ]
# Some people access movies on a different machine using an automounter.
# To avoid timeouts, you can specify the machine name in the directory
# to check if the machine is alive first
# Directory myserver:/files/server-stuff will show the item for the
# directory /files/server-stuff if the computer myserver is alive.

# The list of filename suffixes that are used to match the files that
# are played wih MPlayer.
#VIDEO_MPLAYER_SUFFIX = [ 'avi', 'mpg', 'mpeg', 'wmv', 'bin', 'rm',
#                          'divx', 'ogm', 'vob', 'asf', 'm2v', 'm2p',
#                          'mp4', 'viv', 'nuv', 'mov', 'iso',
#                          'nsv', 'mkv', ]

# The list of filename suffixes that are used to match the files that
# are played wih Xine.
VIDEO_XINE_SUFFIX = [ 'avi', 'mpg', 'mpeg', 'rm', 'divx', 'ogm',
                       'asf', 'm2v', 'm2p', 'mp4', 'mov', 'cue', 
		       'wmv', 'bin', 'iso']#, 'vob']
# Preferred video player
VIDEO_PREFERED_PLAYER = 'xine'

# Only scan OVERLAY_DIR and VIDEO_SHOW_DATA_DIR for fxd files containing
# information about a disc. If you only have the fxd files for discs in
# one of this directories (and subdirectories), set this to 1, it will
# speed up startup, 0 may be needed if you have fxd files with disc links
# in your normal movie tree.
# VIDEO_SHOW_DATA_DIR = '/home/freevo/Video/Recordings'
# TV_SHOW_DATA_DIR = '/home/freevo/Video/Recordings'
# VIDEO_ONLY_SCAN_DATADIR = 1

# ======================================================================
# Freevo audio settings:
# ======================================================================
# Where the Audio (mp3, ogg) files can be found.
# This is a list of items (e.g. directories, fxd files). The items themselves
# can also be a list of (title, file)
# To add webradio support, add fxd/webradio.fxd to this list
#AUDIO_ITEMS = [ ('Music Collection', '/home/freevo/Music') ]
# The list of filename suffixes that are used to match the files that
# are played as audio.
# AUDIO_SUFFIX     = [ 'mp3', 'ogg', 'wav','m4a', 'wma', 'aac', 'flac', 'mka' ]
# Regular expression used to recognize filenames which are likely to be 
# covers for an album 
# This will match front.jpg and cover-f.jpg, but not back.jpg nor cover-b.jpg:
# AUDIO_COVER_REGEXP = 'front|-f'
# Preferred audio player
#AUDIO_PREFERED_PLAYER = 'xine'
# Show video files in the audio menu (for music-videos)
# AUDIO_SHOW_VIDEOFILES = False

# ======================================================================
# Freevo image viewer settings:
# ======================================================================
# Where image files can be found.
# This is a list of items (e.g. directories, fxd files). The items itself
# can also be a list of (title, file)
IMAGE_ITEMS = [ ('Pictures', '/home/freevo/Pictures') ]
# The list of filename suffixes that are used to match the files that
# are used for the image viewer.
# IMAGE_SUFFIX = [ 'jpg','gif','png', 'jpeg','bmp','tiff','psd' ]
# The viewer now supports a new type of menu entry, a slideshow file.
# It also has the slideshow alarm signal handler for automated shows.
# It uses a new configuration option:
# IMAGE_SSHOW_SUFFIX = [ 'ssr' ]
# Mode of the blending effect in the image viewer between two images
# Possible values are:
# None: no blending
# -1    random effect
#  0    alpha blending
#  1    wipe effect
IMAGEVIEWER_BLEND_MODE = -1

IMAGE_USE_EXIF_THUMBNAIL = 1

# ======================================================================
# Freevo games settings:
# ======================================================================
# MAME is an emulator for old arcade video games. It supports almost
# 2000 different games! The actual emulator is not included in Freevo,
# you'll need to download and install it separately. The main MAME
# website is at http://www.mame.net, but the version that is used here
# is at http://x.mame.net since the regular MAME is for Windows.
#
# SNES stands for Super Nintendo Entertainment System. Freevo relies
# on other programs that are not included in Freevo to play these games.
# 
# NEW GAMES SYSTEM :
# =================
# The GAMES_ITEMS structure is now build as follows :
# <NAME>, <FOLDER>, (<TYPE>, <COMMAND_PATH>, <COMMAND_ARGS>, <IMAGE_PATH>, \
# [<FILE_SUFFIX_FOR_GENERIC>])
# where :
#              - <TYPE> : Internal game types (MAME or SNES) or
#                         generic one (GENERIC)
#              - <COMMAND_PATH> : Emulator command
#              - <COMMAND_ARGS> : Arguments for the emulator
#              - <IMAGE_PATH>   : Optionnal path to the picture
#              - <FILE_SUFFIX_FOR_GENERIC> : If the folder use the GENERIC
#                                            type, then you must specify here
#                                        the file suffix used by the emulator
GAMES_ITEMS = [ ('MAME', '/home/freevo/Games/Mame/roms',     
                ('MAME', '/usr/games/bin/xmame.xgl', '-fullscreen -skip_gameinfo', 
                 '/home/freevo/Games/Mame/shots', None)) ] 
#		('Amiga', '/home/freevo/Games/Amiga/adfs',
#		('GENERIC', '/usr/bin/e-uae', '-G -0', '', ['adf']))
#		 ]
#               ('SUPER NINTENDO', '/home/media/games/snes/roms', 
#                ('SNES', '/usr/local/bin/zsnes', '-m -r 3 -k 100 -cs -u', '', None )),
#               ('Visual Boy Advance', '/home/media/games/vba/roms/',
#                ('GENERIC', '/usr/local/vba/VisualBoyAdvance', ' ', '', [ 'gba' ] )),
#               ('MEGADRIVE', '/home/media/games/megadrive/roms', 
#                ('GENESIS', '/usr/local/bin/generator-svgalib', '', '', '' )) ]
#
# GAMES_ITEMS = None

#
# These settings are used for the MAME arcade emulator:
#

# Priority of the game process
# 0 = Don't change the priority
# >0 - Lower priority
# <0 - Higher priority
#
# GAMES_NICE = -20

# 
# MAME cache directory
#
GAMES_MAME_CACHE = '%s/romlist-%s.pickled' % (FREEVO_CACHEDIR, os.getuid())

# ======================================================================
# Freevo SKIN settings:
# ======================================================================

#
# Select a way when to switch to text view even if a image menu is there
# 
# 1 = Force text view when all items have the same image and there are no
#     directories
# 2 = Ignore the directories, always switch to text view when all images
#     are the same
#
# SKIN_FORCE_TEXTVIEW_STYLE = 1

#
# Force text view for the media menu
# (The media menu is the first menu displayed for video, audio, images 
# and games). 
#
# SKIN_MEDIAMENU_FORCE_TEXTVIEW = 0


# ======================================================================
# Freevo OSD settings:
# ======================================================================

# System Path to search for fonts not included in the Freevo distribution
OSD_EXTRA_FONT_PATH  = [ '/usr/share/fonts/corefonts' ]

# Font aliases 
# All names must be lowercase! All alternate fonts must be in './share/fonts/'
OSD_FONT_ALIASES = { 'arial_bold.ttf' : 'VeraBd.ttf' }

# Number of seconds to wait until the busy icon is shown in the menu.
# Busy icon can also be shown right away when there is more than a certain
# number of files in a directory.
# Set this to None to disable this.
# (seconds, files)
# OSD_BUSYICON_TIMER = (0.7, 200)

OSD_OVERSCAN_X = 36
# OSD_OVERSCAN_Y = 50

# Execute a script on OSD startup.
# OSD_SDL_EXEC_AFTER_STARTUP = ""

# Execute a script on OSD close.
# OSD_SDL_EXEC_AFTER_CLOSE = ""

# Stop the osd before playing a movie with xine or mplayer. Some output
# devices need this. After playback, the osd will be restored
# OSD_STOP_WHEN_PLAYING = 0

# Dim text that doesn't fit instead of using ellipses. 
# OSD_DIM_TEXT = 1
    
# ======================================================================
# Freevo remote control settings:
# ======================================================================

#
# Location of the lircrc file
#
# For remote control support, Freevo needs a lircrc file, like this:
#
# begin
#       prog = freevo
#       button = select
#       config = SELECT
# end
#
# Check contrib/lirc for examples and helpers/freevo2lirc.pl for a converter
# script.
#
# LIRCRC = '/etc/freevo/lircrc'

#
# Joystick support
# 0 = Disable joystick support 
# 1 = Use js0, 
# 2 = Use js1, 
#  ... etc
#
# JOY_DEV = 0

# Freevo can support as many buttons as your controller has
# as long as there is a corresponding entry in JOY_CMDS.
# You will also need to plugin.activate('joy').
# FYI: new kernels use /dev/input/jsX, but joy.py will fall back on /dev/jsX
#
# JOY_CMDS = {
#     'up'             : 'UP',
#     'down'           : 'DOWN',
#     'left'           : 'LEFT',
#     'right'          : 'RIGHT',
#     'button 1'       : 'PLAY',
#     'button 2'       : 'PAUSE',
#     'button 3'       : 'STOP',
#     'button 4'       : 'ENTER',
#     }


# ======================================================================
# TVtime settings:
# ======================================================================

#
# Location of the TV time program
# Default: Use the value in freevo.conf
# 
# TVTIME_CMD = CONF.tvtime


# ======================================================================
# MPlayer settings:
# ======================================================================
#MPLAYER_AO_DEV       = 'alsa'  # e.g.: oss,sdl,alsa, see mplayer docs
#MPLAYER_VO_DEV	     = 'xvmc'
#DVD_LANG_PREF        = 'en,se,no'      # Order of preferred languages on DVD.
#DVD_SUBTITLE_PREF    = 'en,da,dk'              # Order of preferred subtitles on DVD.
#MPLAYER_VO_DEV_OPTS  = ''	         # e.g.: ':some_var=vcal'
#MPLAYER_ARGS_DEF     = ('-nolirc -framedrop -vc ffmpeg12mc -autosync 100 -autoq 100 -fs') 

# Priority of mplayer process. 0 is unchanged, <0 is higher prio, >0 lower prio.
# prio <0 has no effect unless run as root.
# MPLAYER_NICE         = -20             
# Mplayer options to use the software scaler. If your CPU is fast enough, you
# might try a software scaler. You can disable it later for some larger files
# with the mplayer option '-nosws'. If you have -framedrop or -hardframedrop
# as mplayer option, the software scaler will also not be used.
# A good value for this variable is:
#MPLAYER_SOFTWARE_SCALER = "-subfont-text-scale 5 -fs -sws 2 -vf scale=%s:-3,"\"expand=%s:%s " % ( CONF.width, CONF.width, CONF.height )
# older versions of mplayer may need
# MPLAYER_SOFTWARE_SCALER = '-xy %s -sws 2 -vop scale:-1:-1:-1:100' % CONF.width
#
#MPLAYER_SOFTWARE_SCALER = '-nosws -framedrop'
#MPLAYER_SOFTWARE_SCALER=''

# Mplayer arguments for different media formats. (eg DVDs, CDs, AVI files, etc)
# Uses a default value if nothing else matches.
#MPLAYER_ARGS = { 'dvd'    : '-cache 8192',
#                 'vcd'    : '-cache 4096',
#                 'cd'     : '-cache 1024 -cdda speed=2',
#                 'tv'     : '-nocache',
#                 'ivtv'   : '-cache 8192',
#                 'avi'    : '-cache 5000 -idx',
#                 'rm'     : '-cache 5000 -forceidx',
#                 'rmvb'   : '-cache 5000 -forceidx',
#                 'webcam' : 'tv:// -tv driver=v4l:width=352:height=288:outfmt=yuy2:device=/dev/video2',
#                 'default': '-cache 8192'
#                 }
## Number of seconds before seek value times out. This is used when
# seeking a specified number of minutes into a movie. If you make
# a mistake or change your mind, the seek value will timeout after
# this many seconds.
# MPLAYER_SEEK_TIMEOUT = 8
# Autocrop files when playing. This is useful for files in 4:3 with black
# bars on a 16:9 tv
# MPLAYER_AUTOCROP = 0
# Try to set correct 'delay' and 'mc' values for mplayer based on the delay
# from mmpython. 
# This should correct av sync problems with mplayer for some files, but 
# may also break things. (I don't know, that's why it's disabled by default). 
# WARNING: When seeking, the playback is out of sync for some seconds! 
#MPLAYER_SET_AUDIO_DELAY = 1

# Mplayer video filter for interlaced or progressive videos. If you have
# a slow pc, do not use post processing
#MPLAYER_VF_INTERLACED  = 'pp/lb'
#MPLAYER_VF_PROGRESSIVE = 'pp'
# For pal and dvb-t recordings, the following looks good
#MPLAYER_VF_INTERLACED  = 'pp=md/de,phase=U'
#
# MPLAYER_VF_INTERLACED  = 'pp=de/fd'
#MPLAYER_VF_PROGRESSIVE = 'pp=de'

# ======================================================================
# Xine settings:
# ======================================================================
XINE_VO_DEV  = 'xxmc'
XINE_AO_DEV = 'alsa'                     # alsa or oss
#XINE_COMMAND = '%s -pqhf --no-splash' % (CONF.xine)
#XINE_COMMAND = '%s --hide-gui -pqf -g -B --no-splash' % (CONF.xine)
XINE_COMMAND = '%s --hide-gui -pq -g -B --geometry %sx%s+0+0 --no-splash' % (CONF.xine, CONF.width, CONF.height)
#XINE_COMMAND = '%s --hide-gui -pq -g -B --no-splash' % (CONF.xine)
#XINE_ARGS_DEF = ''

#very low cpu usage, worst quality. half of vertical resolution is  lost. for some systems (with PCI video cards) this might decrease the  cpu usage when compared to plain video playback (no deinterlacing).
#XINE_ARGS_DEF = '--post tvtime:method=LineDoubler,enabled=1,pulldown=none,framerate_mode=half_top,judder_correction=0,use_progressive_frame_flag=1,chroma_filter=0,cheap_mode=1'

#low cpu usage, poor quality. image is blurred vertically so interlacing effects are removed.
#XINE_ARGS_DEF = '--post tvtime:method=LinearBlend,enabled=1,pulldown=none,framerate_mode=half_top,judder_correction=0,use_progressive_frame_flag=1,chroma_filter=0,cheap_mode=1'

#medium cpu usage, medium quality. image is analised and areas showing interlacing artifacts are fixed (interpolated).
#XINE_ARGS_DEF = '--post tvtime:method=Greedy,enabled=1,pulldown=none,framerate_mode=half_top,judder_correction=0,use_progressive_frame_flag=1,chroma_filter=0,cheap_mode=1'
 
#high cpu usage, good quality. conversion of dvd image format improves quality and fixes chroma upsampling bug.

# ******** Brug dette filter til Futurama ********
XINE_ARGS_DEF = '--post tvtime:method=Greedy,enabled=1,pulldown=none,framerate_mode=half_top,judder_correction=0,use_progressive_frame_flag=1,chroma_filter=0,cheap_mode=0'

#very high cpu usage, great quality. besides using smart deinterlacing algorithms it will also double the frame rate (30->60fps)  to match the field rate of TVs. detects and reverts 3-2 pulldown. *
#XINE_ARGS_DEF = '--post tvtime:method=Greedy2Frame,enabled=1,pulldown=vektor,framerate_mode=full,judder_correction=0,use_progressive_frame_flag=1,chroma_filter=0,cheap_mode=0'
 
#very very high cpu usage, great quality with (experimental) improvements. also enables judder correction (play films at their  original 24 fps speed) and vertical color smoothing (fixes small color  stripes seen in some dvds) *
#XINE_ARGS_DEF = '--post tvtime:method=Greedy2Frame,enabled=1,pulldown=vektor,framerate_mode=full,judder_correction=1,use_progressive_frame_flag=1,chroma_filter=1,cheap_mode=0' 

# ======================================================================
# Freevo TV settings:
# ======================================================================

TV_RECORD_DIR = '/home/freevo/Video/Recordings'
VIDEO_SHOW_DATA_DIR = '/home/freevo/Video/Recordings'

TV_DRIVER = 'v4l2'
TV_DEVICE = '/dev/video0'
TV_INPUT = 0

# For example, TV_OPTS = '-vop pp=ci' would turn on deinterlacing.
TV_OPTS = ''
TV_SETTINGS = '%s television %s %s' % (CONF.tv, CONF.chanlist, TV_DEVICE)

#TV_CHANNEL_PROG = './chchan %(channel)s %(norm)s %(freqtable)s'

TV_DATEFORMAT = '%e-%b' # Day-Month: 11-Jun
TV_TIMEFORMAT = '%H:%M' # Hour-Minute 14:05
TV_DATETIMEFORMAT = '%A %b %d %I:%M %p' # Thursday September 24 8:54 am

TV_RECORDFILE_MASK = '%%m-%%d %%H.%%M %(progname)s - %(title)s'
TV_RECORDFILE_SUFFIX = '.mpeg'

TV_RECORD_SCHEDULE = '%s/record_schedule.xml' % FREEVO_CACHEDIR

TV_RECORD_SERVER_IP = 'localhost'
TV_RECORD_SERVER_PORT = 18001

#TV_RECORD_SERVER_UID = 0
#TV_RECORD_SERVER_GID = 0

#TV_RECORD_PADDING = 3 * 60

#VCR_AUDIO = ( ':alsa:amode=0:adevice=%s:audiorate=48000:buffersize=64' % AUDIO_INPUT_DEVICE )

TV_VIEW_SIZE = (720, 576)
#TV_VIEW_SIZE = (352, 288)
#TV_REC_SIZE = (352, 288)
TV_REC_SIZE = (720, 576)

#TV_VIEW_OUTFMT = 'yuy2'
#TV_REC_OUTFMT  = 'yuy2'

# PRE and POST recording commands.  Set these to a runnable command if
# you wish to have special mixer settings or video post processing.
#VCR_PRE_REC  = 'aumix -1 0 -1 R -i %s' % VCR_IN_VOLUME
#VCR_POST_REC = 'aumix -1 100 -1 R -i 0'
#VCR_PRE_REC  = 'amixer -q cset numid=61 3amixer -q cset numid=62 1;amixer -q cset numid=63 16;amixer -q sset Aux 0 mute'
#VCR_POST_REC  = 'amixer -q cset numid=61 3;amixer -q cset numid=62 0;amixer -q cset numid=63 0;amixer -q sset Aux 16 unmute'
	       
# VCR_CMD = ('nice -n -2 ' + CONF.mencoder + ' tv:// ' +
# 	    '-oac mp3lame -lameopts mode=3:fast:preset=medium ' +
# 	    '-force-avi-aspect 1.33 '+ 
#             '-ovc lavc ' +
# 	    '-vf pp=lb/al ' +
# 	    '-lavcopts vcodec=mpeg4:' +
# 	    'vbitrate=1150:mbd=1:vqmin=2:' +
# 	    'vlelim=-4:vcelim=7:lumi_mask=0.15:' + 
# 	    'dark_mask=0.07:vqcomp=0.5:' + 
# 	    'vqblur=0.2:mpeg_quant:keyint=50 ' +
# 	    '-ffourcc divx -noskip ' +
# 	    '-tv driver=%s:' % TV_DRIVER +
# 	    'outfmt=%s:' % TV_REC_OUTFMT +
# 	    'input=%s:' % TV_INPUT +
# 	    'width=%s:height=%s:' % (TV_REC_SIZE[0], TV_REC_SIZE[1]) +
# 	    'device=%s:' % TV_DEVICE +
# 	    'norm=%s:' % CONF.tv +
# 	    'chanlist=%s:' % CONF.chanlist +
# 	    'channel=%(channel)s' +
# 	    VCR_AUDIO + ' ' +
# 	    '-endpos %(seconds)s' +
# 	    ' -o %(filename)s' )

TV_IVTV_OPTIONS = {
    'resolution'    : '720x576',
    'aspect'        : 2,
    'audio_bitmask' : 0xE9,
    'bframes'       : 3,
    'bitrate_mode'  : 0,
    'bitrate'       : 3300000,
    'bitrate_peak'  : 8000000,
    'dnr_mode'      : 3,
    'dnr_spatial'   : 0,
    'dnr_temporal'  : 0,
    'dnr_type'      : 0,
    'framerate'     : 0,
    'framespergop'  : 12,
    'gop_closure'   : 1,
    'pulldown'      : 0,
    'stream_type'   : 14,
}

#TV_IVTVREC_OPTIONS = {
#    'resolution'    : '352x288',
#    'aspect'        : 2,
#    'audio_bitmask' : 0xE9,
#    'bframes'       : 3,
#    'bitrate_mode'  : 0,
#    'bitrate'       : 3300000,
#    'bitrate_peak'  : 8000000,
#    'dnr_mode'      : 3,
#    'dnr_spatial'   : 0,
#    'dnr_temporal'  : 0,
#    'dnr_type'      : 0,
#    'framerate'     : 0,
#    'framespergop'  : 12,
#    'gop_closure'   : 1,
#    'pulldown'      : 0,
#    'stream_type'   : 14,
#}

VIDEO_GROUPS = [
    VideoGroup(vdev='/dev/video0',
               adev=None,
               input_type='tuner',
	       input_num=6,
               tuner_norm=CONF.tv,
	       tuner_type='internal',
	       group_type='ivtv',
               tuner_chanlist=CONF.chanlist,
               desc='Default Video Group',
               recordable=True),
]

FREQUENCY_TABLE = {
    'K07'	:  189250,
    'K08'	:  196250,
    'K10'	:  210250,
    'K11'	:  217250,
    'K21'	:  471250,
    'K23'	:  487250,
    'K25'	:  503250,
    'K27'	:  519250,
    'K28'	:  527250,
    'K29'	:  535250,
    'K30' 	:  543250,
    'K38'	:  607250,
    'K39'	:  615250,
    'K43'	:  687250,
    'K49'	:  695250,
    'K57'	:  759250
}

TV_CHANNELS = [
    ( '003.tv.tv2.dk', 'DR 1', 'K07'),
    ( '004.tv.tv2.dk', 'DR 2', 'K08'),
    ( '001.tv.tv2.dk', 'TV 2', 'K11' ), 
    ( '006.tv.tv2.dk', 'TV3', 'K25' ), 
    ( '005.tv.tv2.dk', '3+', 'K23' ), 
    ( '008.tv.tv2.dk', 'Tv Danmark', 'K10' ),
    ( '007.tv.tv2.dk', 'Kanal 5', 'K57'),
    ( '002.tv.tv2.dk', 'TV 2 Zulu', 'K30' ), 
    ( '002.tv.tv2.dk', 'NRK 1', 'K27' ), 
    ( '033.tv.tv2.dk', 'TV 2 Norge', 'K38' ),
    ( '024.tv.tv2.dk', 'TV 1 Sverige', 'K28' ),
    ( '025.tv.tv2.dk', 'TV 2 Sverige', 'K29' ),
    ( '027.tv.tv2.dk', 'TV 4 Sverige', 'K21' ),
    ( '042.tv.tv2.dk', 'MTV', 'K49'),
    ( '041.tv.tv2.dk', 'Discovery', 'K39'),
    ( '043.tv.tv2.dk', 'National Geographic', 'K43')]
    
XMLTV_GRABBER = 'tv_grab_dk'
XMLTV_SORT = '/usr/bin/tv_sort'
XMLTV_DAYS = 3

# ======================================================================
# Freevo builtin WWW server settings:
# ======================================================================

# To activate the built in web server, uncomment the following line
plugin.activate('www')

# Web server port number. 80 is the standard port, but is often
# taken already by apache, and cannot be used unless the server
# runs as root. Port 8080 is the default, change to 80 if
# needed.
WWW_PORT = 8080

# Username / Password combinations to login to the web interface.
WWW_USERS = { "" : "" }
# Divide the TV guide into intervals of this length (in minutes)
#WWW_GUIDE_INTERVAL = 30
# Precision for TV guide (in minutes)
#WWW_GUIDE_PRECISION = 5 #
# Show this many blocks at once
#WWW_GUIDE_COLS = 6
# WWW_STYLESHEET = 'styles/main.css'
# WWW_JAVASCRIPT = 'scripts/display_prog-head.js'


# ======================================================================
# Internal stuff, you shouldn't change anything here unless you know
# what you are doing
# ======================================================================

#
# Config for xml support in the movie browser
# the regexp has to be with ([0-9]|[0-9][0-9]) so we can get the numbers
#
# VIDEO_SHOW_REGEXP = "s?([0-9]|[0-9][0-9])[xe]([0-9]|[0-9][0-9])[^0-9]"


#
# Remote control daemon. The server is in the Freevo main application,
# and the client is a standalone application in rc_client/
#
# ENABLE_NETWORK_REMOTE = 0
# REMOTE_CONTROL_HOST = '127.0.0.1'
# REMOTE_CONTROL_PORT = 16310


# XMLTV File
# This is the XMLTV file that can be optionally used for TV listings
XMLTV_FILE = '/tmp/freevo/xmltv/TV.xml'
# XML TV Logo Location
# Use the "makelogos.py" script to download all the
# Station logos into a directory. And then put the path
# to those logos here
TV_LOGOS = '/tmp/freevo/xmltv/logos'

#LOCALE='latin-1'

