summaryrefslogtreecommitdiff
path: root/apps/menus/main_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus/main_menu.c')
-rw-r--r--apps/menus/main_menu.c54
1 files changed, 18 insertions, 36 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 033f7e2675..132eab9960 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -50,6 +50,7 @@
50#include "version.h" 50#include "version.h"
51#include "time.h" 51#include "time.h"
52#include "wps.h" 52#include "wps.h"
53#include "skin_engine/skin_buffer.h"
53 54
54static const struct browse_folder_info config = {ROCKBOX_DIR, SHOW_CFG}; 55static const struct browse_folder_info config = {ROCKBOX_DIR, SHOW_CFG};
55 56
@@ -144,9 +145,7 @@ enum infoscreenorder
144 INFO_DISK1, /* capacity or internal capacity/free on hotswap */ 145 INFO_DISK1, /* capacity or internal capacity/free on hotswap */
145 INFO_DISK2, /* free space or external capacity/free on hotswap */ 146 INFO_DISK2, /* free space or external capacity/free on hotswap */
146 INFO_BUFFER, 147 INFO_BUFFER,
147#ifdef HAVE_ALBUMART 148 INFO_SKIN_USAGE, /* ram usage of the skins */
148 INFO_ALBUMART,
149#endif
150 INFO_VERSION, 149 INFO_VERSION,
151 INFO_COUNT 150 INFO_COUNT
152}; 151};
@@ -158,6 +157,13 @@ static const unsigned char *kbyte_units[] =
158 ID2P(LANG_GIGABYTE) 157 ID2P(LANG_GIGABYTE)
159}; 158};
160 159
160static const unsigned char *byte_units[] =
161{
162 ID2P(LANG_BYTE),
163 ID2P(LANG_KILOBYTE),
164 ID2P(LANG_MEGABYTE)
165};
166
161static char* info_getname(int selected_item, void *data, 167static char* info_getname(int selected_item, void *data,
162 char *buffer, size_t buffer_len) 168 char *buffer, size_t buffer_len)
163{ 169{
@@ -250,22 +256,10 @@ static char* info_getname(int selected_item, void *data,
250 snprintf(buffer, buffer_len, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); 256 snprintf(buffer, buffer_len, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1);
251#endif 257#endif
252 break; 258 break;
253#ifdef HAVE_ALBUMART 259 case INFO_SKIN_USAGE:
254 case INFO_ALBUMART: /* album art dimenstions */ 260 output_dyn_value(s1, sizeof s1, skin_buffer_usage(), byte_units, true);
255 { 261 snprintf(buffer, buffer_len, "%s %s", str(LANG_SKIN_RAM_USAGE), s1);
256 int width = 0, height = 0; 262 break;
257 if (wps_uses_albumart(&width, &height))
258 {
259 snprintf(buffer, buffer_len, "%s %dx%d", str(LANG_ALBUMART),
260 width, height);
261 }
262 else
263 {
264 snprintf(buffer, buffer_len, "%s %s", str(LANG_ALBUMART),
265 str(LANG_SET_BOOL_NO));
266 }
267 } break;
268#endif
269 } 263 }
270 return buffer; 264 return buffer;
271} 265}
@@ -347,23 +341,11 @@ static int info_speak_item(int selected_item, void * data)
347 output_dyn_value(NULL, 0, info->size, kbyte_units, true); 341 output_dyn_value(NULL, 0, info->size, kbyte_units, true);
348#endif 342#endif
349 break; 343 break;
350#ifdef HAVE_ALBUMART 344 case INFO_SKIN_USAGE:
351 case INFO_ALBUMART: /* album art dimenstions */ 345 talk_id(LANG_SKIN_RAM_USAGE, false);
352 { 346 output_dyn_value(NULL, 0, skin_buffer_usage(), byte_units, true);
353 int width = 0, height = 0; 347 break;
354 if (wps_uses_albumart(&width, &height)) 348
355 {
356 talk_id(LANG_ALBUMART, false);
357 talk_value(width, UNIT_PIXEL, true);
358 talk_value(height, UNIT_PIXEL, true);
359 }
360 else
361 {
362 talk_id(LANG_ALBUMART, false);
363 talk_id(LANG_SET_BOOL_NO, true);
364 }
365 } break;
366#endif
367 } 349 }
368 return 0; 350 return 0;
369} 351}