# /home/mythtv/.mythtv/lircrc
#
# From Knoppmyth R5.5 - Copied by UniCav
#
# Media Center Edition Remote Control and 
# Remote Control Keys on Media Center Keyboard
#
##############################################################################
# For use with the USB MCE ir receiver
# MythTV LIRC config file for the mceusb2 or lirc_mod_mce module

# Info about lircrc statment
#begin
#  prog    = ... Program controlled, irxevent, irexec, mythtv, mplayer, 
#                xine, or others
#  remote  = ... mceusb, or what ever you happen to have or want to call it
#  button  = ... remote keys names from your lircd.conf file
#  repeat  = ... repeat = 2 is fast, repeat = 4 is slower
#  delay   = ... delay before repeat, 1 is short, 4 is longer
#  config  = ... output key presses to key bindings editor
#  mode    = ...
#  flags   = ...
#end

# Test your new Lirc settings
#   /etc/init.d/lirc restart    To restart Lirc
#   ctrl-alt-backspace          To restart the frontend

# Updated January 30th 2008 BAK
# for the Knoppmyth project

################################### irexec ###################################
# the lirc irexec program must be running for this section

# Will perform a complete shutdown
#begin
#       prog   = irexec
#       button = Power
#       config = /usr/bin/sudo halt
#end

############################### Mythtv Section ###############################
# MythTV Key Binding Editor     location
# Mythtv Menu >>Utilities / Setup >>Edit Keys
# Key Bindings can also be found in Myth Web

# Record
begin
  prog   = mythtv
  button = Record
  config = R
end

# Stop
begin
  prog   = mythtv
  button = Stop
  config = Esc
end

# Pause
begin
  prog   = mythtv
  button = Pause
  config = P
end

# Rewind (while viewing)
begin
  prog   = mythtv
  button = Rewind
  repeat = 0
  delay  = 1
  config = <
end

# Fast forward (while viewing)
begin
  prog   = mythtv
  button = Forward
  repeat = 0
  delay  = 1
  config = >
end

# Play
begin
  prog   = mythtv
  button = Play
  config = L
end

# Skip backward (1 min default)
begin
  prog   = mythtv
  button = Replay
  repeat = 4
  delay  = 4
  config = PgUp
end

# Skip forward (1 min default)
begin
  prog   = mythtv
  button = Skip
  repeat = 4
  delay  = 4
  config = PgDown
end

#<><><><><><><><><><><> Mythtv Control <><><><>

# Escape/Exit/Back
begin
  prog   = mythtv
  button = Back
  config = Esc
end

# Bring up OSD info
begin
  prog   = mythtv
  button = More
  config = I
end

begin
  prog   = mythtv
  button = Left
  repeat = 2
  delay  = 4
  config = Left
end

begin
  prog   = mythtv
  button = Right
  repeat = 2
  delay  = 4
  config = Right
end

begin
  prog   = mythtv
  button = Up
  repeat = 2
  delay  = 4
  config = Up
end

begin
  prog   = mythtv
  button = Down
  repeat = 2
  delay  = 4
  config = Down
end

# OK/Select
begin
  prog   = mythtv
  button = OK
  config = Return
end

# The Start Button is really just a Menu key
begin
  prog   = mythtv
  button = Start
  config = M
end

#<><><><><><><><><><><><><><><>

# Volume-Up
begin
  prog   = mythtv
  button = VolumeUp
  repeat = 1
  config = ]
end

# Volume-Down
begin
  prog   = mythtv
  button = VolumeDown
  repeat = 1
  config = [
end

# Mute
begin
  prog   = mythtv
  button = Mute
  config = |
end

# Channel Up
begin
  prog   = mythtv
  button = ChannelUp
  repeat = 3
# delay  = 1
  config = Up
end

# Channel Down
begin
  prog   = mythtv
  button = ChannelDown
  config = Down
  repeat = 3
# delay  = 1
end

# Numbers 0-9 <><><><><><><><><><><>

begin
  prog   = mythtv
  button = One
# repeat = 2
  config = 1
end

begin
  prog   = mythtv
  button = Two
# repeat = 2
  config = 2
end

begin
  prog   = mythtv
  button = Three
# repeat = 2
  config = 3
end

begin
  prog   = mythtv
  button = Four
# repeat = 2
  config = 4
end

begin
  prog   = mythtv
  button = Five
# repeat = 2
  config = 5
end

begin
  prog   = mythtv
  button = Six
# repeat = 2
  config = 6
end

begin
  prog   = mythtv
  button = Seven
# repeat = 2
  config = 7
end

begin
  prog   = mythtv
  button = Eight
# repeat = 2
  config = 8
End

begin
  prog   = mythtv
  button = Nine
# repeat = 2
  config = 9
end

begin
  prog   = mythtv
  button = Zero
# repeat = 2
  config = 0
end

#<><><><><><><><><><><><><><><><><><><><>
# Seek to previous commercial cut point
# or remove all cut points from the Editing Cutlist
begin
  prog   = mythtv
  button = Star
  config = Q
end

# Seek to next commercial cut point
# or add commericial cut points to the Editing Cutlist
begin
  prog   = mythtv
  button = Hash
  config = Z
end

# Brings up the delete box
begin
  prog   = mythtv
  button = Clear
  repeat = 0
  config = D
end

# Toggle Editing Cutlist on or off
begin
  prog   = mythtv
  button = Enter
  repeat = 0
  config = E
end

#<><><><><><><><> Additional Remote Commands <><><><><><><><>
# All buttons in this section must be configured using
# MythTV's KeyBindings JumpPoints editor.
# >>> Utilities/ Setup >>> Edit Keys >>> JumpPoints >>>

# Listen to Myth Music
begin
  prog   = mythtv
  button = Music
  config = Ctrl+Alt+M
end

# at this time connects to MythStreem
begin
  prog = mythtv
  button = Radio
  config = Ctrl+Alt+S
end

# View Pictures
begin
  prog   = mythtv
  button = Pictures
  config = Ctrl+Alt+P
end

# Watch Videos
begin
  prog   = mythtv
  button = Videos
  config = Ctrl+Alt+V
end

# Watch Live TV with Live TV Guide open
begin
  prog   = mythtv
  button = TV
  config = Ctrl+Alt+K
end

# Watch Live TV
begin
  prog   = mythtv
  button = LiveTV
  config = Ctrl+Alt+L
end

# Recorded TV Programs
begin
  prog   = mythtv
  button = RecordedTV
  config = Ctrl+Alt+R
end

# Program Guide
begin
  prog   = mythtv
  button = Guide
  config = Ctrl+Alt+G
end

# Play DVD
# There must be a disk in the DVD drive or it dos nothing
begin
  prog   = mythtv
  button = DVDMenu
  config = Ctrl+Alt+D
end

# unused key
#begin
#  prog   = mythtv
#  button = Messenger
#  config = Ctrl+Alt+A
#end

# <><><><><><><><><><><><><> Teletext Buttons <><><><><><><><><><><>

# Teletext = Show interactive MHEG screens
begin
  prog   = mythtv
  button = Teletext
  config = F7
end

# Red = Red button for interactive screens.
begin
  prog   = mythtv
  button = Red
  config = F2
end

# Green = Green button for interactive screens.
begin
  prog   = mythtv
  button = Green
  config = F3
end

# Yellow = Yellow button for interactive screens.
begin
  prog   = mythtv
  button = Yellow
  config = F4
end

# Blue = Blue button for interactive screens.
begin
  prog   = mythtv
  button = Blue
  config = F5
end


######################## MPlayer Section #####################################
# "mplayer -input keylist" Prints all keys that can be bound to commands.
# "mplayer -input cmdlist" Prints all commands that can be bound to keys
# "man mplayer" Prints documentation for MPlayer

# Show OSD
begin
  prog   = mplayer
  button = OK
  config = osd
end

# Pause playback
begin
  prog   = mplayer
  button = Pause
  config = pause
end

# If paused, resume playing
begin
  prog   = mplayer
  button = Play
  config = pause
end

# Stop playback and exit
begin
  prog   = mplayer
  button = Stop
  config = quit
end

# Volume-Up
begin
  prog   = mplayer
  button = VolumeUp
  repeat = 2
  config = volume +1
end

# Volume-Down
begin
  prog   = mplayer
  button = VolumeDown
  repeat = 2
  config = volume -1
end

# Mute
begin
  prog   = mplayer
  button = Mute
  config = mute
end

# Seek back 60 seconds
begin
  prog   = mplayer
  button = Left
  repeat = 2
  config = seek -60
end

# Seek forward 60 seconds
begin
  prog   = mplayer
  button = Right
  repeat = 2
  config = seek +60
end

# Seek back 10 seconds
begin
  prog   = mplayer
  button = Rewind
  repeat = 2
  config = seek -10
end

# Seek forward 30 seconds
begin
  prog   = mplayer
  button = Forward
  repeat = 2
  config = seek +30
end

# Quit
begin
  prog   = mplayer
  button = Back
  config = quit
end

# Seek forward 10 minutes
begin
  prog   = mplayer
  button = Skip
  repeat = 2
  config = seek +600
end

# Seek backward 10 minutes
begin
  prog   = mplayer
  button = Replay
  repeat = 2
  config = seek -600
end

# increase brightness
begin
  prog   = mplayer
  button = ChannelUp
  repeat = 2
  config = brightness +1
end

# decrease brightness
begin
  prog   = mplayer
  button = ChannelDown
  repeat = 2
  config = brightness -1
end

# Toggle full-screen
#begin
#  prog   = mplayer
#  button = #???????????????????????????
#  repeat = 2
#  config = vo_fullscreen
#end


########################## XINE Section ######################################
#
# For a compleate list of Xine's Lirc Keybindings use comand
#        xine --keymap=lirc>.lircrc.xine.keybindings
# This creates a file in current directory called ".lircrc.xine.keybindings"
# Note: Xine has diferent sets of keybindings for lirc and keyboard

##  01/14/2008
# xine key bindings.
# Automatically generated by xine-ui version 0.99.6cvs.

#<><><><><><><><><><> Xine Video Movement <><><><>

# start playback
begin
  prog   = xine
  button = Play
  config = Play
end

# playback pause toggle
begin
  prog   = xine
  button = Pause
  config = Pause
end

# stop playback
begin
  prog   = xine
  button = Stop
  config = Stop
end

# take a snapshot
#begin
#   prog   = xine
#   button = Record
#   repeat = 2
#   config = Snapshot
#end

begin
  prog   = xine
  button = Forward
  repeat = 2
# delay  = 1
  config = SeekRelative+7
end

begin
  prog   = xine
  button = Rewind
  repeat = 2
# delay  = 1
  config = SeekRelative-7
end

# set position to -60 seconds in current stream
begin
  prog   = xine
  button = Replay
  repeat = 2
  delay  = 1
  config = SeekRelative-60
end

# set position to +60 seconds in current stream
begin
  prog   = xine
  button = Skip
  repeat = 2
  delay  = 1
  config = SeekRelative+60
end
#<><><><><><><><><><><><>Xine Control<><><><><><><><><>

# quit the program
begin
  prog   = xine
  button = Back
  config = Quit
end

#display stream information using OSD
begin
  prog   = xine
  button = More
  config = OSDStreamInfos
end

# menu navigate up
begin
  prog   = xine
  button = Up
  repeat = 2
  delay  = 2
  config = EventUp
end

# menu navigate down
begin
  prog   = xine
  button = Down
  repeat = 2
  delay  = 2
  config = EventDown
end

# menu navigate left
begin
  prog   = xine
  button = Left
  repeat = 2
  delay  = 2
  config = EventLeft
end

# menu navigate right
begin
  prog   = xine
  button = Right
  repeat = 2
  delay  = 2
  config = EventRight
end

# menu select
begin
  prog   = xine
  button = OK
  config = EventSelect
end

# jump to Root Menu
begin
  prog   = xine
  button = Start
  config = Menu
end

#<><><><><><><><><><><><><><><><><><><> Xine Volume / Channel <><><><><><><><>

# increment audio volume
begin
  prog   = xine
  button = VolumeUp
  repeat = 1
  config = Volume+
end

# decrement audio volume
begin
  prog   = xine
  button = VolumeDown
  repeat = 1
  config = Volume-
end

# audio muting toggle
begin
  prog   = xine
  button = Mute
  config = Mute
end

# increase brightness by 10
begin
  prog   = xine
  button = ChannelUp
  config = BrightnessControl+
end

# decrease brightness by 10
begin
  prog   = xine
  button = ChannelDown
  config = BrightnessControl-
end

#<><><><><><><><><><><><><><><><><> Xine Menu <><><><>

# unused key
#begin
#   prog   = xine
#   button = RecordedTV
#   config = ????????
#end

# visibility toggle of stream info window
begin
  prog   = xine
  button = Guide
  config = SetupShow
end

# unused key
#begin
#  prog   = xine
#  button = LiveTV
#  config = ????????
#end

# jump to Title Menu
begin
  prog   = xine
  button = DVDMenu
  config = RootMenu
end

#<><><><><><><><><><><><><><><><><> Xine Stream Position <><><><>

# set position in current stream

begin
  prog   = xine
  button = Zero
  config = SetPosition0%
end

begin
  prog   = xine
  button = One
  config = SetPosition10%
end

begin
  prog   = xine
  button = Two
  config = SetPosition20%
end

begin
  prog   = xine
  button = Three
  config = SetPosition30%
end

begin
  prog   = xine
  button = Four
  config = SetPosition40%
end

begin
  prog   = xine
  button = Five
  config = SetPosition50%
end

begin
  prog   = xine
  button = Six
  config = SetPosition60%
end

begin
  prog   = xine
  button = Seven
  config = SetPosition70%
end

begin
  prog   = xine
  button = Eight
  config = SetPosition80%
end

begin
  prog   = xine
  button = Nine
  config = SetPosition90%
end

#<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

# decrement playback speed (slow motion slowdown)
begin
  prog   = xine
  button = Star
  config = SpeedSlower
end

# increment playback speed (slow motion speedup)
begin
  prog   = xine
  button = Hash
  config = SpeedFaster
end

# reset playback speed
begin
  prog   = xine
  button = Clear
  config = SpeedReset
end

# set position to -30 seconds in current stream     config = SeekRelative-30
# set position to +30 seconds in current stream     config = SeekRelative+30
# eject the current medium                          config = Eject
# zoom in                                           config = ZoomIn
# zoom out                                          config = ZoomOut
# fullscreen toggle                                 config = ToggleFullscreen

##
# End of xine .
##
