I'm starting a script based on Tools4Roku to display information on my Soundbridge. The main difference between the existing solutions will be its extensibility: You will have "modules" you can use (or let out) to display information, so you can customize the script very easy.
A typical configuration would be like this:
Code: Select all
my @modules = (
{
name => 'Hello World',
module => 'helloworld',
params => {},
},
{
name => 'tagesschau.de',
module => 'rss',
params => {rss => 'http://www.tagesschau.de/xml/rss2'},
},
{
name => 'heise.de',
module => 'rss',
params => {rss => 'http://www.heise.de/newsticker/heise-atom.xml'},
},
{
name => 'Yahoo! weather',
module => 'yahooweather',
params => {location => 'GMXX4980'},
},
{
name => 'check mails',
module => 'checkmail',
params => {server => 'pop.example.com', user => 'joedoe', pass => 'secret'},
},
);
The name entry is for the menu, the module name will be the Perl module used, and the (optional) params parameter will be module-specific.
Right now, I'm finishing the usual "hello world" module, which will be something like
Code: Select all
package helloworld;
use strict;
use warnings;
use RokuUI_Nic4;
my $display;
# ---------------------------------------------------------------------
# Constructor
sub new {
my ($class, $params) = @_;
my $self = {};
bless $self, $class;
};
# ---------------------------------------------------------------------
# Paint on the display
sub action {
my $self=shift;
$self->{'display'}->clear();
$self->{'display'}->msg(text => "Hello world", duration => 10, x => 0, y => 0);
$self->{'display'}->cmd("sketch -c exit");
}
1;
I think this sketch gives you the main idea. A module needs to have a property named display (to pass the main display object), and a method named action to do something (most likely, show something on the display, but other actions could be taken as well

Does this makes sense?
Jörg