# /home/mythtv/.mythtv/lircrc
#
# 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


# 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

# Teletext = used as power down button
begin
       prog = irexec
       button = KEY_SUBTITLE
       config =  /usr/bin/sudo halt
#       config = sudo /sbin/shutdown -h -t 0 now
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 = KEY_RECORD
       config = R
end

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

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

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

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

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

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

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

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

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

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

begin
       prog = mythtv
       button = KEY_LEFT
       repeat = 3
       delay   = 4
       config = Left
end

begin
       prog = mythtv
       button = KEY_RIGHT
       repeat = 3
       delay   = 4
       config = Right
end

begin
       prog = mythtv
       button = KEY_UP
       repeat = 3
       delay   = 4
       config = Up
end

begin
       prog = mythtv
       button = KEY_DOWN
       repeat = 3
       delay   = 4
       config = Down
end

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

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

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

# Volume-Up
begin
       prog = mythtv
       button = KEY_VOLUMEUP
       repeat = 2
       config = ]
end

# Volume-Down
begin
       prog = mythtv
       button = VOLUMEDOWN
       repeat = 2
       config = [
end

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

# Channel Up
begin
       prog = mythtv
       button = KEY_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 = KEY_1
#       repeat = 2
       config = 1
end

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

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

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

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

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

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

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

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

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

# Use Zoom for Aspect Ratio
begin
       prog = mythtv
       button = KEY_ZOOM
       config = W
end

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

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

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

# Toggle Editing Cutlist on or off
begin
       prog = mythtv
       button = KEY_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 = KEY_AUDIO
       config = Ctrl+T
end

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

# View Pictures
begin
       prog = mythtv
       button = KEY_CAMERA
       config = Ctrl+G
end

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

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

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

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

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

# Play DVD
# There must be a disk in the DVD drive or it dos nothing
begin
       prog = mythtv
       button = KEY_DVD
       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 = Teltext
#       config = F7
#end

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

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

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

# Blue = Blue button for interactive screens.
begin
       prog = mythtv
       button = KEY_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 = KEY_OK
       config = osd
end

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

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

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

# Exit playback
begin
       prog = mplayer
       button = KEY_EXIT
       config = q
end

# Subtitle 
begin
       prog = mplayer
       button = KEY_TITLE
       config = sub_visibility
end

# Subtitle language 
begin
       prog = mplayer
#       button = Language
       button = KEY_BLUE
       config = vobsub_lang
end

# Audio language 
begin
       prog = mplayer
       button = KEY_LANGUAGE
       config = switch_audio
end

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

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

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

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

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

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

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

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

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

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

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

# decrease brightness
begin
       button = KEY_CHANNELDOWN
       prog   = mplayer
       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 = KEY_PLAY
  config = Play
end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# decrease brightness by 10
begin
  prog   = xine
  button = KEY_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 = KEY_EPG
  config = SetupShow
end

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

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

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

# set position in current stream

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# unused key
#begin
#       prog   = xine
#       button = clear
#       config = ?????????
#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 .
##
