Bug 12756 - Alarm clock function AM/PM difficult to set
: Alarm clock function AM/PM difficult to set
Status: CLOSED FIXED
Product: SB Boom
Classification: Unclassified
Component: UI
: unspecified
: PC Windows XP
: -- normal (vote)
: 7.5.0
Assigned To: Adrian Smith
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-09 08:22 UTC by Ryan
Modified: 2010-04-08 17:24 UTC (History)
5 users (show)

See Also:
Category: ---


Attachments
proposed patch (727 bytes, patch)
2009-09-14 14:12 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan 2009-07-09 08:22:58 UTC
When setting up the alarm clock function using the small remote the hours and minutes setup easily. However the AM PM selection is very touchy when the remote key is pressed it rapidly cycles through AM PM multiple times often resulting in no change. Only with a very quick touch was I able to get it to update. This problem was only apparent while selecting AM or PM.
Comment 1 James Richardson 2009-07-09 08:33:47 UTC
QA Confirmed.  only happens with the IR remote, front panel knob is OK.

Adrian: can you have a look at this one?
Comment 2 Adrian Smith 2009-07-11 04:26:15 UTC
This is a problem with Slim::Buttons::Common::scroll_dynamic for short lists - this will always wrap the list when you go up/down.  With the rubber button on the small remote its more likely you get two button presses which means it moves back to where you started with...

I think this function should implement a pause at each end of the list all the time rather than only doing it when scrolling kicks in.  Caleb?
Comment 3 KDF 2009-09-14 11:23:43 UTC
How about ONLY allowing adjustment via the hours column.  Scrolling hours is already handled as 24 hours with AM/PM being done automatically.
Comment 4 Adrian Smith 2009-09-14 12:03:15 UTC
I was hoping Caleb would look at this as its not a problem with AM/PM its a problem with short lists.  This is a symptom not the main problem..
Comment 5 KDF 2009-09-14 13:37:44 UTC
I'm not sure this is due to scroll_dynamic.  During the wait time (before getting to the min hold for accel), the value should remain constant.  However, this param ($currentPosition) is being fed to scroll_dynamic from the caller.  It is this param that is alternating and causing the AM/PM to toggle so fast.  Basically, it's not toggling due to the scroll routine, but instead toggling on each repeat ir tick.  

I believe this is caused by the code which recalculates the time %%valueRef on each cycle.

to be clearer, lets take minutes:

first call sends 19 as current value.
scroll_dynamic increases to 20.
next call sends 20
scroll_dynamic returns 20 (until holdTime is exceeded).
third call sends 20, etc

Now, for am/pm:
first call sends 0
scroll_dynamic increases to 1
second call sends 1
scroll_dynamic returns 1
next call...sending 0

The calculation after the scroll is the issue:
$h = ($h + ($p ? 12 : -12)) % 24;

Every time $p = 1, it adds 12 hours so you get a toggle. scroll_dynamic can do nothing to change that.  S::B::I::Time::scrollTime needs to change the way it calculates, either by detecting the change, or subtracting from $h when $p is initted then adding it back in after if needed.
Comment 6 KDF 2009-09-14 13:55:44 UTC
As another data point, I hacked up a two-item list by trimming the screensaver options to just two.  They scroll and hold correctly.  No lists on the ip3k players are currently able to roll over.  They hold when the end is reached, until the button is pressed again to either go back or roll over.
Comment 7 KDF 2009-09-14 14:12:04 UTC
Created attachment 5846 [details]
proposed patch

This simple patch make sure $p has changed before we calculate its effect on $h.  If the scroll doesn't change (eg, when held) then the value remains the same.
Comment 8 SVN Bot 2009-11-02 15:01:21 UTC
 == Auto-comment from SVN commit #29134 to the slim repo by kdf ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29134 ==

Bug: 12756
Description: check am/pm for changes before altering hours value.  This way, holding the up/down button will no longer toggle.
Comment 9 SVN Bot 2009-11-02 15:03:03 UTC
 == Auto-comment from SVN commit #29135 to the slim repo by kdf ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29135 ==

bug: 12756
description: changelog update
Comment 10 KDF 2009-11-02 15:03:40 UTC
I believe this to be fixed in 7.5.0 trunk now that this patch is in.  Please reopen if there are any issues.
Comment 11 Chris Owens 2010-04-08 17:24:45 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!