fix mono recording token,

Add %bu - usb powered token


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23713 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2009-11-22 19:09:54 +00:00
parent 360d00f600
commit 4966666062
3 changed files with 14 additions and 4 deletions

View file

@ -201,6 +201,9 @@ static const struct wps_tag all_tags[] = {
#if CONFIG_CHARGING
{ WPS_TOKEN_BATTERY_CHARGER_CONNECTED,"bp", WPS_REFRESH_DYNAMIC, NULL },
#endif
#ifdef HAVE_USB_POWER
{ WPS_TOKEN_USB_POWERED, "bu", WPS_REFRESH_DYNAMIC, NULL },
#endif
{ WPS_TOKEN_RTC_PRESENT , "cc", WPS_REFRESH_STATIC, NULL },
{ WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL },

View file

@ -60,6 +60,7 @@
#include "pcm_record.h"
#endif
#include "language.h"
#include "usb.h"
static char* get_codectype(const struct mp3entry* id3)
{
@ -546,6 +547,12 @@ const char *get_token_value(struct gui_wps *gwps,
return NULL;
}
}
#endif
#ifdef HAVE_USB_POWER
case WPS_TOKEN_USB_POWERED:
if (usb_powered())
return "u";
return NULL;
#endif
case WPS_TOKEN_BATTERY_SLEEPTIME:
{
@ -1129,10 +1136,9 @@ const char *get_token_value(struct gui_wps *gwps,
return buf;
#endif
case WPS_TOKEN_REC_MONO:
if (intval)
*intval = global_settings.rec_channels?2:1;
snprintf(buf, buf_size, "%s", !global_settings.rec_channels?"m":'\0');
return buf;
if (!global_settings.rec_channels)
return "m";
return NULL;
#endif /* HAVE_RECORDING */
case WPS_TOKEN_CURRENT_SCREEN:

View file

@ -61,6 +61,7 @@ enum wps_token_type {
WPS_TOKEN_BATTERY_CHARGER_CONNECTED,
WPS_TOKEN_BATTERY_CHARGING,
WPS_TOKEN_BATTERY_SLEEPTIME,
WPS_TOKEN_USB_POWERED,
/* Sound */
TOKEN_MARKER_SOUND,