Plugin List > SuperDateTime > External API


SuperDateTime External API:

SuperDateTime provides an external API to allow custom plugins to easily add additional display content to SuperDateTime or access its display content.

Plugins::SuperDateTime::Plugin::registerProvider: Should be called when custom plugin is initially loaded.
Parameter 1 - Reference to custom plugin sub that will be called by SDT with each data refresh.  This custom plugin sub should then call the following subs to add or preserve additional display content.

Plugins::SuperDateTime::Plugin::addDisplayItem:
Adds a display item that will be shown when SuperDateTime cycles display items (scores, stocks, etc.).
Parameter 1 - What module is adding the display item.  Unique name for plugin.
Parameter 2 - Top display line text.
Parameter 3 - Bottom display line text.
Parameter 4 - How long the display item is shown with each pass... ie 5 seconds.  Set to 'L' for long text items to force scrolling.
Parameter 5 - [OPTIONAL] Expiration time value.  This is used in the processExpired sub (see below).
Parameter 6 - [OPTIONAL] Time the value was added. This is used in the saveCycles sub (see below).

All items added are wiped out with each new data refresh.  saveCycles and processExpired can be called with each data refresh to retain previously added values.

Plugins::SuperDateTime::Plugin::refreshData: Must be called when custom data refresh is complete
Parameter 1 - undef
Parameter 2 - Client ID received when registered sub is called by SDT
Parameter 3 - Unique refresh ID received when registered sub is called by SDT

Plugins::SuperDateTime::Plugin::saveCycles: Retains previous display items added via addDisplayItem.  Will save all previously added display items or can optionally save based on the time added.
Parameter 1 - Module name specified when item was added with addDisplayItem.
Parameter 2 - [OPTIONAL] Time value for comparison.
Parameter 3 - [OPTIONAL] Either 'b' or 'a'. Representing before or after. If specified only cycles that have a time added before/or after the time comparison value will be saved.

Plugins::SuperDateTime::Plugin::processExpired: Compares the expiration time specified when a display item was added with addDisplayItem with the current time.  Any items that have not yet expired are saved.
Parameter 1 - Module name specified when item was added with addDisplayItem.

Plugins::SuperDateTime::Plugin::addMacro: Adds a custom % macro.  Should be called whenever macro value needs to be updated.  Users can then specify the custom macro in the player display settings to view the macro value.
Parameter 1 - Custom macro identifier (Example: %X1234)
Parameter 2 - Custom macro value
 

SuperDateTime CLI/JSON Interface:
The CLI/JSON interface allows a 3rd party applet or plugin to access SDT data elements.

cliQuery request for 'SuperDateTime'
Parameter 1 - Request data mode.
    Valid Values:
        'all' - Returns all sports, weather, misc, and display data together
        'sports' - Returns sports data
        'weather' - Returns weather data
        'misc' - Returns miscellaneous data (currently stock info)
        'display' - Returns raw display content


cliQuery notification for 'SuperDateTimeState' - 'dataRefreshState'
Returns single key hash (likely will be expanded to included additional keys in the future).
'state' =
    'Refreshing' - Data refresh in process
    'Success' - Data refresh completed with success
    'Errors' - Data refresh completed with 1 or more errors
 

Copyright ©2010 Greg Brown
All rights reserved.