Kodi Community Forum

Full Version: Footer of text on live TV
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Although being a developer, XBMC is really new to me, I'm still learning all about it.

After reading a lot about XBMC addons and such, I couldn't find anything lying around the web about what I'm trying to do, and I'm a little bit short on time to implementing it, so I'm asking for help on what direction I should take to do what I need to.

I need to show a text message for the viewer for a set amount of time (something like those text messages on news broadcasts on the footer), the message will be sent through the nextwork from another computer (will do it using rpc).

This message will be shown regardless of what's happening, if the user is vieweing any movie, live tv, anything.

Does anyone know an addon that would make something similar to this ? if not then, I'll have to do it myself so, I'm guessing the best approach would be making a Service that keep's listening for messages and then shows a window on the bottom of the screen with the text message. My problem right now though is this:

- how to display a window in the footer, I mean, a custom window, with the text height size, and screen width, say white background and black text etc, most of code examples I saw don't show how to change window properties.
- time the window display, is there anything in the API that would do this ? or do I have to implement this in the addon ?
- how do I go on about reloading addons, imagine I'm working in the addon, and I make changes, will it only refresh the changes if I restart xbmc ?

Best regards,
Hi,

There is already a limit possibility for that: Notifcations. But there is also space for one sentence. You can trigger notifications via the HTTP-API (in eden) or the JSON-RPC-API (in frodo). Just search the forum for that.

If you want to do it via an add-on it would be much more complicated:

Correct, first you would have to write a service-add-on which runs persistent in the background and check the backend for new messages or open a tcp port and wait for messages in your own protocol. When a new message is found/triggered you need to open a WindowXMLDialog. This Dialog-window needs to be skinned via an XML-file which defines the properties (size, position, color, background). In this dialog you need a ControlLabel or ControlTextBox see here.

I have written a small example script which opens a Window (not a dialog - which is what you need. Windows are full-screen and dialogs are not) - but the way of creating them is the same: Have a look here. For the skinning of the dialog just have a look to the dialog*.xml files of some xbmc skins.

Hi,

Thanks for the heads up, I already tried the notification through Json, the problem is it's small, meaning, the window despite the text size is small and generally only on the lower right corner of the scree (I have yet to try other skins and check their notification look and feel besides the stock one).

I'd like to have the 'dialog' to have the width of the whole screen and the height of a single line of text, regardless of the amount of text, be it a few characters or a huge line (I believe ControlLabel does automatic scrolling if text > dialog width).

If I can't find a skin with a notification that suits me, how about on skinning that notification dialog ? any pointers on how best to do that ?

best regards,
Like I said - if the builtin notification doesn't fit your needs you need to go the complicated way: Create your own Dialog (using WindowXMLDialog)
See my Xbox live friends notification app for a starting point: http://forum.xbmc.org/showthread.php?tid...xblfriends it's pretty minimal.

Instead of a notification, you want to create an xbmcgui.window object, then a ControlLabel object. Set the ControlLabel's height and width appropriately, set the text label, add the control to the window, then show the window.
http://mirrors.xbmc.org/docs/python-docs/xbmcgui.html
Thanks for the awesome help guys, I'm doing the addon as the builtin notification is too small and easily missed, it's supposed to alert people and needs to be pretty visible.

Thanks for the magnificent examples give, those are helping a lot, I'll share the addon once it's done, maybe there's interest in it for the future.
I'm struggling to find an example of how to play a sound when the dialog is opened, anyone has any hints on where can I find that ?
AFAIK, you can't really. You can play one, but it'll be just like playing something from your library, so if you're watching something, it'll stop whatever you're watching and play the sound instead
(2012-11-09, 19:22)Bstrdsmkr Wrote: [ -> ]AFAIK, you can't really. You can play one, but it'll be just like playing something from your library, so if you're watching something, it'll stop whatever you're watching and play the sound instead

Wrong, you can use xbmc.playSFX(filename) which doesn't use the same player like video/music.

Just have a look to the xbmc python module docs: http://mirrors.xbmc.org/docs/python-docs/

regards,
sphere
Lol can't believe I never noticed this.
That's awesome Sphere, thank you very much.