skin: add new %pP tag (playlist progress as percentage)

This new tag returns the position in the playlist as a percent. The main usecase for this is to use it as a bar tag, allowing themes to visually present playlist progress.

Change-Id: I0eb001e7458d97b8a0db39f3980d9c283bc8806b
This commit is contained in:
Arin Kim 2026-01-13 16:41:55 +01:00 committed by Solomon Peachy
parent 1c429e2209
commit 41d5ca3c48
8 changed files with 35 additions and 1 deletions

View file

@ -163,6 +163,7 @@ static const struct tag_info legal_tags[] =
TAG(SKIN_TOKEN_TRACK_STARTING, "pS" , "|D", SKIN_REFRESH_DYNAMIC),
TAG(SKIN_TOKEN_TRACK_ENDING, "pE" , "|D", SKIN_REFRESH_DYNAMIC),
TAG(SKIN_TOKEN_PLAYLIST_POSITION, "pp", "", SKIN_REFRESH_STATIC),
TAG(SKIN_TOKEN_PLAYLIST_PERCENT, "pP", BAR_PARAMS, SKIN_REFRESH_STATIC),
TAG(SKIN_TOKEN_PLAYLIST_ENTRIES, "pe", "", SKIN_REFRESH_STATIC),
TAG(SKIN_TOKEN_PLAYLIST_NAME, "pn", "", SKIN_REFRESH_STATIC),
TAG(SKIN_TOKEN_PLAYLIST_SHUFFLE, "ps", "", SKIN_REFRESH_DYNAMIC),
@ -329,3 +330,4 @@ const struct tag_info* find_tag(const char *name)
}
return tag;
}

View file

@ -211,6 +211,8 @@ enum skin_token_type {
SKIN_TOKEN_PLAYLIST_ENTRIES,
SKIN_TOKEN_PLAYLIST_NAME,
SKIN_TOKEN_PLAYLIST_POSITION,
SKIN_TOKEN_PLAYLIST_PERCENT,
SKIN_TOKEN_PLAYLIST_PERCENTBAR,
SKIN_TOKEN_PLAYLIST_SHUFFLE,