Index: apps/gui/skin_engine/skin_parser.c =================================================================== --- apps/gui/skin_engine/skin_parser.c (revision 25677) +++ apps/gui/skin_engine/skin_parser.c (working copy) @@ -349,6 +349,7 @@ #endif { WPS_NO_TOKEN, "s", WPS_REFRESH_SCROLL, NULL }, + { WPS_TOKEN_TIMER, "ta", WPS_REFRESH_DYNAMIC, parse_timeout }, { WPS_TOKEN_SUBLINE_TIMEOUT, "t", 0, parse_timeout }, #ifdef HAVE_LCD_BITMAP @@ -1107,6 +1108,7 @@ switch (token->type) { case WPS_TOKEN_SUBLINE_TIMEOUT: + case WPS_TOKEN_TIMER: return -1; case WPS_TOKEN_BUTTON_VOLUME: case WPS_TOKEN_TRACK_STARTING: @@ -1115,8 +1117,20 @@ break; } } - token->value.i = val; - + if (token->type == WPS_TOKEN_TIMER) + { + struct skintimer * timer = skin_buffer_alloc(sizeof(struct skintimer)); + if (!timer) + return -1; + timer->timeout = val; + timer->last_tick = 0; + timer->value = 0; + token->value.data = (void*)timer; + } + else + { + token->value.i = val; + } return skip; } Index: apps/gui/skin_engine/skin_tokens.c =================================================================== --- apps/gui/skin_engine/skin_tokens.c (revision 25676) +++ apps/gui/skin_engine/skin_tokens.c (working copy) @@ -988,6 +988,20 @@ cfg_to_string(token->value.i,buf,buf_size); return buf; } + case WPS_TOKEN_TIMER: + { + struct skintimer *timer = (struct skintimer *)token->value.data; + if (!intval) + return NULL; + if (TIME_AFTER(current_tick, timer->last_tick + timer->timeout)) + { + timer->value = (timer->value+1)%limit; + timer->last_tick = current_tick; + } + *intval = timer->value; + snprintf(buf, buf_size, "%d", timer->value); + return buf; + } /* Recording tokens */ case WPS_TOKEN_HAVE_RECORDING: #ifdef HAVE_RECORDING Index: apps/gui/skin_engine/skin_tokens.h =================================================================== --- apps/gui/skin_engine/skin_tokens.h (revision 25676) +++ apps/gui/skin_engine/skin_tokens.h (working copy) @@ -196,6 +196,7 @@ WPS_TOKEN_LIST_TITLE_ICON, WPS_TOKEN_BUTTON_VOLUME, WPS_TOKEN_LASTTOUCH, + WPS_TOKEN_TIMER, #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) /* Virtual LED */ WPS_TOKEN_VLED_HDD, Index: apps/gui/skin_engine/wps_internals.h =================================================================== --- apps/gui/skin_engine/wps_internals.h (revision 25677) +++ apps/gui/skin_engine/wps_internals.h (working copy) @@ -249,6 +249,11 @@ } lines[2]; }; +struct skintimer { + int value; + int timeout; + long last_tick; +}; #ifdef HAVE_ALBUMART struct skin_albumart {