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 @@ | |||
59 | #include "skin_engine.h" | 59 | #include "skin_engine.h" |
60 | #include "statusbar-skinned.h" | 60 | #include "statusbar-skinned.h" |
61 | #include "root_menu.h" | 61 | #include "root_menu.h" |
62 | #include "peakmeter.h" | ||
62 | #ifdef HAVE_RECORDING | 63 | #ifdef HAVE_RECORDING |
63 | #include "recording.h" | 64 | #include "recording.h" |
64 | #include "pcm_record.h" | 65 | #include "pcm_record.h" |
@@ -1267,6 +1268,23 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1267 | #endif | 1268 | #endif |
1268 | 1269 | ||
1269 | 1270 | ||
1271 | #ifdef HAVE_LCD_BITMAP | ||
1272 | /* peakmeter */ | ||
1273 | case SKIN_TOKEN_PEAKMETER_LEFT: | ||
1274 | case SKIN_TOKEN_PEAKMETER_RIGHT: | ||
1275 | { | ||
1276 | int left, right, val; | ||
1277 | peak_meter_current_vals(&left, &right); | ||
1278 | val = token->type == SKIN_TOKEN_PEAKMETER_LEFT ? | ||
1279 | left : right; | ||
1280 | val = peak_meter_scale_value(val, limit==1 ? MAX_PEAK : limit); | ||
1281 | if (intval) | ||
1282 | *intval = val; | ||
1283 | snprintf(buf, buf_size, "%d", val); | ||
1284 | data->peak_meter_enabled = true; | ||
1285 | return buf; | ||
1286 | } | ||
1287 | #endif | ||
1270 | 1288 | ||
1271 | #if (CONFIG_CODEC == SWCODEC) | 1289 | #if (CONFIG_CODEC == SWCODEC) |
1272 | case SKIN_TOKEN_CROSSFADE: | 1290 | case SKIN_TOKEN_CROSSFADE: |