[PATCH] LIRC support for Amarok

Patryk Cisek patryk at prezu.one.pl
Tue Jun 19 20:32:58 UTC 2007


Hi all, 

I'm using LIRC for video apps like mplayer. In past I also used in in XMMS. 
But since I switched to Amarok, I had to use irexec with dcop. So I decided 
to add this functionality to Amarok. :) Here's a patch for Amarok 2 (trunk):
http://www.kadu.net/~patryk/amarok/amarok_lirc_01.patch 

Right now it's hardcoded into Amarok (of course it gets compiled only if 
liblirc-devel is installed). But I'd like to make it a plugin, like engines 
for example. I digged around how plugins are implemented in Amarok, but it's 
not so clear to me. Can someone please shed some light on ot? I was looking 
for some doc for it, but didn't find anything. It looks somewhat similar to 
KPart mechanism, right? (I don't know KParts concept well enought to figure 
out how this works).
At the moment there are following config options (for .lircrc file):
BACKWARD_ms, FORWARD_ms (ms is number of miliseconds. These 2 configs seek 
backward/forward ms miliseconds, so for example BACKWARD_1000 moves back 1 
second)
MUTE
NEXT
PAUSE
PLAY
PLAYPAUSE (if playback is already paused, it "unpauses", otherwise it 
pauses)
PREV (previous position in the playlist)
NEXT (next position in the playlist)
QUIT
VOL+
VOL-
STOP 

And here's my ~/.lircrc:
begin
  prog = amarok
  remote = Bp-6
  button = left
  config = BACKWARD_5000
  repeat = 2
end 

begin
  prog = amarok
  remote = Bp-6
  button = right
  config = FORWARD_5000
  repeat = 2
end 

begin
  prog = amarok
  remote = Bp-6
  button = mute
  config = MUTE
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = down
  config = NEXT
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = PP
  config = PAUSE
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = ok
  config = PLAY
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = M
  config = PLAYPAUSE
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = up
  config = PREV
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = standby
  config = QUIT
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = I/II
  config = STOP
  repeat = 0
end 

begin
  prog = amarok
  remote = Bp-6
  button = F+
  config = VOL+
  repeat = 1
end 

begin
  prog = amarok
  remote = Bp-6
  button = F-
  config = VOL-
  repeat = 1
end 

 --
Pozdrawiam,
Patryk Cisek



More information about the Amarok mailing list