XBMC for LCDSmartie

Usage: $dll(XBMC4LCDSmartie.dll,Function,Param1 ,Param2 )

1. Copy XBMC4LCDSmartie.dll and Newtonsoft.Json.dll to your plugin directory.
2. Edit lcdsmartie.exe.config (located in the main LCDSmartie folder) and edit the parameters as needed. I'll explain it more later in this documentation.
3. Enable 'Allow programs on this system to control XBMC' in XBMC's System Settings

Description:
The Plugin enables LCDSmartie to read different information directly from a local XBMC installation. The following functions are currently implemented:

Function 1
Usage: $dll(XBMC4LCDSmartie.dll,1,,)
Returns if XBMC is currently running or not. Returns 1 if XBMC.exe is running, 0 if not.
Function 2
Usage: $dll(XBMC4LCDSmartie.dll,2,param1,param2)
Returns ready formatted lines back to LCDSmartie. It can also be used in actions to switch screens depending what is currently being played.
1 Get Player Type
2

What is currently being played. The displayed information is automaticly formatted depending on type of item being played.

Audio Album: <TrackNo>.<TrackTitle>
Audio Compilation: <TrackNo>.<Tracktitle> (<TrackArtist>)
TV Series: <Season>x<Episode> <Title> (<Series>)
Movie: <Title> (<Year>)
Everything Else: Label or Title

3

Time Display. The Time is formatted depending on the value of param2

If param2 = 1 the time is formatted as short as possible.
Ex.: 02:34/03:41 or 0:55:44/1:23:44

If param2 = 2 the time is formatted with leading zeros.
Ex.: 00:02:34/00:03:41 or 00:55:44/01:23:44

I implemented this function because my display is only 16 chars wide. If your display is larger than mine, just set param2 to 2 and you will always have leading zeros.

If param2 = 3 the time is formatted as you wish:
You have to put the time you wish to have displayed in between '#' together with a standard .NET Time Formatting String. You can choose following time labels:
TA - Time
TR - Time Remaining
TT - Total Time

Ex.: 3#TAHH:mm:ss#/#TRHH:mm:ss#/#TTHH:mm:ss will display 00:04:22/01:21:22/01:25:44. You can find details on supported formatting strings here.



Function 3
Usage: $dll(XBMC4LCDSmartie.dll,3,<InfoLabel>,)
Returns the specified infolabel.
You can choose any infolabel as described in the XBMC Wiki. Some chars that cannot be displayed are automatically replaced.

Function 4
Usage: $dll(XBMC4LCDSmartie.dll,4,,)
Returns current XBMC playback speed.
Returns -999 if XBMC is not running
Returns -888 if XBMC is running, but nothing is being played at the moment
Returns -777 if XBMC is paused
Returns playback speed otherwise
Function 5
Usage: $dll(XBMC4LCDSmartie.dll,5,<InfoBoolean>,)
Returns the specified infoboolean.
You can choose any infoboolean as described in the XBMC Wiki.


All settings are specified in the "lcdsmartie.exe.config" file located in LCDSmarties main directory. These have to be added right below the <configuration>-tag (normally you'll have to enter the values directly after the first line. If you already have a <appSettings>-section in your file, just add the values in the section.

 

<configuration>

 <appSettings>
  <add key="XBMC4LCDSmartie.Host" value="127.0.0.1 "/>
  <add key="XBMC4LCDSmartie.Port" value="9090"/>
  <add key="XBMC4LCDSmartie.RefreshInt" value="300"/>
  <add key="XBMC4LCDSmartie.XBMCTestMode" value="TCP"/>
 </appSettings>

<startup useLegacyV2RuntimeActivationPolicy="true">
...
...
...

 

Host IP-Address of the machine running XBMC
It's 127.0.0.1 if it's running on the same machine as LCDSmartie
Don't use a Hostname, as this will extremely slow down lcdsmartie
Port Port XBMC is using.
Normally 9090
XBMCTestMode

Specifies hot a running XBMC-Process is detected
Proc => Looks if a process "XBMC.exe" is found
TCP => Tries to connect to XBMC via TCP. Usefull if you have LCDSmartie running on another Machine than XBMC.

RefreshInt Specifies how often LCDSmartie will request new data from the plugin (in ms). If LCDSmartie uses to much CPU you will have to set this parameter to a bigger value.

Hints:
- I've also included a sample lcdsmartie.exe.config in the download


 

Examples:

Line1: $dll(XBMC4LCDSmartie.dll,3,System.CurrentWindow,1)
Line2: $dll(XBMC4LCDSmartie.dll,3,System.CurrentControl,1)

Will return the label of the currently displayed window in the first line and the label of the currently selected item on the second line

Line1: $dll(Scroller.dll,1,$dll(XBMC4LCDSmartie.dll,2,2,1),16#2# *** )
Line2: $Right($dll(XBMC4LCDSmartie.dll,2,3,1),$16%)

Will display what is currently being played in line 1 and the current time on line 2. This example also uses my Scroller-Plugin so that the title is scrolled only once and not all the time. Please note that you will have to adjust Line1 to your needs, as it will only scroll with 16 chars if you use it like I posted it. Just change the red value to your lcd width.

If you want LCDSmartie to switch screens when XBMC is running and when something is being played you will have to use Actions as shown in the screenshot:

DONATE

I wrote this plugin (and more plugins to come) in my free time. If you like my plugins, it would be nice if you would buy me a beer.

Last edited Feb 16, 2013 at 4:15 PM by IzeQube, version 14

Comments

No comments yet.