|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.lirc.util.SimpleLIRCClient
Can be used to quickly add LIRC support to a java application. Takes care
of loading a config file and mapping button presses to application specific strings. The
format of this config file is decsribed in the LIRCMap
documentation.
See org.lirc.test.MoveDot for an example application.
Code example:
private SimpleLIRCClient client; ... String configFile = "myConfig.lirc"; client = new SimpleLIRCClient("myprog", configFile); client.addIRActionListener(new MyIRListener()); ... client.stopListening();
LIRCMap
Constructor Summary | |
SimpleLIRCClient(java.io.File file)
Creates a new SimpleLIRCClient that loads it's settings from a file. |
|
SimpleLIRCClient(java.lang.String filename)
Creates a new SimpleLIRCClient that loads it's settings from a file. |
|
SimpleLIRCClient(java.lang.String program,
java.io.File file)
Creates a new SimpleLIRCClient that loads it's settings from a file. |
|
SimpleLIRCClient(java.lang.String program,
java.lang.String filename)
Creates a new SimpleLIRCClient that loads it's settings from a file. |
Method Summary | |
void |
addIRActionListener(IRActionListener l)
Adds an IRActionListener |
protected void |
fireIRAction(java.lang.String command)
Notify all listeners that have registered interest for notification on this event type. |
void |
loadSettings(java.io.File file)
Loads a LIRCMap from a file. |
void |
loadSettings(java.lang.String filename)
Loads a LIRCMap from a file. |
void |
removeIRActionListener(IRActionListener l)
Removes an IRActionListener |
void |
saveSettings(java.io.File file)
Saves the LIRCMap to a file. |
void |
saveSettings(java.lang.String filename)
Saves the LIRCMap to a file. |
void |
stopListening()
Stops listening for IR events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleLIRCClient(java.lang.String filename) throws LIRCException, java.io.FileNotFoundException, java.io.IOException
filename
- The file to load settings fromLIRCException
- if there is a problem connection to the LIRC daemonjava.io.FileNotFoundException
- if the config file can't be foundjava.io.IOException
- if there is a problem reading the config filepublic SimpleLIRCClient(java.io.File file) throws LIRCException, java.io.FileNotFoundException, java.io.IOException
file
- The file to load settings fromLIRCException
- if there is a problem connection to the LIRC daemonjava.io.FileNotFoundException
- if the config file can't be foundjava.io.IOException
- if there is a problem reading the config filepublic SimpleLIRCClient(java.lang.String program, java.lang.String filename) throws LIRCException, java.io.FileNotFoundException, java.io.IOException
program
- The program name used in config files, can be nullfilename
- The file to load settings fromLIRCException
- if there is a problem connection to the LIRC daemonjava.io.FileNotFoundException
- if the config file can't be foundjava.io.IOException
- if there is a problem reading the config filepublic SimpleLIRCClient(java.lang.String program, java.io.File file) throws LIRCException, java.io.FileNotFoundException, java.io.IOException
program
- The program name used in config files, can be nullfile
- The file to load settings fromLIRCException
- if there is a problem connection to the LIRC daemonjava.io.FileNotFoundException
- if the config file can't be foundjava.io.IOException
- if there is a problem reading the config fileMethod Detail |
public void stopListening()
public void addIRActionListener(IRActionListener l)
public void removeIRActionListener(IRActionListener l)
protected void fireIRAction(java.lang.String command)
public void loadSettings(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
- if the config file can't be foundjava.io.IOException
- if there is a problem reading the config filepublic void loadSettings(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
- if the config file can't be foundjava.io.IOException
- if there is a problem reading the config filepublic void saveSettings(java.lang.String filename) throws java.io.IOException
java.io.IOException
- if there is a problem writing the config filepublic void saveSettings(java.io.File file) throws java.io.IOException
java.io.IOException
- if there is a problem writing the config file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |