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:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  [solved] WPS - how to collapse empty lines?
« previous next »
  • Print
Pages: [1]

Author Topic: [solved] WPS - how to collapse empty lines?  (Read 829 times)

Offline sellsky

  • Member
  • *
  • Posts: 1
[solved] WPS - how to collapse empty lines?
« on: July 17, 2013, 11:44:39 AM »
I'm trying to make WPS display some data on each line:

Quote
Artist
Composer
Album, Disk#-Track#
et cetera

The first approach was

Code: [Select]
%s%al%?ia<%ia|%?d(2)<%d(2)>>
%s%al%?ic<%ic>
%s%al%?id<%id%?in<%, %?ik<%ik-%in|%in>>>
...

This works pretty well, however, if there is no Composer in tags, I see the ugly empty line between Artist and Composer. What can I do to collapse this empty line? Just:

Quote
Artist
Album, Disk#-Track#
et cetera

I moved the newline under condition,

Code: [Select]
%s%al%?ia<%ia|%?d(2)<%d(2)>>%?ic<
%s%al%ic>
%s%al%?id<%id%?in<%, %?ik<%ik-%in|%in>>>
...
and then
Code: [Select]
%s%al%?ia<%ia|%?d(2)<%d(2)>>%?ic<
%ic>
%s%al%?id<%id%?in<%, %?ik<%ik-%in|%in>>>
...

-- the first one just replaces Artist line with Composer if there is a Composer tag, and the second one joins Artist and Composer on the same line. Newline isn't respected at all.

If I add some text after “%?ic<”, the checkwps tool complains about 'Expected list close', so I move the wrong way I guess. I googled the web and especially this forum, with no luck. Of couse I can bloat the code, making conditions for every line here and then, but this doesn't smell good.

Any suggestions?
« Last Edit: July 29, 2013, 11:23:30 AM by sellsky »
Logged

Offline Julian67

  • Member
  • *
  • Posts: 116
Re: WPS - how to collapse empty lines?
« Reply #1 on: July 17, 2013, 04:02:01 PM »
It's quite a while since I made a wps but I think the solution is to make a different viewport for each situation, much like many themes use a different viewport depending on the presence of album art.  So you make a conditional "if composer tag present use viewport A, otherwise use viewport B".
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  [solved] WPS - how to collapse empty lines?
 

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

Page created in 0.061 seconds with 15 queries.