Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  no nesting after all?
« previous next »
  • Print
Pages: [1]

Author Topic: no nesting after all?  (Read 1340 times)

Offline NaFIann

  • Member
  • *
  • Posts: 33
no nesting after all?
« on: July 13, 2007, 03:42:28 PM »
Hi,

I'm currently modifying an existing theme for my own use (the font was too small for me:p).
In doing so, I wanted it to display genre for 5 secs and then year for 5 secs, if either wasn't available I wanted to continuously display just one and if none was available just display nothing.
the code I came up with was this:

%?ig< %?iy< %t5%ig;%t5%iy | %ig> | %?iy< %iy > >

which to me seems fine, since the manual said nesting was okay. However, using this messes the entire theme up. So, is it just not possible? (in my opinion this can be parsed only one way and should thus give no problem, but hey, wo am I?)
Any help would be nice.

NaFiann
Logged

Offline Lear

  • Developer
  • Member
  • *
  • Posts: 533
Re: no nesting after all?
« Reply #1 on: July 13, 2007, 05:05:42 PM »
I'm pretty sure you need to do it the other way around. I.e., you can't put alternating lines inside a conditional, it must be outside. It should be possible to do what you want that way, but it would be a little ugly, I think (lots of repeating conditionals).
Logged

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 645
Re: no nesting after all?
« Reply #2 on: July 13, 2007, 06:35:39 PM »
Nesting in general is possible but in this case I believe you can't put the next subline define in the conditional the way you do (as Lear said). I've seen some code that works with defining the time the subline is displayed as zero in a conditional - meaning "%t5" if the tag is present and "%t0" if not, but the subline divider ";" would still be outside the conditional. Somehow I couldn't get this to work as expected for me so I came up with something else in a similar situation. With your genre and year tags it would look as follows (didn't test though):
Code: [Select]
%t5%?ig< %ig|%iy>;%t5%?iy< %iy|%ig>
which would display the one available just a second time. You won't notice at all unless the line has to scroll. In my experience even if it has to scroll, the "restart" of the same line is almost not noticeable with a time of 5 or 6 seconds for the subline.

Also if you would like to have control over what is displayed if none of the two is available you can nest ;) like this for example:
Code: [Select]
%t5%?ig< %ig|%?iy< %iy|no year>>;%t5%?iy< %iy|%?ig< %ig|no genre>>
P.S. Maybe someone else can provide you with a working example of the first way I mentioned.
« Last Edit: July 13, 2007, 06:56:07 PM by pixelma »
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: no nesting after all?
« Reply #3 on: July 13, 2007, 07:06:38 PM »
I've done it the other way around and it works; it just can be (as noted) a bit "long" that way.  But hey, it's all a New York Times crossword puzzle, in the end.

;)
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  no nesting after all?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.082 seconds with 15 queries.