From 0621afad493800fcd5e4303c07d40cbdfe8df837 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 9 Nov 2009 04:46:19 +0000 Subject: Add a bunch of markers into the tokens enum to make figuring out which token isnt in the bugout output easier. ("FIXME code(80)" is alot worse than "FIXME: TOKEN_MARKER_SOUND+5") Also, slightly reorder the enum to group misc items together git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23573 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_tokens.h | 63 ++++++++++++++++++++++---------------- apps/gui/skin_engine/wps_debug.c | 36 ++++++++++++++++++++-- 2 files changed, 70 insertions(+), 29 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/skin_engine/skin_tokens.h b/apps/gui/skin_engine/skin_tokens.h index 31546b8cf6..901cd883a6 100644 --- a/apps/gui/skin_engine/skin_tokens.h +++ b/apps/gui/skin_engine/skin_tokens.h @@ -24,9 +24,11 @@ #include - + enum wps_token_type { - WPS_NO_TOKEN, /* for WPS tags we don't want to save as tokens */ + + TOKEN_MARKER_CONTROL_TOKENS = -1, + WPS_NO_TOKEN = 0, /* for WPS tags we don't want to save as tokens */ WPS_TOKEN_UNKNOWN, /* Markers */ @@ -41,8 +43,18 @@ enum wps_token_type { /* Sublines */ WPS_TOKEN_SUBLINE_TIMEOUT, + + /* Conditional */ + WPS_TOKEN_CONDITIONAL, + WPS_TOKEN_CONDITIONAL_START, + WPS_TOKEN_CONDITIONAL_OPTION, + WPS_TOKEN_CONDITIONAL_END, + /* Viewport display */ + WPS_VIEWPORT_ENABLE, + /* Battery */ + TOKEN_MARKER_BATTERY, WPS_TOKEN_BATTERY_PERCENT, WPS_TOKEN_BATTERY_VOLTS, WPS_TOKEN_BATTERY_TIME, @@ -51,6 +63,7 @@ enum wps_token_type { WPS_TOKEN_BATTERY_SLEEPTIME, /* Sound */ + TOKEN_MARKER_SOUND, #if (CONFIG_CODEC != MAS3507D) WPS_TOKEN_SOUND_PITCH, #endif @@ -60,7 +73,7 @@ enum wps_token_type { #endif /* Time */ - + TOKEN_MARKER_RTC, WPS_TOKEN_RTC_PRESENT, /* The begin/end values allow us to know if a token is an RTC one. @@ -89,13 +102,8 @@ enum wps_token_type { WPS_TOKENS_RTC_END, /* just the end marker, not an actual token */ - /* Conditional */ - WPS_TOKEN_CONDITIONAL, - WPS_TOKEN_CONDITIONAL_START, - WPS_TOKEN_CONDITIONAL_OPTION, - WPS_TOKEN_CONDITIONAL_END, - /* Database */ + TOKEN_MARKER_DATABASE, #ifdef HAVE_TAGCACHE WPS_TOKEN_DATABASE_PLAYCOUNT, WPS_TOKEN_DATABASE_RATING, @@ -103,6 +111,7 @@ enum wps_token_type { #endif /* File */ + TOKEN_MARKER_FILE, WPS_TOKEN_FILE_BITRATE, WPS_TOKEN_FILE_CODEC, WPS_TOKEN_FILE_FREQUENCY, @@ -116,6 +125,7 @@ enum wps_token_type { #ifdef HAVE_LCD_BITMAP /* Image */ + TOKEN_MARKER_IMAGES, WPS_TOKEN_IMAGE_BACKDROP, WPS_TOKEN_IMAGE_PROGRESS_BAR, WPS_TOKEN_IMAGE_PRELOAD, @@ -130,6 +140,7 @@ enum wps_token_type { #endif /* Metadata */ + TOKEN_MARKER_METADATA, WPS_TOKEN_METADATA_ARTIST, WPS_TOKEN_METADATA_COMPOSER, WPS_TOKEN_METADATA_ALBUM_ARTIST, @@ -143,30 +154,20 @@ enum wps_token_type { WPS_TOKEN_METADATA_YEAR, WPS_TOKEN_METADATA_COMMENT, + TOKEN_MARKER_PLAYBACK_INFO, /* Mode */ WPS_TOKEN_REPEAT_MODE, WPS_TOKEN_PLAYBACK_STATUS, - - WPS_TOKEN_MAIN_HOLD, - -#ifdef HAS_REMOTE_BUTTON_HOLD - WPS_TOKEN_REMOTE_HOLD, -#endif - /* Progressbar */ WPS_TOKEN_PROGRESSBAR, #ifdef HAVE_LCD_CHARCELLS WPS_TOKEN_PLAYER_PROGRESSBAR, #endif - #ifdef HAVE_LCD_BITMAP /* Peakmeter */ WPS_TOKEN_PEAKMETER, #endif - /* Volume level */ - WPS_TOKEN_VOLUME, - /* Current track */ WPS_TOKEN_TRACK_ELAPSED_PERCENT, WPS_TOKEN_TRACK_TIME_ELAPSED, @@ -174,32 +175,42 @@ enum wps_token_type { WPS_TOKEN_TRACK_LENGTH, /* Playlist */ + TOKEN_MARKER_PLAYLIST, WPS_TOKEN_PLAYLIST_ENTRIES, WPS_TOKEN_PLAYLIST_NAME, WPS_TOKEN_PLAYLIST_POSITION, WPS_TOKEN_PLAYLIST_SHUFFLE, -#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) - /* Virtual LED */ - WPS_TOKEN_VLED_HDD, -#endif - /* Viewport display */ - WPS_VIEWPORT_ENABLE, /* buttons */ + TOKEN_MARKER_MISC, WPS_TOKEN_BUTTON_VOLUME, WPS_TOKEN_LASTTOUCH, +#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) + /* Virtual LED */ + WPS_TOKEN_VLED_HDD, +#endif + /* Volume level */ + WPS_TOKEN_VOLUME, + /* hold */ + WPS_TOKEN_MAIN_HOLD, +#ifdef HAS_REMOTE_BUTTON_HOLD + WPS_TOKEN_REMOTE_HOLD, +#endif /* Setting option */ WPS_TOKEN_SETTING, WPS_TOKEN_CURRENT_SCREEN, /* Recording Tokens */ + TOKEN_MARKER_RECORDING, WPS_TOKEN_HAVE_RECORDING, WPS_TOKEN_REC_FREQ, WPS_TOKEN_REC_ENCODER, WPS_TOKEN_REC_BITRATE, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */ WPS_TOKEN_REC_MONO, + + TOKEN_MARKER_END, /* this needs to be the last value in this enum */ }; struct wps_token { diff --git a/apps/gui/skin_engine/wps_debug.c b/apps/gui/skin_engine/wps_debug.c index 86f929ad23..7d485f2c50 100644 --- a/apps/gui/skin_engine/wps_debug.c +++ b/apps/gui/skin_engine/wps_debug.c @@ -42,6 +42,29 @@ extern bool debug_wps; extern int wps_verbose_level; #endif +struct debug_token_table +{ + enum wps_token_type start_marker; + char *desc; +}; +#define X(name) name, #name +struct debug_token_table tokens[] = { + { X(TOKEN_MARKER_CONTROL_TOKENS) }, + { X(TOKEN_MARKER_BATTERY) }, + { X(TOKEN_MARKER_SOUND) }, + { X(TOKEN_MARKER_RTC) }, + { X(TOKEN_MARKER_DATABASE) }, + { X(TOKEN_MARKER_FILE) }, + { X(TOKEN_MARKER_IMAGES) }, + { X(TOKEN_MARKER_METADATA) }, + { X(TOKEN_MARKER_PLAYBACK_INFO) }, + { X(TOKEN_MARKER_PLAYLIST) }, + { X(TOKEN_MARKER_MISC) }, + { X(TOKEN_MARKER_RECORDING) }, + { X(TOKEN_MARKER_END) }, +}; +#undef X + static char *next_str(bool next) { return next ? "next " : ""; } @@ -49,11 +72,11 @@ static char *next_str(bool next) { static char *get_token_desc(struct wps_token *token, char *buf, int bufsize, struct wps_data *data) { + unsigned i; #ifndef HAVE_LCD_BITMAP (void)data; /* kill charcell warning */ #endif bool next = token->next; - switch(token->type) { case WPS_NO_TOKEN: @@ -468,8 +491,15 @@ static char *get_token_desc(struct wps_token *token, char *buf, settings[token->value.i].cfg_name); break; default: - snprintf(buf, bufsize, "FIXME (code: %d)", - token->type); + for(i=1; itype < tokens[i].start_marker) + { + snprintf(buf, bufsize, "FIXME: %s + %d\n", tokens[i-1].desc, + token->type - tokens[i-1].start_marker); + break; + } + } break; } -- cgit v1.2.3