Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (Revision 18085) +++ apps/gui/gwps-common.c (Arbeitskopie) @@ -766,13 +766,22 @@ return buf; } +static char *write_int_value(int setting_val_zero_based, int *dst_one_based, + char *buf, int buf_size) +{ + if (dst_one_based) + *dst_one_based = setting_val_zero_based + 1; + snprintf(buf, buf_size, "%d", setting_val_zero_based); + return buf; +} + /* Return the tag found at index i and write its value in buf. The return value is buf if the tag had a value, or NULL if not. intval is used with conditionals/enums: when this function is called, intval should contain the number of options in the conditional/enum. When this function returns, intval is -1 if the tag is non numeric or, - if the tag is numeric, intval is the enum case we want to go to. + if the tag is numeric, intval is the 1-based enum case we want to go to. When not treating a conditional/enum, intval should be NULL. */ static char *get_token_value(struct gui_wps *gwps, @@ -1141,15 +1150,16 @@ } case WPS_TOKEN_REPEAT_MODE: - if (intval) - *intval = global_settings.repeat_mode + 1; - snprintf(buf, buf_size, "%d", *intval); - return buf; + return write_int_value(global_settings.repeat_mode, + intval, buf, buf_size); + + case WPS_TOKEN_SKIP_LENGTH: + return write_int_value(global_settings.skip_length, + intval, buf, buf_size); + case WPS_TOKEN_RTC_12HOUR_CFG: - if (intval) - *intval = global_settings.timeformat + 1; - snprintf(buf, buf_size, "%d", *intval); - return buf; + return write_int_value(global_settings.timeformat, + intval, buf, buf_size); #if CONFIG_RTC case WPS_TOKEN_RTC_DAY_OF_MONTH: /* d: day of month (01..31) */ @@ -1319,10 +1329,8 @@ #if (CONFIG_CODEC == SWCODEC) case WPS_TOKEN_CROSSFADE: - if (intval) - *intval = global_settings.crossfade + 1; - snprintf(buf, buf_size, "%d", global_settings.crossfade); - return buf; + return write_int_value(global_settings.crossfade, + intval, buf, buf_size); case WPS_TOKEN_REPLAYGAIN: { Index: apps/gui/gwps.h =================================================================== --- apps/gui/gwps.h (Revision 18085) +++ apps/gui/gwps.h (Arbeitskopie) @@ -253,6 +253,7 @@ /* Mode */ WPS_TOKEN_REPEAT_MODE, WPS_TOKEN_PLAYBACK_STATUS, + WPS_TOKEN_SKIP_LENGTH, WPS_TOKEN_MAIN_HOLD, Index: apps/gui/wps_parser.c =================================================================== --- apps/gui/wps_parser.c (Revision 18085) +++ apps/gui/wps_parser.c (Arbeitskopie) @@ -268,6 +268,7 @@ { WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL }, { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, + { WPS_TOKEN_SKIP_LENGTH, "ms", WPS_REFRESH_DYNAMIC, NULL }, #ifdef HAVE_LCD_BITMAP { WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL }, Index: apps/settings.h =================================================================== --- apps/settings.h (Revision 18085) +++ apps/settings.h (Arbeitskopie) @@ -740,7 +740,7 @@ int keyclick_repeats; /* keyclick on repeats */ #endif unsigned char playlist_catalog_dir[MAX_FILENAME+1]; - int skip_length; /* skip length */ + int skip_length; /* skip length in minutes. 0=track skip */ #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING int touchpad_sensitivity; #endif Index: manual/appendix/wps_tags.tex =================================================================== --- manual/appendix/wps_tags.tex (Revision 18085) +++ manual/appendix/wps_tags.tex (Arbeitskopie) @@ -165,11 +165,19 @@ \begin{tagmap}{}{} \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause, Fast forward, Rewind\\ + \config{\%ms} & Skip length in minutes (0-15); 0 means ``skip track''\\ \end{tagmap} \end{table} -Example: \config{\%?mp{\textless}Stop{\textbar}Play{\textbar}Pause{\textbar}% +Examples: +\begin{enumerate} +\item Display the current play status as text:\\ +\config{\%?mp{\textless}Stop{\textbar}Play{\textbar}Pause{\textbar}% Ffwd{\textbar}Rew{\textgreater}} +\item Display the skip length in minutes or ``Track'' if it's set to track:\\ +\config{\%?ms{\textless}Track{\textbar}\%ms{\textgreater}} +\end{enumerate} + \section{Images} \begin{table} \begin{tagmap}{}{}