diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-11-22 19:09:54 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-11-22 19:09:54 +0000 |
commit | 49666660628d6c5eab843b296dd3b5f89806c5a6 (patch) | |
tree | 2b4db9f1b07e7a41542ea38c3f8f68c0dca465ba | |
parent | 360d00f6000eb9fe3ee15e86b7bcd991c9758802 (diff) | |
download | rockbox-49666660628d6c5eab843b296dd3b5f89806c5a6.tar.gz rockbox-49666660628d6c5eab843b296dd3b5f89806c5a6.zip |
fix mono recording token,
Add %bu - usb powered token
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23713 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 3 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 14 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.h | 1 |
3 files changed, 14 insertions, 4 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index e0dedd5d48..268ba8c2a5 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -201,6 +201,9 @@ static const struct wps_tag all_tags[] = { | |||
201 | #if CONFIG_CHARGING | 201 | #if CONFIG_CHARGING |
202 | { WPS_TOKEN_BATTERY_CHARGER_CONNECTED,"bp", WPS_REFRESH_DYNAMIC, NULL }, | 202 | { WPS_TOKEN_BATTERY_CHARGER_CONNECTED,"bp", WPS_REFRESH_DYNAMIC, NULL }, |
203 | #endif | 203 | #endif |
204 | #ifdef HAVE_USB_POWER | ||
205 | { WPS_TOKEN_USB_POWERED, "bu", WPS_REFRESH_DYNAMIC, NULL }, | ||
206 | #endif | ||
204 | 207 | ||
205 | { WPS_TOKEN_RTC_PRESENT , "cc", WPS_REFRESH_STATIC, NULL }, | 208 | { WPS_TOKEN_RTC_PRESENT , "cc", WPS_REFRESH_STATIC, NULL }, |
206 | { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, | 209 | { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, |
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 07c1dbeccc..879262f054 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include "pcm_record.h" | 60 | #include "pcm_record.h" |
61 | #endif | 61 | #endif |
62 | #include "language.h" | 62 | #include "language.h" |
63 | #include "usb.h" | ||
63 | 64 | ||
64 | static char* get_codectype(const struct mp3entry* id3) | 65 | static char* get_codectype(const struct mp3entry* id3) |
65 | { | 66 | { |
@@ -547,6 +548,12 @@ const char *get_token_value(struct gui_wps *gwps, | |||
547 | } | 548 | } |
548 | } | 549 | } |
549 | #endif | 550 | #endif |
551 | #ifdef HAVE_USB_POWER | ||
552 | case WPS_TOKEN_USB_POWERED: | ||
553 | if (usb_powered()) | ||
554 | return "u"; | ||
555 | return NULL; | ||
556 | #endif | ||
550 | case WPS_TOKEN_BATTERY_SLEEPTIME: | 557 | case WPS_TOKEN_BATTERY_SLEEPTIME: |
551 | { | 558 | { |
552 | if (get_sleep_timer() == 0) | 559 | if (get_sleep_timer() == 0) |
@@ -1129,10 +1136,9 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1129 | return buf; | 1136 | return buf; |
1130 | #endif | 1137 | #endif |
1131 | case WPS_TOKEN_REC_MONO: | 1138 | case WPS_TOKEN_REC_MONO: |
1132 | if (intval) | 1139 | if (!global_settings.rec_channels) |
1133 | *intval = global_settings.rec_channels?2:1; | 1140 | return "m"; |
1134 | snprintf(buf, buf_size, "%s", !global_settings.rec_channels?"m":'\0'); | 1141 | return NULL; |
1135 | return buf; | ||
1136 | 1142 | ||
1137 | #endif /* HAVE_RECORDING */ | 1143 | #endif /* HAVE_RECORDING */ |
1138 | case WPS_TOKEN_CURRENT_SCREEN: | 1144 | case WPS_TOKEN_CURRENT_SCREEN: |
diff --git a/apps/gui/skin_engine/skin_tokens.h b/apps/gui/skin_engine/skin_tokens.h index a59074fdd7..68a3fde944 100644 --- a/apps/gui/skin_engine/skin_tokens.h +++ b/apps/gui/skin_engine/skin_tokens.h | |||
@@ -61,6 +61,7 @@ enum wps_token_type { | |||
61 | WPS_TOKEN_BATTERY_CHARGER_CONNECTED, | 61 | WPS_TOKEN_BATTERY_CHARGER_CONNECTED, |
62 | WPS_TOKEN_BATTERY_CHARGING, | 62 | WPS_TOKEN_BATTERY_CHARGING, |
63 | WPS_TOKEN_BATTERY_SLEEPTIME, | 63 | WPS_TOKEN_BATTERY_SLEEPTIME, |
64 | WPS_TOKEN_USB_POWERED, | ||
64 | 65 | ||
65 | /* Sound */ | 66 | /* Sound */ |
66 | TOKEN_MARKER_SOUND, | 67 | TOKEN_MARKER_SOUND, |