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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Help with nested conditional sublines
« previous next »
  • Print
Pages: [1]

Author Topic: Help with nested conditional sublines  (Read 857 times)

Offline ELCore

  • Member
  • *
  • Posts: 2
Help with nested conditional sublines
« on: November 14, 2011, 09:08:13 AM »
Hello. I love rockbox! I use it on my Sansa Fuze. I have been modifying the WPS of the kyo-rocked theme.

I have one line with two sublines. First, it displays the playlist name; then it displays the next song in either of two ways: if the next artist is the same as the current artist, it displays the next tract title only; if the next artist is different than the current artist, it displays the next tract title and, in parentheses, the next artist.

Here is the code:

Code: [Select]
%s%t(10)%ac%?pn<Playlist: %pn|Dynamic Playlist>;
%?if(%ia, =, %Ia)<%t(10)%s%ac%?It<Next: %It|No Next Song>|%t(0)>;
%?if(%ia, !=, %Ia)<%t(10)%s%ac%?It<Next: %It %(%Ia%)|No Next Song>|%t(0)>

I doubt that's as efficient or as elegant as it could be, but it works.

I would like to add another conditional. If the next artist is the same as the current artist, but the album name is different, I would like to display the next tract title and, in brackets, the next album name.

That is, it would still have only two sublines, but the second (displaying the next song info) would display either the next track title only (if next artist and next album are the same as current) or the next track title and artist name (if next artist is different) or the next track title and album name (if next artist is the same but album is different).

I have tried several different methods, but I cannot get any to work. Could somebody help me out? Thanks.
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: Help with nested conditional sublines
« Reply #1 on: November 17, 2011, 07:11:41 AM »
You have a few options, the obvious two are:
1) make 2 viewports, one for when the artists are the same and one when they arent.
2) just add the conditionl in the line.. something like:
Code: [Select]
%?if(%ia, !=, %Ia)<%t(10)%s%ac%?if(%id, !=, %Id)<%Id> - %?It<Next: %It %(%Ia%)|No Next Song>|%t(0)>
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Help with nested conditional sublines
 

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

Page created in 0.065 seconds with 15 queries.