Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: ew on August 20, 2010, 02:23:50 PM

Title: Conditionals with timings
Post by: ew on August 20, 2010, 02:23:50 PM
Is there a problem with conditionals and timings in the latest build.

The following snippet

Quote
%?mp<|%pb(0,0,-,-,linebarpb.bmp)|%pb(0,0,-,-,linebarpb.bmp)|%pb(0,0,-,-,linebarpb.bmp)|||%pb(0,0,-,-,linebarpb.bmp)|%pb(0,0,-,-,linebarpb.bmp)>

used to skip (display for 0 seconds) any blank values.  The recent build (27847 using the Sansa e200 simulator) seems to display all of the blank values.

Also, another observation using the recent change to the skin parser.  I used to have viewports that called other viewports.  For example:

%Vd(a)
......
%Vl(a,bla,bla....)
Display this text and the next viewport
%Vd(b)
......
%Vl(b,bla,bla....)
Display text
Display image

With the new skin parser, stuff in the secondary viewport are not cleared when they are no longer called by the primary viewport.  The old skin parser used to clear the sub viewports.  I did not know if that was something that was intended or unintended - I just though I would ask.

Thanks,

EW
Title: Re: Conditionals with timings
Post by: JdGordon on August 21, 2010, 04:44:29 AM
apparently there is, it shuold have been fixed during the week,,, I'll have another look tomorow maybe
Title: Re: Conditionals with timings
Post by: ew on August 29, 2010, 05:51:51 PM
Have you had a chance to look into this?  Unless I am doing something wrong - and, I realized that I must have posted the wrong snippet from my wps.

The snippet (conditional timing that is not working for me) is:

Quote
%?ic<%s%al%t(6)Composer:|%t(0)>;%?iA<%s%al%t(6)Alb Artist:|%t(0)>;%?ia<%s%al%t(6)Trk Artist:|%t(0)>
%?ic<%s%al%t(6)%ic|%t(0)>;%?iA<%s%al%t(6)%iA|%t(0)>;%?ia<%s%al%t(6)%ia|%t(0)>

Thanks,
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 01:30:37 AM
how is it not working for you?
Title: Re: Conditionals with timings
Post by: [Saint] on August 30, 2010, 01:38:56 AM
Code: [Select]

%?ic<%s%al%t(6)Composer:|%t(0)>;%?iA<%s%al%t(6)Alb Artist:|%t(0)>;%?ia<%s%al%t(6)Trk Artist:|%t(0)>

%?ic<%s%al%t(6)%ic|%t(0)>;%?iA<%s%al%t(6)%iA|%t(0)>;%?ia<%s%al%t(6)%ia|%t(0)>



Is working as expected for me...I had to add the newline in the middle as the themeeditor seems to think its one line without doing so.

Code: [Select]
%?ic<%s%al%t(6)Composer:|%t(0)>;%?iA<%s%al%t(6)Alb Artist:|%t(0)>;%?ia<%s%al%t(6)Trk Artist:|%t(0)>
%?ic<%s%al%t(6)%ic|%t(0)>;%?iA<%s%al%t(6)%iA|%t(0)>;%?ia<%s%al%t(6)%ia|%t(0)>

Appears as:

Composer:Current Composer;Alb Artist:Current Album Artist; Trk Artist:Current Track Artist

As opposed to:

Composer:
Current Composer
;
Alb Artist:
Current Album Artist
;
Trk Artist:
Current Track Artist

* ";" signifies an alternation.


Something definitely isn't right in Alternating-Subline Town.



[St.]
Title: Re: Conditionals with timings
Post by: ew on August 30, 2010, 11:53:57 AM
Perhaps I should have clarified what my issue is.

There are 3 alternating displays (the info for each is divided into 2 lines):

On top of that is a conditional.  The conditional says that if the tag value is blank, skip (or display for time=zero) that display.

For example if the composer tag = "abc", and there are no Track Artist or Album Artist tags, the display will be:

Composer
ABC

and there would be no alternating text (because of the conditional.

What is happening for me is that the blanks are displaying alternatively.  It is as if the %t(0) tag is being displayed for a short time instead of no time at all.

I hope this explanation is a bit clearer.
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 09:39:40 PM
interesting experiment... can you add ;%t(0) at least 25 times to your line and see if there is a difference in the time it takes to get back to displaying the composer text?
I think I see the bug and if you do notice an extra delay then it would be confirmed.. or alternativly, can you build your own builds?
Title: Re: Conditionals with timings
Post by: ew on August 30, 2010, 09:53:17 PM
What I did is added ;%t(0) - 25 times at the end of one of the two lines.  The two lines have always been in sync (same conditions, same timings, just different text being displayed.

The two lines were out of sync - which means to me that the ;%t(0) did add some time.

Just to be clear - what I tested is the following:

1st line
Quote
%?ic<%s%al%t(6)Composer:|%t(0)>;%?iA<%s%al%t(6)Alb Artist:|%t(0)>;%?ia<%s%al%t(6)Trk Artist:|%t(0)>;%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0);%t(0)
2nd line
Quote
%?ic<%s%al%t(6)%ic|%t(0)>;%?iA<%s%al%t(6)%iA|%t(0)>;%?ia<%s%al%t(6)%ia|%t(0)>

I hope this helps...

Thanks for looking at this.
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 10:09:41 PM
yep, OK, then I see what the problem is.
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 10:20:30 PM
should be fixed in  r27956, so once that finishes building (3 min or so) please try it and let me know
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 10:44:54 PM
woops, no that is almost certainly wrong
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 10:58:00 PM
Yeah, this is a non-trivial fix. the issue is that we dont know which subline we want to draw based on the timeout untill we pick one and then calculate the conditionals so find the timeout.

So this is not fixed, ew, can you file a bug (I don't think there is one for this yet) although because it isnt trivial it probably wont be fixed any time soon.)
Title: Re: Conditionals with timings
Post by: audio-i on August 30, 2010, 11:28:47 PM
Is this problem related or similar to FS#11542?
Title: Re: Conditionals with timings
Post by: JdGordon on August 30, 2010, 11:34:13 PM
unrelated. that one is the timeout tag was being ignored, this one is that the subline chooser mechanism isnt smart enough to see that the line currently being displayed has been set to %t(0).

I'm not sure how to go about fixing this. I really dont want to conditionally check each subline for a %t buried inside conditionals.
Title: Re: Conditionals with timings
Post by: ew on August 31, 2010, 07:06:34 AM
I will file a bug, but it will be a bit later today.  Thanks for looking into this.
Title: Re: Conditionals with timings
Post by: AsusFreak on August 31, 2010, 07:17:40 AM
JdGordon,
I saw you released r27956 to solve this problem (?). I tried it with my AF_Black theme and still have the same problem. I used the following line to get something like an Onscreen Menu disappearing after 2 seconds:

Code: [Select]
%?St(touchscreen mode)<%?Tl(2)<%Vd(j)|%Vd(k)>|%Vd(k)>
It does disappear but the refresh of the rest does not work and I pointed out that because of the timing in the conditional I never get back to the redrawing Viewport - only by re-pressing the screen the conditional works right again because it starts at a defined status.

I tested this with an old release r27530 and everything's working fine.

@ew:
Please name the bug number here, then I will add my part.
Title: Re: Conditionals with timings
Post by: JdGordon on August 31, 2010, 08:43:09 AM
read the thread, that commit didnt actually fix this issue, and that line has no timeout tags in which means means it is a ocmpletly different issue
Title: Re: Conditionals with timings
Post by: ew on August 31, 2010, 09:11:19 AM
FS#11588 filed (http://www.rockbox.org/tracker/task/11588) for this item.

Thanks,

EW
Title: Re: Conditionals with timings
Post by: AsusFreak on August 31, 2010, 09:24:44 AM
read the thread, that commit didnt actually fix this issue, and that line has no timeout tags in which means means it is a ocmpletly different issue

Completely different? Conditional with a timeout. It might be a different tag but for me as user (with less coding skills than you) I understood it as a possible identical issue. If I'm wrong I'm sorry.

Quote from: Wiki

If you put a number straight after %Tl it will be used as a timeout in seconds (e.g %Tl2.5 will give a 2.5s timeout) between the touchscreen press being released and the tag going false. If no number is specified it will use a 1 second timeout. Can also be used as a conditional, and can be used with conditional viewports for some really neat effects.

Title: Re: Conditionals with timings
Post by: JdGordon on August 31, 2010, 09:29:27 AM
different tag, completly different issue
Title: Re: Conditionals with timings
Post by: AsusFreak on August 31, 2010, 09:31:09 AM
Ok, than I AM sorry. :-[
Title: Re: Conditionals with timings
Post by: ew on September 03, 2010, 02:59:20 PM
Forgive me if I am dense, but I saw that the bug was resolve and a fix was checked in, but I don't see how the problem is solved.

The following are the results of my testing of r27994 (I had to wait for a simulator build).

Again, my wps code is:

Quote
%?ic<%s%al%t(6)Composer:|%t(0)>;%?iA<%s%al%t(6)Alb Artist:|%t(0)>;%?ia<%s%al%t(6)Trk Artist:|%t(0)>
%?ic<%s%al%t(6)%ic|%t(0)>;%?iA<%s%al%t(6)%iA|%t(0)>;%?ia<%s%al%t(6)%ia|%t(0)>

I have a track that has an %iA, but no %ia or %ic

As a result of the first line of the wps, I get a short display of "Alb Artist:" with a longer display of a blank line.  I would think that there should not be any blank display.
The second line continues to display the contents of the %iA tag - and begins the scroll process about each two seconds.  If the tags are blank is the prior tag value not being cleared out?

Additionally, if I changed some (or all) of the %t(6)s on the first line to %t(9)s (changed from 6 seconds to 9 seconds) the synchronization between the first and the second line does not change.  Furthermore, each conditional subline seems to be occurring after about 2 seconds, and not the time specified in the %t tag.

Just as another informational point, after the fix, the following sbs line caused a fault in both the player and the simulator

Quote
%?bc<%t(0.1)%xd(Ba)|%t(0)>;%?bc<%t(0.1)%xd(Bb)|%t(0)>;%?bc<%t(0.1)%xd(Bc)|%t(0)>;%?bc<%t(0.1)%xd(Bd)|>

In truth, this was a very stupid line, and I was able to change the line, get the same effect, simplify the code and avoid the fault by using the following as a substitute

Quote
%?bc<%t(0.1)%xd(Ba);%t(0.1)%xd(Bb);%t(0.1)%xd(Bc);%t(0.1)%xd(Bd)|>

The only reason that I mention this is that you may want to avoid situations where theme code produces a device fault.

I would be glad to do some more testing, but at the current time, my build environment is broken and I have no idea how to fix it (I have another thread on this).

Thanks for all the assistance.

I think It does not appear that the sub-lines that
Title: Re: Conditionals with timings
Post by: ew on October 12, 2010, 10:20:47 AM
Been out of touch for a little while, but I am able to confirm that as of build 28235, the issue seems to be fixed.  Perhaps it was fixed in 28226, or some other build, nonetheless it seems to be working now.

Thank you!