kodi
Classes | Public Member Functions | List of all members
org.xbmc.eventclient.XBMCClient Class Reference

XBMC Event Client Class. More...

Classes

class  PingThread
 Implements a PingThread which tells XBMC EventServer that the Client is alive (this should be done at least every 60 seconds!
 

Public Member Functions

 XBMCClient (InetAddress hostAddress, int hostPort, String deviceName, String iconFile) throws IOException
 Starts a XBMC EventClient. More...
 
 XBMCClient (InetAddress hostAddress, int hostPort, String deviceName, byte iconType, byte[] iconData) throws IOException
 Starts a XBMC EventClient. More...
 
 XBMCClient (InetAddress hostAddress, int hostPort, String deviceName) throws IOException
 Starts a XBMC EventClient without an icon. More...
 
void stopClient () throws IOException
 Stops the XBMC EventClient (especially the Ping-Thread) More...
 
void sendNotification (String title, String message) throws IOException
 Displays a notification window in XBMC. More...
 
void sendButton (short code, boolean repeat, boolean down, boolean queue, short amount, byte axis) throws IOException
 Sends a Button event. More...
 
void sendButton (String map_name, String button_name, boolean repeat, boolean down, boolean queue, short amount, byte axis) throws IOException
 Sends a Button event. More...
 
void sendMouse (int x, int y) throws IOException
 Sets the mouse position in XBMC. More...
 
void ping () throws IOException
 Sends a ping to the XBMC EventServer. More...
 
void sendLog (byte loglevel, String logmessage) throws IOException
 Tells XBMC to log the message to xbmc.log with the loglevel as specified. More...
 
void sendAction (String actionmessage) throws IOException
 Tells XBMC to do the action specified, based on the type it knows were it needs to be sent. More...
 

Detailed Description

XBMC Event Client Class.

Implements an XBMC-Client. This class can be used to implement your own application which should act as a Input device for XBMC. Also starts a Ping-Thread, which tells the XBMC EventServer that the client is alive. Therefore if you close your application you SHOULD call stopClient()!

Author
Stefan Agner

Constructor & Destructor Documentation

◆ XBMCClient() [1/3]

org.xbmc.eventclient.XBMCClient.XBMCClient ( InetAddress  hostAddress,
int  hostPort,
String  deviceName,
String  iconFile 
) throws IOException
inline

Starts a XBMC EventClient.

Parameters
hostAddressAddress of the Host running XBMC
hostPortPort of the Host running XBMC (default 9777)
deviceNameName of the Device
iconFilePath to the Iconfile (PNG, JPEG or GIF)
Exceptions
IOException

◆ XBMCClient() [2/3]

org.xbmc.eventclient.XBMCClient.XBMCClient ( InetAddress  hostAddress,
int  hostPort,
String  deviceName,
byte  iconType,
byte []  iconData 
) throws IOException
inline

Starts a XBMC EventClient.

Parameters
hostAddressAddress of the Host running XBMC
hostPortPort of the Host running XBMC (default 9777)
deviceNameName of the Device
iconTypeType of the icon file (see Packet.ICON_PNG, Packet.ICON_JPEG or Packet.ICON_GIF)
iconDataThe icon itself as a Byte-Array
Exceptions
IOException

◆ XBMCClient() [3/3]

org.xbmc.eventclient.XBMCClient.XBMCClient ( InetAddress  hostAddress,
int  hostPort,
String  deviceName 
) throws IOException
inline

Starts a XBMC EventClient without an icon.

Parameters
hostAddressAddress of the Host running XBMC
hostPortPort of the Host running XBMC (default 9777)
deviceNameName of the Device
Exceptions
IOException

Member Function Documentation

◆ ping()

void org.xbmc.eventclient.XBMCClient.ping ( ) throws IOException
inline

Sends a ping to the XBMC EventServer.

Exceptions
IOException

◆ sendAction()

void org.xbmc.eventclient.XBMCClient.sendAction ( String  actionmessage) throws IOException
inline

Tells XBMC to do the action specified, based on the type it knows were it needs to be sent.

Parameters
actionmessageActionmessage (as in scripting/skinning)

◆ sendButton() [1/2]

void org.xbmc.eventclient.XBMCClient.sendButton ( short  code,
boolean  repeat,
boolean  down,
boolean  queue,
short  amount,
byte  axis 
) throws IOException
inline

Sends a Button event.

Parameters
coderaw button code (default: 0)
repeatthis key press should repeat until released (default: 1) Note that queued pressed cannot repeat.
downif this is 1, it implies a press event, 0 implies a release event. (default: 1)
queuea queued key press means that the button event is executed just once after which the next key press is processed. It can be used for macros. Currently there is no support for time delays between queued presses. (default: 0)
amountunimplemented for now; in the future it will be used for specifying magnitude of analog key press events
axis

◆ sendButton() [2/2]

void org.xbmc.eventclient.XBMCClient.sendButton ( String  map_name,
String  button_name,
boolean  repeat,
boolean  down,
boolean  queue,
short  amount,
byte  axis 
) throws IOException
inline

Sends a Button event.

Parameters
map_namea combination of map_name and button_name refers to a mapping in the user's Keymap.xml or Lircmap.xml. map_name can be one of the following:
  • "KB" => standard keyboard map ( <keyboard> section )
  • "XG" => xbox gamepad map ( <gamepad> section )
  • "R1" => xbox remote map ( <remote> section )
  • "R2" => xbox universal remote map ( <universalremote> section )
  • "LI:devicename" => LIRC remote map where 'devicename' is the actual device's name
button_namea button name defined in the map specified in map_name. For example, if map_name is "KB" referring to the <keyboard> section in Keymap.xml then, valid button_names include "printscreen", "minus", "x", etc.
repeatthis key press should repeat until released (default: 1) Note that queued pressed cannot repeat.
downif this is 1, it implies a press event, 0 implies a release event. (default: 1)
queuea queued key press means that the button event is executed just once after which the next key press is processed. It can be used for macros. Currently there is no support for time delays between queued presses. (default: 0)
amountunimplemented for now; in the future it will be used for specifying magnitude of analog key press events
axis

◆ sendLog()

void org.xbmc.eventclient.XBMCClient.sendLog ( byte  loglevel,
String  logmessage 
) throws IOException
inline

Tells XBMC to log the message to xbmc.log with the loglevel as specified.

Parameters
loglevelthe loglevel, follows XBMC standard.
  • 0 = DEBUG
  • 1 = INFO
  • 2 = NOTICE
  • 3 = WARNING
  • 4 = ERROR
  • 5 = SEVERE
logmessagethe message to log

◆ sendMouse()

void org.xbmc.eventclient.XBMCClient.sendMouse ( int  x,
int  y 
) throws IOException
inline

Sets the mouse position in XBMC.

Parameters
xhorizontal position ranging from 0 to 65535
yvertical position ranging from 0 to 65535

◆ sendNotification()

void org.xbmc.eventclient.XBMCClient.sendNotification ( String  title,
String  message 
) throws IOException
inline

Displays a notification window in XBMC.

Parameters
titleMessage title
messageThe actual message

◆ stopClient()

void org.xbmc.eventclient.XBMCClient.stopClient ( ) throws IOException
inline

Stops the XBMC EventClient (especially the Ping-Thread)

Exceptions
IOException

The documentation for this class was generated from the following file: