diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-01-13 06:48:39 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-01-13 06:48:39 +0000 |
commit | 261c56ba59235c2da2aa644fbea0b1fa492bd1c6 (patch) | |
tree | cdf37e93496f9dc3aaf71f45537ff3d5371c074f /apps/gui/skin_engine/skin_tokens.c | |
parent | c8535f27d140a2030cedf695a66595aae5b95c27 (diff) | |
download | rockbox-261c56ba59235c2da2aa644fbea0b1fa492bd1c6.tar.gz rockbox-261c56ba59235c2da2aa644fbea0b1fa492bd1c6.zip |
FS#11867 - Add 2 new tags to allow skins to display themed peakmeters
%pL for the left channel, %pR for the right channel... usable as a value, conditional or bar (exactly the same as %pv/%bl/etc)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29043 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 217835a1e2..c644d5b3aa 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -59,6 +59,7 @@ #include "skin_engine.h" #include "statusbar-skinned.h" #include "root_menu.h" +#include "peakmeter.h" #ifdef HAVE_RECORDING #include "recording.h" #include "pcm_record.h" @@ -1267,6 +1268,23 @@ const char *get_token_value(struct gui_wps *gwps, #endif +#ifdef HAVE_LCD_BITMAP + /* peakmeter */ + case SKIN_TOKEN_PEAKMETER_LEFT: + case SKIN_TOKEN_PEAKMETER_RIGHT: + { + int left, right, val; + peak_meter_current_vals(&left, &right); + val = token->type == SKIN_TOKEN_PEAKMETER_LEFT ? + left : right; + val = peak_meter_scale_value(val, limit==1 ? MAX_PEAK : limit); + if (intval) + *intval = val; + snprintf(buf, buf_size, "%d", val); + data->peak_meter_enabled = true; + return buf; + } +#endif #if (CONFIG_CODEC == SWCODEC) case SKIN_TOKEN_CROSSFADE: |