PDA

View Full Version : Custom Info Labels/Images


Asteron
2005-10-25, 01:16
this idea is along the same vein as dashboard for os x.

i noticed that there are a lot of xbmc provided tags for use in skins to display information such as weather, currently playing song, etc.

this is all information that xbmc has but what about all the other information on the web easily accessible by python?

some random ideas:
stock / market information
snow base at local ski mountain
countdown until an important date
traffic cams
doppler weather views
ebay watcher
current terror threat level from the department of homeland security (http://www.dhs.gov/dhspublic/index.jsp)
the rapture index (http://www.raptureready.com/rap2.html)

all of these can be expressed with either a simple string or image and are too unimportant to warrant their own window. a solution i thought of would be to create a set of "custom tags" that can be used by skins and each tag can be associated via a setting with a (registered?) .py file.

these info .py files will reside in a special location and have a particular interface (they extend a builtin python object) to define things like:

- update time
- info type (string or image)
- title / description
- provide a 'settings' dialog (via xbmcgui module)

upon startup xbmc will scan the folder for the .py files and register those that provide these details to populate the menus.

i want to throw this out there to gauge interest and start a discussion. i wouldn't suggest this if i didnt think it would be very doable from both the xbmc side and the python side. what do you all think?

jmarshall
2005-10-25, 03:32
this sounds like a reasonable idea, with some quite cool capability.

the skin interface i think is established well enough, the main area of thought needs to be put into the interface between xbmc and the underlying scripts.

from the xbmc side, what we'd want is a simple wrapper that can call a script and grab the needed information label or image (in the background obviously). i suspect that a single script would be used for multiple items, and so we'd need a way for xbmc to know which script to query.

perhaps it could go something like this:

1. skin page is loaded by user clicking on a link. the infomanager realizes it needs information from an external script, and hands over control to the script manager.

2. the script manager decides which script handles this piece of information, and starts the script running if necessary.

3. the script goes away and does it's thing, populating members local to xbmc when it's ready, and terminating.

4. whenever xbmc renders, the script manager checks to see whether the script has returned data. if it needs an update, it returns to step 2.

the key step to nut out is how the script returns data to xbmc.

a nice little project for someone to work on i think. any takers?

cheers,
jonathan

Asteron
2005-10-25, 10:22
yeah a hook into the infomanager seems like the way to go. i have had plenty of experience with the python stuff and c++ but dont have visual studio :-(. i can still help out on the python side of things though. actually python might be able to do alot if it could just add/remove controls with existing windows.

edit: had to check to be sure.

import xbmcgui, time

# home screen
w = xbmcgui.window(10000)
label = xbmcgui.controllabel(220,140,200,40, 'hello', 'font13', '0xff00ffff')
w.addcontrol(label)
w.show()
time.sleep(5)
# scripts screen
xbmcgui.window(10020).show()

no go but in any case a real hook would tie in with the skin and be more elegant.

Tomkun
2005-10-26, 15:02
hahaha, like the idea of the security threat meter, but it sounds like a bit of overkill... :) has it ever been below orange???

 just noticed it's actually now on yellow. placing foot in mouth.