Robert.Moser@med.va.gov
2003-12-08, 11:49
Why not have the screen object (with a different class for each kind of
screen) generate the raw VFD itself? When the time comes to update the
screen you would just use the toDisplay method to get the data in the form
the display wants. So, in the vfd method of the players you would replace
$data with $client->screen->toDisplay (and not need to call vfd with any
parameters).
For the showBriefly example you would clone the screen object from the
client, and add the text to showBriefly as a layer. showBriefly itself
would just use a $screen object as a parameter. Note that this example only
overwrites the lower line.
Something like this:
my $screen = $client->screen->clone();
$screen->addText("Show this on the bottom",{'v-align' => 'bottom', 'fill' =>
'right'});
Slim::Display::Animation::showBriefly($client,$scr een);
Then showBriefly would just be
sub showBriefly {
my ($client,$screen,$etc) = @_
$client->screen->addLayer($screen,'animation-showBriefly');
#set a timer which calls showBriefly_done
}
At the end of the display period of showBriefly you would run this:
sub showBriefly_done {
my $client = shift;
$client->screen->removeLayer('animation-showBriefly');
}
> -----Original Message-----
> From: developers-bounces (AT) lists (DOT) slimdevices.com
> [mailto:developers-bounces (AT) lists (DOT) slimdevices.com]On Behalf Of dean
> blackketter
> Sent: Monday, December 08, 2003 10:13 AM
> To: SlimDevices Developers
> Subject: Re: [Developers] Overlay idea
>
>
> It might make more sense for the screen object to be used to
> composite
> screens, then have that object generate the XML (or whatever)
> stringified output, which would get translated into the raw VFD
> commands.
>
> The screen object would just be a helper app that helped
> build the text
> representation:
>
> my $screen = Slim::Display::Screen::new();
> $screen->addText("This is line one\nThis is line two\n");
> $screen->screen->addText("vfD_rightarrow_Vfd"
> ,{'v-align' => 'bottom'
> ,'h-align' => 'right'};
>
> Slim::Display::Animation::showBriefly($client, $screen->xml);
>
>
>
> On Dec 8, 2003, at 9:32 AM, Robert.Moser (AT) med (DOT) va.gov wrote:
>
> > Dean wrote:
> >> My concern about this would be about performance.
> >
> > We would probably get better performance out of an object than we
> > would out
> > of parsing XML each time we did a screen refresh.
> >
> > The more I think about it, returning a screen object
> probably isn't the
> > right thing to do. The client object should probably
> contain a screen
> > object. Then a module wanting to write its text to the
> screen would do
> > something like this:
> >
> > $client->screen->clear();
> > $client->screen->addText("This is line one\nThis is line two\n");
> > $client->screen->addText("vfD_rightarrow_Vfd"
> > ,{'v-align' => 'bottom'
> > ,'h-align' => 'right'};
> >
> > Which would result in a screen like:
> > +--------------------------------+
> > |This is line one |
> > |This is line two >|
> > +--------------------------------+
> >
screen) generate the raw VFD itself? When the time comes to update the
screen you would just use the toDisplay method to get the data in the form
the display wants. So, in the vfd method of the players you would replace
$data with $client->screen->toDisplay (and not need to call vfd with any
parameters).
For the showBriefly example you would clone the screen object from the
client, and add the text to showBriefly as a layer. showBriefly itself
would just use a $screen object as a parameter. Note that this example only
overwrites the lower line.
Something like this:
my $screen = $client->screen->clone();
$screen->addText("Show this on the bottom",{'v-align' => 'bottom', 'fill' =>
'right'});
Slim::Display::Animation::showBriefly($client,$scr een);
Then showBriefly would just be
sub showBriefly {
my ($client,$screen,$etc) = @_
$client->screen->addLayer($screen,'animation-showBriefly');
#set a timer which calls showBriefly_done
}
At the end of the display period of showBriefly you would run this:
sub showBriefly_done {
my $client = shift;
$client->screen->removeLayer('animation-showBriefly');
}
> -----Original Message-----
> From: developers-bounces (AT) lists (DOT) slimdevices.com
> [mailto:developers-bounces (AT) lists (DOT) slimdevices.com]On Behalf Of dean
> blackketter
> Sent: Monday, December 08, 2003 10:13 AM
> To: SlimDevices Developers
> Subject: Re: [Developers] Overlay idea
>
>
> It might make more sense for the screen object to be used to
> composite
> screens, then have that object generate the XML (or whatever)
> stringified output, which would get translated into the raw VFD
> commands.
>
> The screen object would just be a helper app that helped
> build the text
> representation:
>
> my $screen = Slim::Display::Screen::new();
> $screen->addText("This is line one\nThis is line two\n");
> $screen->screen->addText("vfD_rightarrow_Vfd"
> ,{'v-align' => 'bottom'
> ,'h-align' => 'right'};
>
> Slim::Display::Animation::showBriefly($client, $screen->xml);
>
>
>
> On Dec 8, 2003, at 9:32 AM, Robert.Moser (AT) med (DOT) va.gov wrote:
>
> > Dean wrote:
> >> My concern about this would be about performance.
> >
> > We would probably get better performance out of an object than we
> > would out
> > of parsing XML each time we did a screen refresh.
> >
> > The more I think about it, returning a screen object
> probably isn't the
> > right thing to do. The client object should probably
> contain a screen
> > object. Then a module wanting to write its text to the
> screen would do
> > something like this:
> >
> > $client->screen->clear();
> > $client->screen->addText("This is line one\nThis is line two\n");
> > $client->screen->addText("vfD_rightarrow_Vfd"
> > ,{'v-align' => 'bottom'
> > ,'h-align' => 'right'};
> >
> > Which would result in a screen like:
> > +--------------------------------+
> > |This is line one |
> > |This is line two >|
> > +--------------------------------+
> >