Bug 587 - Scroll long text submitted with the CLI "display" command
: Scroll long text submitted with the CLI "display" command
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: unspecified
: All All
: P3 normal (vote)
: ---
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-09-28 06:56 UTC by Rod Savard
Modified: 2009-09-08 09:20 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
save and restore oldlines while doing showBriefly (1.14 KB, patch)
2004-09-29 17:40 UTC, KDF
Details | Diff
updated for one bug (1.13 KB, patch)
2004-10-02 22:59 UTC, KDF
Details | Diff
kill showDone in killAnimation (1.42 KB, patch)
2004-10-14 18:06 UTC, KDF
Details | Diff
update showDone timer each time sshowBriefly is called. (2.05 KB, patch)
2004-10-15 21:44 UTC, KDF
Details | Diff
showbriefly as a mode (3.20 KB, patch)
2004-10-20 14:12 UTC, KDF
Details | Diff
much better now (3.30 KB, patch)
2004-10-20 16:38 UTC, KDF
Details | Diff
this is it. (2.74 KB, patch)
2004-10-20 23:15 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rod Savard 2004-09-28 06:56:42 UTC
When text that is too long to fit on the display is sent to the player using the
CLI "display" command, it would be beneficial for the text to scroll.
Comment 1 KDF 2004-09-28 10:35:20 UTC
It should be doing this already, as long as the line are actually displayed
longer than the ScrollPause setting.  CLI lines are simply sent to
$client->showBriefly same as any other short display, as if it were commanded by
the server itself. The default pause is 3.6 seconds, default message display is
only 1 second. Due to a fixed lag in animation setup time, even a scrollpause of
zero may not scroll a 1 second message.
Comment 2 Rod Savard 2004-09-28 17:45:02 UTC
I am running SlimServer 5.3.0 and it doesn't scroll for me... never has.  I am
using the default scrollpause (3.6) and scrollrate (1.5) settings and in this
case an specifying that the text be shown for 30 seconds.
Comment 3 KDF 2004-09-29 00:49:58 UTC
I'll have to leave this for Dean.  I sent a cli display command and it scrolls
just as it should for me.

my test:
00%3A04%3A20%3A05%3A32%3Ae2 display hello
adjdjdlkjslkdjfjghslskdfjshglsdfla;sdlfahgjasdfjfjdhgsdjfjsdgshdgsd 30

this is with latest cvs and non-G display.
1.5 is a very slow scrollrate, btw.  default is 0.15.
Comment 4 Rod Savard 2004-09-29 05:51:50 UTC
I tested with the non-G display using Softsqueeze and the scrolling *does* work.
 But when I switch to the G display in Softsqueeze the text no longer scrolls. 
My squeezebox has a G display behaves the same.. no scrolling.

Also I meant to type 0.15 for the scroll rate, not 1.5. :)
Comment 5 KDF 2004-09-29 14:33:01 UTC
aha. it seems ANY showBriefly will not scroll with a G display.
Comment 6 KDF 2004-09-29 17:40:51 UTC
Created attachment 150 [details]
save and restore oldlines while doing showBriefly

this patch allows the lines to be set as the current lines during showbriefly. 
This allows scrollBottom to do its job, then teh old function is returned after
the showBriefly duration.
Comment 7 KDF 2004-09-29 17:41:46 UTC
marking this as a bug, since it shoudl have been working already.
Comment 8 KDF 2004-10-02 22:59:44 UTC
Created attachment 164 [details]
updated for one bug

the previous patch had a problem when volume control was pressed and held. 
This new patch will only swap line functions when the duration is specified as
longer than 1 second.  No duration given or duration=1 will use the old simpler
routine.
Comment 9 Rod Savard 2004-10-02 23:10:39 UTC
The latest patch works great!
Comment 10 KDF 2004-10-09 21:33:01 UTC
*** Bug 617 has been marked as a duplicate of this bug. ***
Comment 11 KDF 2004-10-14 14:23:56 UTC
if there are no objections, I plan to commit this tonight based on user
confirmation that this works ok.
Comment 12 Blackketter Dean 2004-10-14 16:59:05 UTC
I'm a little worried about this patch.  I'd rather not modify the lines parameter.  Shouldn't we be able to 
do this by having showBriefly call scrollBottom?
Comment 13 Blackketter Dean 2004-10-14 17:07:03 UTC
Never mind my last comment, I see that scrollBottom and scrollUpdate just call the $client->lines() 
function.  Couple of comments on the patch.  This line:

+       if ($duration > 1) {

Should be tested against the start scroll delay, not a fixed value of 1, right?
Also, I think that at least one place, killAnimation, needs to kill the timer for showDone, right?
Comment 14 KDF 2004-10-14 17:54:09 UTC
the duration > 1 test is for the showBriefly timing, not for scrolling.  if the
duration is default (ie 1) then we dont need a timer, since that ends up making
the showbriefly more than 1 second.  its more efficient to use the old method. 
for anything over 1s, we set a timer to come back alter and swap the lines
functions back to normal.  The action of scrollbottom is simply its usual
function of moving any line after some preset time.

the point about killing showDone is a very good question.  I'll check on that,
as I'm not sure either way. I guess if we do happen to call killAnimation to
interrupt the display for something else, showDone should be killed as well.
Comment 15 KDF 2004-10-14 18:06:56 UTC
Created attachment 179 [details]
kill showDone in killAnimation

updated to kill showDone so new animation/lines can override if they need to.
Comment 16 Blackketter Dean 2004-10-14 21:58:02 UTC
ok, cool.  

sorry to be a pain about the 1 second rule, but there's nothing magic about that number.  Let's say that 
the user sets the scroll pause to 1/2 second. Then they do a showbriefly for 1 second.  In theory, they 
should see a half second of scrolling, no?  It's a minor thing, but if the user sets the pause to, say 5 
seconds and then showbriefly is called with a 4 second time, then the old optimized code should kick 
in, right?

Apart from that, go for it!  Thanks!
Comment 17 KDF 2004-10-15 14:11:57 UTC
can't kill showDone timer after all or you get locked in the showBriefly. 
Probably have to kill the timer and call showDone immediately.
Comment 18 KDF 2004-10-15 15:11:31 UTC
I may be able to eliminate the need for a special 1s timer by only setting the
timer when one doesnt already exist.  This way, we dont have overlapping
'stored' linefunc's to worry about.  What I would like to do as well is have it
extend the timer if a new showbriefly is called before the timer fires.  This
way the timer keeps the proper linefunc, but always updates to the latest
duration used.  subsequent and overlapping ShowBriefly calls will then simply
override one another and return back to the original display.

This would need a new timer function, similar to adjustAllTimers
Comment 19 KDF 2004-10-15 21:44:37 UTC
Created attachment 180 [details]
update showDone timer each time sshowBriefly is called.

This method gets rid of the need for a >1s test.  We can't kill showDone as a
timer via killAnimation becuase scrollBottom calls killAnimation.  We end up
stuck in the brief message.  This version updates the timer for ShowDone based
on teh most recent $duration given.  There is currently no case to kill the
showBriefly becuase generally those messages override all else.  If someone can
point out a case where we want to override it, I might be better able to find a
place to kill the timer.
Comment 20 Blackketter Dean 2004-10-19 12:43:51 UTC
Can't you just use killTimer and then set a new one?
Comment 21 KDF 2004-10-19 13:16:27 UTC
sure, but I just discovered it doesn't work anyway.  Not having the 1s test now
breaks when block mode is used. sadly, the more this goes on, the more it looks
like showBriefly has to completely replicate all the animation on its own.  very
disappointing. The timer is a great way to handle long durations, but not so
good for very short ones.  I'll have to keep looking it over.
Comment 22 KDF 2004-10-19 19:36:52 UTC
no, can't use kill because we need to keep the original oldines in order to
return to the right place.  the example is the volume control where we are
rapidly repeating the showbriefly for the volume bar.  killing the timer means
we trap the volume bar as oldlines intead of whatever mode we're in.  
Comment 23 Blackketter Dean 2004-10-20 09:15:07 UTC
Idea: Let's make showBriefly push the player (without animation) into a mode that only displays the 
specified text.  then set a timer to pop it out of the mode.  Also, any IR input would pop it out of the 
mode.  the only trick is to get it to not lose the IR event once popped out.  Want to take a crack at this?
Comment 24 KDF 2004-10-20 11:07:33 UTC
i gave it a shot but I dont think that will work either as teh modes are
sometimes being switched during a showbriefly.  For instance, when doing a
search.  as the search starts, showBriefly is called, then we pushmode to
browseid3. with the new idea, we've pushed into showbrielfy, the pushed into
browseid3.  I can avoid the pop if we've moved on, but then popping will go back
through showbriefly.
Comment 25 KDF 2004-10-20 14:12:07 UTC
Created attachment 183 [details]
showbriefly as a mode

here is the patch I've tried.  on power up, the welcome display shows after
first button press as well, becuase of the problem mentioned in the last post. 
You can also see it come into play when searching or any other case where
showBriefly is called just before a mode change. One solution would be to move
them all after the mode change, but then we'd need to rewrite the the older
style showBriefly.
Comment 26 KDF 2004-10-20 16:38:04 UTC
Created attachment 184 [details]
much better now

now I'm sure I'm ill.  this version checks for the method and pops out of
showbriefly if we've poped into that mode.  not quite able ot get all the
buttons to pass back, however
Comment 27 KDF 2004-10-20 23:15:37 UTC
Created attachment 186 [details]
this is it.

ok, i realised the last patch had a bad diff for Default.map.  This one fixes
that and handles the passback.	This should cover most functions but more can
be added if I've missed any.  Some work directly without needing a passback.
Comment 28 Vidur Apparao 2004-10-22 14:13:43 UTC
One issue that I see coming up by making showBriefly its own mode is related to
modes that use the INPUT.* packages for display. Many of these modes have
patterns similar to:

	if ($method eq 'pop') {
		Slim::Buttons::Common::popMode($client);
	}

in their setMode() method. If any of these modes use showBriefly() with the new
patch, they will do an extra popMode() on return. This is also an issue for
Slim::Buttons::Block.

Comment 29 KDF 2004-10-22 14:43:33 UTC
well, that bit was added specifically because of block mode, since every case
pushes into block after showbriefly, we need to also pop out of showbriefly
after unblock or the showbriefly message comes up again. (the reason I added
this was because the "free your music" message would show up after you press a
button at power-up.  Thus, we actually want the double pop.  When a mode pushes
straight into an INPUT.* mode, we pop back out of INPUT.* into, say 'settings'
mode, we need to pop again out of settings into 'home'. the modes that push into
INPUT dont have any activity in their mode any more, so a showbriefly should
never get in the way of that. The patch does seem to now work well with the
startup message, volume control and the search modes (which use INPUT.* and
block). If you do find anywhere that it doesn't work, then I can probably find a
way around it. That is how we've ended up here.  startup, search, and volume
control leave little room for messing about with blocking and short messages. 
However, something does need to change because the current code will sometimes
lose a message entirely, wont do long durations properly and wont scroll. It
also wont do messages shorter than 1s, except by virtue of being cut short by
the standard $client->update cycle every 1s.

if we want to play safe, we can still have an if ($duration < 1) clause which
reverts to the old routine.  This results in a volume display that still
flickers, but leaves the short messages working as they do now and allows CLI
long message to linger and scroll properly when they are required. The server
itself only ever does a message over 1s for the alarm clock.
Comment 30 Blackketter Dean 2004-10-22 14:44:27 UTC
ok, so maybe my idea to put showbriefly in its own mode was a bad one...
Comment 31 KDF 2004-10-22 15:01:46 UTC
I'm not sure I see the problem yet, at least not in any concrete way that
affects how I use the player.  I've had this patch on my system for a few days
now.  One subtle effect shows in the volume control where it does seem to have
an slightly uneven pace.  I've considered this a fair trade for the former case
which caused some flicker back to the old lines every so often when you held
down the volume control.  
Comment 32 Vidur Apparao 2004-10-25 10:03:22 UTC
I'm speaking from the perspective of a plugin writer who has used both
showBriefly and block from my own menu mode, sometimes *before* pushing into a
INPUT.* mode. For example, the Slim Devices Picks plugin goes into block mode
while loading a remote playlist. Once the loading is done, it pushes into
INPUT.List. Without maintaining some state, I'm unable to detect the difference
between popping out of block mode and popping out of INPUT.List. The latter
should result in a double pop, the former shouldn't. For the same reason, I will
definitely have to modify some plugins to deal with showBriefly() becoming a
mode. Or am I missing something?
Comment 33 Blackketter Dean 2004-10-25 12:15:23 UTC
Excellent point.  showBriefly and the block() mode are similar in that they both want to put up a kind of 
dialog box on the screen while something happens.  both are broken in subtle ways.  I like the idea of 
using modes, but there clearly needs to be some code that does something smart for each when 
pushing and popping other modes....
Comment 34 KDF 2005-02-28 11:36:38 UTC
this seems to be stuck as an architectural issue, so I have no direction for
continuing on this.
Comment 35 Blackketter Dean 2005-03-11 20:06:52 UTC
Will look at this.
Comment 36 KDF 2005-03-30 09:43:56 UTC
*** Bug 1245 has been marked as a duplicate of this bug. ***
Comment 37 Adrian Smith 2005-05-22 13:58:06 UTC
Assuming people agree this is fixed by the new display code, I would suggest 
this is closed...  [or did I miss something in this?  I'm interpreting the 
root problem as lack of scrolling for graphical showBriefly]
Comment 38 KDF 2005-05-22 23:47:09 UTC
sorry, yes, i did check this and it seemed to work for me.  Marking as fixed. 
it can be re-opened if an issue is discovered.
Comment 39 Chris Owens 2008-03-11 11:27:55 UTC
This bug was marked resolved in Slimserver 6.1, which is several versions ago.  If you're still seeing this bug, please re-open it.  Thanks!