[mythtvnz] MythTV + MPlayer + Xine + Remote - A Solution

OpenMedia Support mythtvnz@lists.linuxnut.co.nz
Tue, 22 Aug 2006 23:28:06 +1200


This is a multi-part message in MIME format.
--------------010006090202080401070300
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Ok sorry this has taken so long, but here is the recipe I'm using.

Copy these files as follows -

keymap -> ~mythtv/.xine/
lircrc.mce2 -> ~mythtv/.mythtv/lircrc
input.conf -> ~mythtv/.mplayer

keymap - remaps some of the xine keys so that the remote will work sensibily
lircrc.mce2 - uses irxevent for most mappings, but some custom maps for xine
input.conf - just a couple of tweaks for mplayer to behave

Now the hotkeys will work if you follow the hotkey map I have at
http://openmedia.co.nz/openmedia/content/view/27/59/

The only other thing are the missing /etc/lircd.conf maps for the hash
and star keys which are

        Hash     0x00007be3
        Star     0x0000fbe2


Let me know how you get on with this, and if you think there is a better
mapping.

Note that the arrow keys only work the menu in xine, ffwd/rwnd use
different key maps. It was the only way to get the menus to work the way
I wanted them.

Steve

-- 
Technical Support - OpenMedia Limited
email   - support@openmedia.co.nz
sales   - sales@openmedia.co.nz
website - http://www.openmedia.co.nz


--------------010006090202080401070300
Content-Type: text/plain;
 name="keymap"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="keymap"

##
# xine key bindings.
# Automatically generated by xine-ui version 0.99.4.
##

# start playback
Play {
	key = l
	modifier = control
}

# playback pause toggle
Pause {
	key = p
	modifier = control
}

# stop playback
Stop {
	key = S
	modifier = none
}

# take a snapshot
Snapshot {
	key = t
	modifier = none
}

# eject the current medium
Eject {
	key = e
	modifier = none
}

# select and play next MRL in the playlist
NextMrl {
	key = VOID
	modifier = none
}

# select and play previous MRL in the playlist
PriorMrl {
	key = VOID
	modifier = none
}

# loop mode toggle
ToggleLoopMode {
	key = VOID
	modifier = none
}

# stop playback after played stream
PlaylistStop {
	key = l
	modifier = none
}

# scan playlist to grab stream infos
ScanPlaylistInfo {
	key = s
	modifier = control
}

# add a mediamark from current playback
AddMediamark {
	key = a
	modifier = control
}

# edit selected mediamark
MediamarkEditor {
	key = e
	modifier = control
}

# set position to -60 seconds in current stream
SeekRelative-60 {
	key = Prior
	modifier = control
}

# set position to +60 seconds in current stream
SeekRelative+60 {
	key = Next
	modifier = control
}

# set position to -30 seconds in current stream
SeekRelative-30 {
	key = Left
	modifier = meta
}

# set position to +30 seconds in current stream
SeekRelative+30 {
	key = Right
	modifier = meta
}

# set position to -15 seconds in current stream
SeekRelative-15 {
	key = Left
	modifier = control
}

# set position to +15 seconds in current stream
SeekRelative+15 {
	key = Right
	modifier = control
}

# set position to -7 seconds in current stream
SeekRelative-7 {
	key = Left
	modifier = mod3
}

# set position to +7 seconds in current stream
SeekRelative+7 {
	key = Right
	modifier = mod3
}

# set position to beginning of current stream
SetPosition0% {
	key = 0
	modifier = none
}

# set position to 10% of current stream
SetPosition10% {
	key = 1
	modifier = none
}

# set position to 20% of current stream
SetPosition20% {
	key = 2
	modifier = none
}

# set position to 30% of current stream
SetPosition30% {
	key = 3
	modifier = none
}

# set position to 40% of current stream
SetPosition40% {
	key = 4
	modifier = none
}

# set position to 50% of current stream
SetPosition50% {
	key = 5
	modifier = none
}

# set position to 60% of current stream
SetPosition60% {
	key = 6
	modifier = none
}

# set position to 70% of current stream
SetPosition70% {
	key = 7
	modifier = none
}

# set position to 80% of current stream
SetPosition80% {
	key = 8
	modifier = none
}

# set position to 90% of current stream
SetPosition90% {
	key = 9
	modifier = none
}

# increment playback speed
SpeedFaster {
	key = Up
	modifier = control
}

# decrement playback speed
SpeedSlower {
	key = Down
	modifier = control
}

# reset playback speed
SpeedReset {
	key = Down
	modifier = meta
}

# increment audio volume
Volume+ {
	key = ]
	modifier = none
}

# decrement audio volume
Volume- {
	key = [
	modifier = none
}

# increment amplification level
Amp+ {
	key = V
	modifier = control
}

# decrement amplification level
Amp- {
	key = v
	modifier = control
}

# reset amplification to default value
ResetAmp {
	key = A
	modifier = control
}

# audio muting toggle
Mute {
	key = VOID
	modifier = none
}

# select next audio channel
AudioChannelNext {
	key = plus
	modifier = none
}

# select previous audio channel
AudioChannelPrior {
	key = minus
	modifier = none
}

# visibility toggle of audio post effect window
APProcessShow {
	key = VOID
	modifier = none
}

# toggle post effect usage
APProcessEnable {
	key = VOID
	modifier = none
}

# select next sub picture (subtitle) channel
SpuNext {
	key = period
	modifier = none
}

# select previous sub picture (subtitle) channel
SpuPrior {
	key = comma
	modifier = none
}

# interlaced mode toggle
ToggleInterleave {
	key = i
	modifier = control
}

# cycle aspect ratio values
ToggleAspectRatio {
	key = a
	modifier = none
}

# reduce the output window size by factor 1.2
WindowReduce {
	key = less
	modifier = none
}

# enlarge the output window size by factor 1.2
WindowEnlarge {
	key = greater
	modifier = none
}

# set video output window to 50%
Window50 {
	key = 1
	modifier = meta
}

# set video output window to 100%
Window100 {
	key = 2
	modifier = meta
}

# set video output window to 200%
Window200 {
	key = 3
	modifier = meta
}

# zoom in
ZoomIn {
	key = z
	modifier = none
}

# zoom out
ZoomOut {
	key = Z
	modifier = none
}

# zoom in horizontally
ZoomInX {
	key = z
	modifier = control
}

# zoom out horizontally
ZoomOutX {
	key = Z
	modifier = control
}

# zoom in vertically
ZoomInY {
	key = z
	modifier = meta
}

# zoom out vertically
ZoomOutY {
	key = Z
	modifier = meta
}

# reset zooming
ZoomReset {
	key = z
	modifier = control, meta
}

# resize output window to stream size
Zoom1:1 {
	key = s
	modifier = none
}

# fullscreen toggle
ToggleFullscreen {
	key = f
	modifier = none
}

# Xinerama fullscreen toggle
ToggleXineramaFullscr {
	key = F
	modifier = none
}

# jump to media Menu
Menu {
	key = m
	modifier = none
}

# jump to Title Menu
TitleMenu {
	key = F1
	modifier = none
}

# jump to Root Menu
RootMenu {
	key = F2
	modifier = none
}

# jump to Subpicture Menu
SubpictureMenu {
	key = F3
	modifier = none
}

# jump to Audio Menu
AudioMenu {
	key = F4
	modifier = none
}

# jump to Angle Menu
AngleMenu {
	key = F5
	modifier = none
}

# jump to Part Menu
PartMenu {
	key = F6
	modifier = none
}

# menu navigate up
EventUp {
	key = KP_Up
	modifier = control
}

# menu navigate down
EventDown {
	key = KP_Down
	modifier = control
}

# menu navigate left
EventLeft {
	key = KP_Left
	modifier = control
}

# menu navigate right
EventRight {
	key = KP_Right
	modifier = control
}

# menu select
EventSelect {
	key = KP_Enter
	modifier = control
}

# jump to next chapter
EventNext {
	key = KP_Next
	modifier = control
}

# jump to previous chapter
EventPrior {
	key = KP_Prior
	modifier = control
}

# select next angle
EventAngleNext {
	key = KP_Home
	modifier = none
}

# select previous angle
EventAnglePrior {
	key = KP_End
	modifier = none
}

# visibility toggle of help window
HelpShow {
	key = h
	modifier = meta
}

# visibility toggle of video post effect window
VPProcessShow {
	key = P
	modifier = meta
}

# toggle post effect usage
VPProcessEnable {
	key = P
	modifier = control, meta
}

# visibility toggle of output window
ToggleWindowVisibility {
	key = h
	modifier = none
}

# bordered window toggle of output window
ToggleWindowBorder {
	key = b
	modifier = none
}

# visibility toggle of UI windows
ToggleVisibility {
	key = g
	modifier = none
}

# visibility toggle of control window
ControlShow {
	key = c
	modifier = meta
}

# visibility toggle of mrl browser window
MrlBrowser {
	key = VOID
	modifier = meta
}

# visibility toggle of playlist editor window
PlaylistEditor {
	key = p
	modifier = meta
}

# visibility toggle of the setup window
SetupShow {
	key = s
	modifier = meta
}

# visibility toggle of the event sender window
EventSenderShow {
	key = e
	modifier = meta
}

# visibility toggle of analog TV window
TVAnalogShow {
	key = t
	modifier = meta
}

# visibility toggle of log viewer
ViewlogShow {
	key = l
	modifier = meta
}

# visibility toggle of stream info window
StreamInfosShow {
	key = i
	modifier = meta
}

# display stream information using OSD
OSDStreamInfos {
	key = i
	modifier = none
}

# show OSD menu
OSDMenu {
	key = O
	modifier = none
}

# enter key binding editor
KeyBindingEditor {
	key = k
	modifier = meta
}

# open file selector
FileSelector {
	key = o
	modifier = none
}

# select a subtitle file
SubSelector {
	key = S
	modifier = control
}

# download a skin from the skin server
SkinDownload {
	key = d
	modifier = control
}

# display MRL/Ident toggle
MrlIdentToggle {
	key = t
	modifier = control
}

# grab pointer toggle
GrabPointer {
	key = Insert
	modifier = none
}

# enter the number 0
Number0 {
	key = 0
	modifier = mod3
}

# enter the number 1
Number1 {
	key = 1
	modifier = mod3
}

# enter the number 2
Number2 {
	key = 2
	modifier = mod3
}

# enter the number 3
Number3 {
	key = 3
	modifier = mod3
}

# enter the number 4
Number4 {
	key = 4
	modifier = mod3
}

# enter the number 5
Number5 {
	key = 5
	modifier = mod3
}

# enter the number 6
Number6 {
	key = 6
	modifier = mod3
}

# enter the number 7
Number7 {
	key = 7
	modifier = mod3
}

# enter the number 8
Number8 {
	key = 8
	modifier = mod3
}

# enter the number 9
Number9 {
	key = 9
	modifier = mod3
}

# add 10 to the next entered number
Number10add {
	key = plus
	modifier = mod3
}

# set position in current stream to numeric percentage
SetPosition% {
	key = slash
	modifier = none
}

# set position forward by numeric argument in current stream
SeekRelative+ {
	key = Up
	modifier = meta
}

# set position back by numeric argument in current stream
SeekRelative- {
	key = Up
	modifier = mod3
}

# change audio video syncing (delay video)
AudioVideoDecay+ {
	key = VOID
	modifier = none
}

# change audio video syncing (delay audio)
AudioVideoDecay- {
	key = n
	modifier = none
}

# reset audio video syncing offset
AudioVideoDecayReset {
	key = Home
	modifier = none
}

# change subtitle syncing (delay video)
SpuVideoDecay+ {
	key = M
	modifier = control
}

# change subtitle syncing (delay subtitles)
SpuVideoDecay- {
	key = N
	modifier = control
}

# reset subtitle syncing offset
SpuVideoDecayReset {
	key = End
	modifier = none
}

# toggle TV modes (on the DXR3)
ToggleTVmode {
	key = o
	modifier = control
}

# switch Monitor to DPMS standby mode
DPMSStandby {
	key = d
	modifier = none
}

# increase hue by 10
HueControl+ {
	key = VOID
	modifier = none
}

# decrease hue by 10
HueControl- {
	key = VOID
	modifier = none
}

# increase saturation by 10
SaturationControl+ {
	key = VOID
	modifier = none
}

# decrease saturation by 10
SaturationControl- {
	key = VOID
	modifier = none
}

# increase brightness by 10
BrightnessControl+ {
	key = VOID
	modifier = none
}

# decrease brightness by 10
BrightnessControl- {
	key = VOID
	modifier = none
}

# increase contrast by 10
ContrastControl+ {
	key = VOID
	modifier = none
}

# decrease contrast by 10
ContrastControl- {
	key = VOID
	modifier = none
}

# quit the program
Quit {
	key = Escape
	modifier = none
}

# VDR Red button
VDRButtonRed {
	key = VOID
	modifier = none
}

# VDR Green button
VDRButtonGreen {
	key = VOID
	modifier = none
}

# VDR Yellow button
VDRButtonYellow {
	key = VOID
	modifier = none
}

# VDR Blue button
VDRButtonBlue {
	key = VOID
	modifier = none
}

# VDR play
VDRPlay {
	key = VOID
	modifier = none
}

# VDR Pause
VDRPause {
	key = VOID
	modifier = none
}

# VDR Stop
VDRStop {
	key = VOID
	modifier = none
}

# VDR Record
VDRRecord {
	key = VOID
	modifier = none
}

# VDR Fast Forward
VDRFastFwd {
	key = VOID
	modifier = none
}

# VDR Fast Rewind
VDRFastRew {
	key = VOID
	modifier = none
}

# VDR power
VDRPower {
	key = VOID
	modifier = none
}

# VDR next channel
VDRChannelPlus {
	key = VOID
	modifier = none
}

# VDR previous channel
VDRChannelMinus {
	key = VOID
	modifier = none
}

# VDR schedule menu
VDRSchedule {
	key = VOID
	modifier = none
}

# VDR Channel menu
VDRChannels {
	key = VOID
	modifier = none
}

# VDR Timers menu
VDRTimers {
	key = VOID
	modifier = none
}

# VDR Recordings menu
VDRRecordings {
	key = VOID
	modifier = none
}

# VDR Setup menu
VDRSetup {
	key = VOID
	modifier = none
}

# VDR Command menu
VDRCommands {
	key = VOID
	modifier = none
}

# VDR Command Back
VDRBack {
	key = VOID
	modifier = none
}

# VDR User command 1
VDRUser1 {
	key = VOID
	modifier = none
}

# VDR User command 2
VDRUser2 {
	key = VOID
	modifier = none
}

# VDR User command 3
VDRUser3 {
	key = VOID
	modifier = none
}

# VDR User command 4
VDRUser4 {
	key = VOID
	modifier = none
}

# VDR User command 5
VDRUser5 {
	key = VOID
	modifier = none
}

# VDR User command 6
VDRUser6 {
	key = VOID
	modifier = none
}

# VDR User command 7
VDRUser7 {
	key = VOID
	modifier = none
}

# VDR User command 8
VDRUser8 {
	key = VOID
	modifier = none
}

# VDR User command 9
VDRUser9 {
	key = VOID
	modifier = none
}

# VDR Volume plus
VDRVolumePlus {
	key = VOID
	modifier = none
}

# VDR Volume minus
VDRVolumeMinus {
	key = VOID
	modifier = none
}

# VDR Audio Mute
VDRMute {
	key = VOID
	modifier = none
}

##
# End of xine key bindings.
##

--------------010006090202080401070300
Content-Type: text/plain;
 name="lircrc.mce2"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="lircrc.mce2"

# my attempt at a config for the Windows Media Center USB remote

begin
    prog = irxevent
    button = Back
    config = Key Escape CurrentWindow
end

begin
    prog = irxevent
    button = One
    config = Key 1 CurrentWindow
end

begin
    prog = irxevent
    button = Two
    config = Key 2 CurrentWindow
end

begin
    prog = irxevent
    button = Three
    config = Key 3 CurrentWindow
end

begin
    prog = irxevent
    button = Four
    config = Key 4 CurrentWindow
end

begin
    prog = irxevent
    button = Five
    config = Key 5 CurrentWindow
end

begin
    prog = irxevent
    button = Six
    config = Key 6 CurrentWindow
end

begin
    prog = irxevent
    button = Seven
    config = Key 7 CurrentWindow
end

begin
    prog = irxevent
    button = Eight
    config = Key 8 CurrentWindow
end

begin
    prog = irxevent
    button = Nine
    config = Key 9 CurrentWindow
end

begin
    prog = irxevent
    button = Zero
    config = Key 0 CurrentWindow
end

begin
   prog = irxevent
   button = More
   config = Key I CurrentWindow
end

begin
    prog = irxevent
    button = Mute
    config = Key Shift-bar CurrentWindow
end

begin
    prog = irxevent
    button = VolUp
    config = Key bracketright CurrentWindow
end

begin
    prog = irxevent
    button = VolDown
    config = Key bracketleft CurrentWindow    
end

begin
    prog = irxevent
    button = ChanUp
    config = Key Up CurrentWindow
end

begin
    prog = irxevent
    button = ChanDown
    config = Key Down CurrentWindow
end

begin
    prog = irxevent
    button = Up
    config = Key Up CurrentWindow
end

begin
    prog = irxevent
    button = Down
    config = Key Down CurrentWindow
end

begin
    prog = irxevent
    button = Left
    config = Key Left CurrentWindow
end

begin
    prog = irxevent
    button = Right
    config = Key Right CurrentWindow
end

begin
    prog = irxevent
    button = OK
    config = Key space CurrentWindow
end

begin
   prog = irxevent
   button = Skip
    config = Key Page_Down CurrentWindow
 end

begin
  prog = irxevent
  button = Record
   config = Key R CurrentWindow
end

begin
    prog = irxevent
    button = Pause
    config = Key P CurrentWindow
end

begin
   prog = irxevent
   button = Replay
   config = Key Page_Up CurrentWindow
end

begin
    prog = irxevent
    button = Rewind
    config = Key Left CurrentWindow
end

begin
    prog = irxevent
    button = Play
    config = Key P CurrentWindow
end

begin
    prog = irxevent
    button = Forward
    config = Key Right CurrentWindow
end

# Keys for the top row of the MCE remote

begin
    prog = irxevent
    button = TV
    config = Key ctrl-alt-T CurrentWindow
end

begin
    prog = irxevent
    button = Music
    config = Key ctrl-alt-M CurrentWindow
end

begin
    prog = irxevent
    button = Pictures
    config = Key ctrl-alt-P CurrentWindow
end

begin
    prog = irxevent
    button = Videos
    config = Key ctrl-alt-V CurrentWindow
end

# Keys for the other navigation items

begin
    prog = irxevent
    button = RecTV
    config = Key ctrl-alt-R CurrentWindow
end

begin
    prog = irxevent
    button = Guide
    config = Key ctrl-alt-G CurrentWindow
end

begin
    prog = irxevent
    button = LiveTV
    config = Key ctrl-alt-T CurrentWindow
end

begin
    prog = irxevent
    button = DVD
    config = Key M CurrentWindow
end

# Map Enter to return so we can exit menus
begin
   prog = irxevent
   button = Enter
    config = Key Return CurrentWindow
end

# This is the "Windows Logo" button
# Map it to the main menu
begin
   prog = irxevent
   button = Home
    config = Key ctrl-alt-Return CurrentWindow
end

# Map the two remaining keys
# Map Star to commercial skip
begin
   prog = irxevent
   button = Star
    config = Key Z CurrentWindow
end

# Map Hash to Y to change Tuners

begin
   prog = irxevent
   button = Hash
    config = Key Y CurrentWindow
end


## XINE Keymap
## Note that it requires the correct xine keymap to
## be present in ~/.xine/keymap to prevent duplication
## of keys


 begin 
 prog = xine
 button = Play
 repeat = 3
 config = Play
 end

 begin
 prog = xine
 button = Stop
 repeat = 3
 config = Stop
 end

 begin
 prog = xine
 button = Back/Exit
 config = Quit
 end

 begin
 prog = xine
 button = Home
 config = Quit
 end
 begin

 prog = xine
 button = Pause
 repeat = 3
 config = Pause
 end

 begin
 prog = xine
 button = Up
 repeat = 4
 config = EventUp
 end

 begin
 prog = xine
 button = Down
 repeat = 4
 config = EventDown
 end

 begin
 prog = xine
 button = Left
 repeat = 4
 config = EventLeft
 end

 begin
 prog = xine
 button = Right
 repeat = 4
 config = EventRight
 end

 begin
 prog = xine
 button = OK
 repeat = 0
 config = EventSelect
 end

 # Menu is already taken care of my key M
 #begin
 #prog = xine
 #button = DVD
 #repeat = 0
 #config = Menu
 #end

 #vol down
 begin
 prog = xine
 button = VolDown
 repeat = 1
 config = Volume-
 end

 #vol up
 begin
 prog = xine
 button = VolUp
 repeat = 1
 config = Volume+
 end

 begin
 prog = xine
 button = Forward
 repeat = 3
 config = SeekRelative+30
 end

 begin
 prog = xine
 button = Rewind
 repeat = 3
 config = SeekRelative-30
 end

 #skip chapter forward
 begin
 prog = xine
 button = Skip
 repeat = 3
 config = NextMRL
 #config = EventNext
 end

 #skip chapter backward
 begin
 prog = xine
 button = Replay
 repeat = 3
 config = PriorMRL
 #config = EventPrior
 end

 # Mute
 begin
 prog = xine
 button = Mute
 repeat = 3
 config = Mute
 end


--------------010006090202080401070300
Content-Type: text/plain;
 name="input.conf"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="input.conf"

PGUP seek -60
PGDWN seek +60
p pause
l pause
i osd

--------------010006090202080401070300--