Enable JavaScript to show search field.

B.  Theme Tags

Themeing is discussed in detail in section section 11.2, what follows is a list of the available tags.

Note: The “bar-type tags” (such as %pb, %pv, %bl etc.) can be further themed – see section B.21.

B.1 Status Bar
B.2 Hardware Capabilities
B.3 Information from the track tags
B.4 Power Related Information
B.5 Information about the file
B.6 Playlist/Song Info
B.7 Playlist Viewer
B.8 Runtime Database
B.9 Hold
B.10 Virtual LED
B.11 Repeat Mode
B.12 Playback Mode
B.13 Current Screen
B.14 List Title (.sbs only)
B.15 Changing Volume
B.16 Settings
B.17 Alignment and language direction
B.18 Conditional Tags
B.19 Subline Tags
B.20 Text Translation
B.21 Bar Tags
B.21.1 Options
B.22 Other Tags

B.1  Status Bar

Tag

Description



%we

Display Status Bar

%wd

Hide Status Bar

%wi

Display the inbuilt Status Bar in the current viewport

These tags override the player setting for the display of the status bar. They must be noted on their own line (which will not be shown in the WPS).

B.2  Hardware Capabilities

Tag

Description



%cc

Check for presence of a real time clock, returns “c” when used unconditionally

%tp

Does this target have a radio?

%Tp

Indicates that the target has a touchscreen

With the above tags it is possible to find out about the presence of certain hardware and make the theme adapt to it. This can be very useful for designing a theme that works on multiple targets with differing hardware capabilities, e.g. targets that do and do not have a clock. When used conditionally, the “true” branch is completely ignored if it does not apply.

Example: %?cc<%cH:%cM|No clock detected>

B.3  Information from the track tags

Tag

Description



%ia

Artist

%ic

Composer

%iA

Album Artist

%id

Album Name

%iG

Grouping

%ig

Genre Name

%in

Track Number

%it

Track Title

%iC

Comment

%iv

ID3 version (1.0, 1.1, 2.2, 2.3, 2.4, or empty if not an ID3 tag)

%iy

Year

%ik

Disc Number

Remember that this information is not always available, so use the conditionals to show alternate information in preference to assuming.

These tags, when written with a capital “I” (e.g. %Ia or %Ic), show the information for the next song to be played.

B.4  Power Related Information

Tag

Description



%bl

Numeric battery level in percents. Can also be used in a conditional: %?bl<-1|0|1|2|…|N>, where the value 1 is used when the battery level isn’t known (it usually is). The value N is only used when the battery level is exactly 100 percent. An image can also be used, the proportion of the image shown corresponds to the battery level: %bl(x,y,[width],[height],image.bmp)

%bv

The battery level in volts

%bt

Estimated battery time left

%bp

“p” if the charger is connected (only on targets that can charge batteries)

%bc

“c” if the unit is currently charging the battery (only on targets that have software charge control or monitoring)

%bs

Remaining time of the sleep timer (if it is set)

B.5  Information about the file

Tag

Description



%fb

File Bitrate (in kbps)

%fc

File Codec (e.g. “MP3” or “FLAC”). This tag can also be used in a conditional tag: %?fc<mp1|mp2|mp3|aiff|wav|ogg|
flac|mpcsv7|a52|wavpack|alac|aac|shn|sid|adx|nsf|
speex|spc|ape|wma|wmpapro|mod|sap|realaudiocook|
realaudioaac|realaudioac3|realaudioatrac3|cmc|
cm3|cmr|cms|dmc|dlt|mpt|mpd|rmt|tmc|tm8|tm2|
omaatrac3|smaf|au|vox|wave64|tta|wmavoice|mpcsv8|
aache|ay|gbs|hes|sgc|vgm|kss|unknown>. The codec order is as shown above.

%ff

File Frequency (in Hz)

%fk

File Frequency (in kHz)

%fm

File Name

%fn

File Name (without extension)

%fp

File Path

%fs

File Size (in Kilobytes)

%fv

“(avg)” if variable bit rate or empty string if constant bit rate

%d(N)

N-th segment from the end of the file’s directory (N can be 1, 2, 3, …)

Example for the %d(N) commands: If the file is “/Rock/Kent/Isola/11 - 747.mp3”, %d(1) is “Isola”, %d(2) is “Kent” and %d(3) is “Rock”.

These tags, when written with the first letter capitalized (e.g. %Fn or %D(2)), produce the information for the next file to be played.

B.6  Playlist/Song Info

Tag

Description



%pb

Progress Bar. This will display a one character “cup” that empties as the time progresses.

%pf

Full-line progress bar & time display

%px

Percentage played in song

%pc

Current time in song

%pe

Total number of playlist entries

%pn

Playlist name (without path or extension)

%pp

Playlist position

%pr

Remaining time in song

%ps

“s” if shuffle mode is enabled

%pt

Total track time

%pv

Current volume (in dB). Can also be used in a conditional: %?pv<Mute|…|0 dB|Above 0 dB>
Mute is 0% volume, …is the values between Mute and max, 0 dB is max volume, and Above 0 dB is amplified volume

%pS

Track is starting. An optional number gives how many seconds the tag remains true for after the start of the track. The default is 10 seconds if no number is specified. %?pS(7)<in the first 7 seconds of track|in the rest of the track>

%pE

Track is ending. An optional number gives how many seconds before the end of the track the tag becomes true. The default is 10 seconds if no number is specified. %?pE(7)<in the last 7 seconds of track|in the rest of the track>

%Sp

Current playback pitch

B.7  Playlist Viewer

Tag

Description



%Vp(start,code to render)

Display the playlist viewer in the current viewport.

The entire viewport will be used, so don’t expect other tags in the same viewport to work well. Supported tags are %pp, all tags starting with %i, most tags starting with %f, %pt and %s.

Example: %Vp(1,%pp - %it,%pp - %fn) – Display the playlist position, then either the track title (from the tags) or the filename. The viewer will display as many tracks as will fit in the viewport.

B.8  Runtime Database

Tag

Description



%rp

Song playcount

%rr

Song rating (0-10). This tag can also be used in a conditional tag: %?rr<0|1|2|3|4|5|6|7|8|9|10>

%ra

Autoscore for the song

B.9  Hold

Tag

Description



%mh

“h” if the main unit keys are locked

B.10  Virtual LED

Tag

Description



%lh

“h” if the hard disk is accessed

B.11  Repeat Mode

Tag

Description



%mm

Repeat mode, 0-4, in the order: Off, All, One, Shuffle, A-B

Example: %?mm<Off|All|One|Shuffle|A-B>

B.12  Playback Mode

Tag

Description



%mp

Play status, 0-4, in the order: Stop, Play, Pause, Fast Forward, Rewind, Recording, Recording paused, FM Radio playing, FM Radio muted

Example: %?mp<Stop|Play|Pause|Ffwd|Rew|Rec|Rec pause|FM|FM pause>

B.13  Current Screen

Tag

Description



%cs

The current screen, 1-20, in the order shown below


Number

Screen



1

Menus

2

WPS

3

Recording screen

4

FM Radio screen

5

Current Playlist screen

6

Settings menus

7

File browser

8

Database browser

9

Plugin browser

10

Quickscreen

11

Pitchscreen

12

Setting chooser

13

Playlist Catalogue Viewer

14

Plugin

15

Context menu

16

System Info screen

17

Time and Date Screen

18

Bookmark browser

19

Shortcuts menu

20

Track Info screen


The tag can also be used as the switch in a conditional tag. For players without certain capabilities (e.g. no FM radio) some values will never be returned.

Examples:

You are in the %?cs<Main menu|WPS|Recording screen|FM Radio screen>

%?if(%cs, =, 2)<This is the WPS>

B.14  List Title (.sbs only)

Tag

Description



%Lt

Title text. Should be used in a conditional so that non-list screens don’t show a title when they shouldn’t

%Li

Title icon. This uses the same order as custom icons (see CustomIcons in the wiki) except that here 0 is “no icon”

This tag can be used to give custom formatting to list titles. Define a viewport with the font and formatting desired, and then use %?Lt<%Lt> to display the title within the viewport. If %Lt is present anywhere in the .sbs, then the %Vi viewport will not show the title.

B.15  Changing Volume

Tag

Description



%mv(t)

“v” if the volume is being changed

The tag produces the letter “v” while the volume is being changed and some amount of time after that, i.e. after the volume button has been released. The optional parameter t specifies that amount of time, in seconds. If it is not specified, 1 second is assumed.

The tag can be used as the switch in a conditional tag to display different things depending on whether the volume is being changed. It can produce neat effects when used with conditional viewports.

Example: %?mv(2.5)<Volume changing|%pv>

The example above will display the text “Volume changing” if the volume is being changed and 2.5 seconds after the volume button has been released. After that, it will display the volume value.

B.16  Settings

Tag

Description



%St(<setting
name>)

The value of the Rockbox setting with the specified name. See section C for the list of the available settings.

%St(...)

Draw a bar using from the setting. See section B.21 for details.

Examples:

1.
As a simple tag: %St(skip length)
2.
As a conditional: %?St(eq enabled)<Eq is enabled|Eq is disabled>

B.17  Alignment and language direction

Tag

Description



%al

Align the text left

%aL

Align the text left, or to the right if RTL language is in use

%ac

Centre the text

%ar

Align the text right

%aR

Align the text right, or to the left if RTL language is in use

%ax

The next tag should follow the set language direction. When prepended to a viewport declaration, the viewport will be horizontally mirrored if the user language is set to a RTL language. Currently the %Cl, %V and %Vl tags support this.

%Sr

Use as a conditional to define options for left to right, or right to left languages. %?Sr<RTL|LTR>

All alignment tags may be present in one line, but they need to be in the order left – centre – right. If the aligned texts overlap, they are merged.

Example: %ax%V(…)

B.18  Conditional Tags

Tag

Description



%?xx<true|false>

If / Else: Evaluate for true or false case

%?xx<alt1|alt2|
alt3|…|else>

Enumerations: Evaluate for first / second / third / …/ last condition

%if(tag, operator, operand, [option count])

Allows very simple comparisons with other tags.
tag: the tag to check against.
operator: the comparison to perform - possible options are =, !=, >, >=, <, <=
operand: either a second tag, a number, or text.
[option count]: optional parameter used to select which parameter of a tag to use when the tag has multiple options, e.g. %?pv<a|b|c|d>

%and(tag1, tag2, ..., tagN)

Logical “and” operator. Will be evaluate to true if all the tag parameters are true.

%or(tag1, tag2, ..., tagN)

Logical “or” operator. Will be evaluate to true if any of the tag parameters are true.

Examples of the %if tag:

%?if(%pv, >=, 0)<Clipping possible|Volume OK> will display “Clipping possible” if the volume is higher than or equal to 0 dB, “Volume OK” if it is lower.

%?if(%ia, =, %Ia)<same artist> – this artist and the next artist are the same.

Note: When performing a comparison against a string tag such as %ia, only = and != work, and the comparison is not case sensitive.

B.19  Subline Tags

Tag

Description



%t(time)

Set the subline display cycle time (%t(5) or %t(3.4) formats)

;

Split items on a line into separate sublines

Allows grouping of several items (sublines) onto one line, with the display cycling round the defined sublines. See section 11.2.2 for details.

B.20  Text Translation

Tag

Description



%Sx(English)

Display the translation of “English” in the current language

Note: checkwps cannot verify that the string is correct, so please check on either the simulator or on target.

B.21  Bar Tags

Some tags can be used to display a bar which draws according to the value of the tag. To use these tags like a bar you need to use the following parameters (%XX should be replaced with the actual tag).

Tag

Description



%XX(x, y, width, height, [options])

Draw the specified tag as a bar
x: x co-ordinate at which to start drawing the bar.
y: y co-ordinate at which to start drawing the bar (- to make the bar appear on the line of the tag, as if it was a text tag) .
width: width of the bar (- for the full viewport width).
height: height of the bar (- to set to the font height for horizontal bars and to the viewport height for vertical bars).
options: any of the options set out below.

B.21.1  Options

image
– the next option is either the filename or image label to use for the fill image.
horizontal
– force the bar to be drawn horizontally.
vertical
– force the bar to be drawn vertically.
invert
– invert the draw direction (i.e. right to left, or top to bottom).
slider
– draw a preloaded image over the top of the bar so that the centre of the image matches the current position. This must be followed by the label of the desired image.
backdrop
– draw a preloaded image under the bar. The full image will be displayed and must be the same size as the bar. This must be followed by the label of the desired image.
nofill
– don’t draw the bar, only its frame (for use with the “slider” option).
noborder
– don’t draw the border for image-less bars, instead maximise the filling over the specified area. This doesn’t work for bars which specify an image.
nobar
– don’t draw the bar or its frame (for use with the “slider” option).
setting
– Specify the setting name to draw the bar from (bar must be %St type), the next param is the settings config name.

Example: %pb(0,0,-,-,-,nofill, slider, slider_image, invert) – draw a horizontal progressbar which doesn’t fill and draws the image “slider_image” which moves right to left.

Note: If the slider option is used, the bar will be shrunk so that the slider fits inside the specified width and height. Example: A 100px bar image with a 16px slider image needs the bar to be 116px wide, and should be offset 8px left of the backdrop image to align correctly.

B.22  Other Tags

Tag

Description



%ss(start, length, tag [,number]

Get a substring from another tag.

Use this tag to get a substring from another tag.

start
– first character to take (0 being the start of the string, negative means from the end of the string)
length
– length of the substring to return (- for the rest of the string)
tag
– tag to get
number
– OPTIONAL. if this is present it will assume the substring is a number so it can be used with conditionals. (i.e %cM). 0 is the first conditional option

Tag

Description



%(

The character ‘(’

%)

The character ‘)’

%,

The character ‘,’

%%

The character ‘%’

%<

The character ‘<’

%|

The character ‘|’

%>

The character ‘>’

%;

The character ‘;’

%#

The character ‘#’

%s

Indicate that the line should scroll. Can occur anywhere in a line (given that the text is displayed; see conditionals above). You can specify up to ten scrolling lines. Scrolling lines can not contain dynamic content such as timers, peak meters or progress bars.