PDA

View Full Version : INPUT.List vs. %functions, Lines() & co.



mherger
2005-09-01, 03:42
When I had a look at the RandomPlay plugin I had the impression that there
was a lot of code that's actually not needed. Most is related to the use
of INPUT.Liste mode. When using the INPUT modes, do we still need the
lines() and all the %functions?

I'm attaching a patch which removes quite a bit of that code. And it still
works on my system :-)

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Grotus
2005-09-01, 07:18
Michael Herger wrote:
> When I had a look at the RandomPlay plugin I had the impression that
> there was a lot of code that's actually not needed. Most is related to
> the use of INPUT.Liste mode. When using the INPUT modes, do we still
> need the lines() and all the %functions?
>
> I'm attaching a patch which removes quite a bit of that code. And it
> still works on my system :-)

Having the 'track', 'album', and 'artist' functions in the function hash
would still be useful. That way you can map a key to
modefunction_PLUGIN.RandomPlay->track.

mherger
2005-09-01, 07:42
> Having the 'track', 'album', and 'artist' functions in the function
> hash
> would still be useful. That way you can map a key to
> modefunction_PLUGIN.RandomPlay->track.

Now that's interesting news to me! Thanks for the hint. I'll love to
have it play with a single push of a button.

But they are not really necessary, are they? up, down, left, right, all
is handled by the INPUT modes, as is the lines()?

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
SlimString Translation Helper (http://www.herger.net/slim/)

kdf
2005-09-01, 09:29
Quoting Robert Moser <rlmoser (AT) comcast (DOT) net>:

> Michael Herger wrote:
> > When I had a look at the RandomPlay plugin I had the impression that
> > there was a lot of code that's actually not needed. Most is related to
> > the use of INPUT.Liste mode. When using the INPUT modes, do we still
> > need the lines() and all the %functions?
> >
> > I'm attaching a patch which removes quite a bit of that code. And it
> > still works on my system :-)
>
> Having the 'track', 'album', and 'artist' functions in the function hash
> would still be useful. That way you can map a key to
> modefunction_PLUGIN.RandomPlay->track.

That was originally why I put them there in the third party version. It was in
rsponse to a request.

-kdf

kdf
2005-09-01, 09:46
Quoting Michael Herger <slim (AT) herger (DOT) net>:

> > Having the 'track', 'album', and 'artist' functions in the function
> > hash
> > would still be useful. That way you can map a key to
> > modefunction_PLUGIN.RandomPlay->track.
>
> Now that's interesting news to me! Thanks for the hint. I'll love to
> have it play with a single push of a button.
>
> But they are not really necessary, are they? up, down, left, right, all
> is handled by the INPUT modes, as is the lines()?

play is a passback, so that's still needed. Although, the entry to INPUT.List
is an onPlay in the params (which is a holdover from my attempts to use
INPUT.Choice). Switching to INPUT.Choice, which allows setting event handlers,
would mean that the play function might be able to go. However, I seem to
recall going back to INPUT.List because someone also wanted to trigger the play
function externally. Staying with INPUT.List means that the onPlay param can
go.

left and right probably arent needed unless they are used by the exithandler.
setMode takes care of the 'left' by doing the popmode call when the enter
method is 'pop'.

-kdf