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
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Help with this code
« previous next »
  • Print
Pages: [1]

Author Topic: Help with this code  (Read 1023 times)

Offline Elaphe

  • Member
  • *
  • Posts: 23
Help with this code
« on: September 03, 2014, 05:13:25 PM »
This code shows the number of the track currently playing and toggles to the name of the next track in the list after 10 seconds.

Code: [Select]
%ac%t(10.0)Track: %?in<%in|N/A>;%t(10.0)%ac%sNext: %?It<%It|%Fn>

Is there a way to disable the toggle when the last track is reached? I mean, there's no point then to display: "Next:" or "Next: nothing".
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Help with this code
« Reply #1 on: September 03, 2014, 07:48:33 PM »
Its...some form of theme guy...to the rescue!

Quote from: Elaphe on September 03, 2014, 05:13:25 PM
This code shows the number of the track currently playing and toggles to the name of the next track in the list after 10 seconds.

Code: [Select]
%ac%t(10.0)Track: %?in<%in|N/A>;%t(10.0)%ac%sNext: %?It<%It|%Fn>

Is there a way to disable the toggle when the last track is reached? I mean, there's no point then to display: "Next:" or "Next: nothing".

We can cheat here, somewhat. We can detect if there is a next track present in a roundabout way, by checking to see if it has a file name. Obviously you won't want the sublines to cycle a blank line either, so there's going to be a slight amount of code duplication, but, we can live with that.

Code: [Select]
%ac%s%?Fn<%t(10.0)Track: %?in<%in|N/A>;%t(10.0)Next: %?It<%It|%Fn>|Track: %?in<%in|N/A>>

Let me know if you have any further questions, be it regarding the above syntax or otherwise.


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

Offline Elaphe

  • Member
  • *
  • Posts: 23
Re: Help with this code
« Reply #2 on: September 04, 2014, 02:50:38 PM »
Thanx a lot. It works perfectly.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Help with this code
 

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

Page created in 0.064 seconds with 15 queries.