LinEAK


Linux support for Easy Access and Internet Keyboards
Documentation: The Media-Detect Plugin


   For those wondering how to use the Media-Detect plugin to control your
   media players, follow the steps below:
   
   1) You need the lineak_defaultplugin package installed. Once installed you'll
      see in the README file of the lineak_defaultplugin package the following
      documentation on how the macro works:       
       
       EAK_MEDIADETECT(COMMAND)
              This macro allows you to use the media detect plugin to run
              one of the supported commands. This plugins requires that you
              have a configuration file in your ~/.lineak directory called
              media-detect.conf

              Valid commands are:
                 PLAY
                 STOP
                 PAUSE
                 PLAYPAUSE
                 NEXT
                 PREVIOUS
		 
              See the media-detect.conf file below. Note that if you use the
	      KDE plugins package, then you should replace the commands for JUK
	      if you use it, with the KDE Juk plugin macros instead of the dcop
	      commands.

#############################################################################
# Media Detect configuration file.
#
# The Media Detect lineak plugin is inspired by the Media-Detect scripts
#  created by Daemon Kaswell, and is copyright the lineak project and
#  Sheldon Lee-Wen October 22, 2004.
#
# Each entry in this configuration file must adhere to the format
# given below. The entries are case sensitive.
#
# [IDENTIFIER]
# NAME =           This is a plain text description of the program.
# PROGRAM =        This is the command line name of the program. It will be
#                       used to run the program or as the dcop identifier.
# The following commands are those used to issue to the program identified in
#    the PROGRAM configuration directive above. The entries for the commands will
#    vary depending on the type given under the TYPE directive.
#    For TYPE = macro, these are the macros hat you want to be run for each command.
#    For TYPE = dcop, these are the actual dcop command minus the dcop  part.
#    For TYPE = program, the command is whatever options would be given to the 
#               program PROGRAM on the command line to produce the desired effect.
#                      
# PLAY =           
# STOP =
# PAUSE =
# PLAYPAUSE =
# NEXT =
# PREVIOUS =
# TYPE =           This is the entry type. There are three valid types. macro, dcop or 
#                     program.
# PRIORITY =       This is the priority to be given to this entry if there is more
#                     than one of the configured programs running. If two entries
#                     with the same priority are found the first one found running
#                     will be selected.
# [END]
#
# The following entries are examples of each type.

[AMAROK]
NAME = Amarok Media Player
PROGRAM = amarok
PLAY = AMAROK_PLAY
STOP = AMAROK_STOP
PAUSE = AMAROK_PAUSE
PLAYPAUSE = AMAROK_PLAYPAUSE
NEXT = AMAROK_FORWARD
PREVIOUS = AMAROK_BACK
TYPE = macro
PRIORITY = 1
[END]

[JUK]
NAME = Juk Media Player
PROGRAM = juk
PLAY = Player play
STOP = Player stop
PAUSE = Player pause
PLAYPAUSE = Player playPause
NEXT = Player forward
PREVIOUS = Player back
TYPE = dcop
PRIORITY = 2
[END]

[XMMS]
NAME = X Multi Media System
PROGRAM = xmms
PLAY = --play
STOP = --stop
PAUSE = --pause
PLAYPAUSE = --play-pause
NEXT = --fwd
PREVIOUS = --rew
TYPE = program
PRIORITY = 3
[END]

   2) As a first start, copy this example media-detect.conf file to your ~/.lineak directory.
      Any media player that you wish to control must be added to this file and configured appropriately.
      
   3) Verify that the plugin is loading. Run lineakd -v and look in the start of the output for
      this:
      
      Defining Macro Lists for Plugin:mediadetect
      Adding macro: EAK_MEDIADETECT
      
      If you do not see this output, then your media-detect plugin is no being loaded. 
      (Maybe it isn't installed?)
      
      If you see this output, stop lineakd (if you ran it from the command line a control-c will
      do the trick, or you can run lineakd -x

   4) Configure your lineakd.conf file with the commands you want to use. Here are some examples:
      
      Next    = "EAK_MEDIADETECT(NEXT)"
      Play    = "EAK_MEDIADETECT(PLAY)"
      Pause   = "EAK_MEDIADETECT(PAUSE)"
      Prev    = "EAK_MEDIADETECT(PREVIOUS)"
      Stop    = "EAK_MEDIADETECT(STOP)"
      
   5) Run lineakd.