summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-04-25 12:01:25 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-04-25 12:01:25 +0000
commit341cb85ac5c5bf5495ba06ac2e006e08f947a9dc (patch)
tree720b13c1217e040c939082d17829b2e7fb43cfd3
parent4902c43ff39b2164f055532cb7c5575fa4383202 (diff)
downloadrockbox-341cb85ac5c5bf5495ba06ac2e006e08f947a9dc.tar.gz
rockbox-341cb85ac5c5bf5495ba06ac2e006e08f947a9dc.zip
Make the buffering screen use the multiscreen API (FS#11143)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25712 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/debug_menu.c101
1 files changed, 57 insertions, 44 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 22ec63abe9..57c750568a 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -287,7 +287,7 @@ static void dbg_audio_task(void)
287static bool dbg_buffering_thread(void) 287static bool dbg_buffering_thread(void)
288{ 288{
289 int button; 289 int button;
290 int line; 290 int line, i;
291 bool done = false; 291 bool done = false;
292 size_t bufused; 292 size_t bufused;
293 size_t bufsize = pcmbuf_get_bufsize(); 293 size_t bufsize = pcmbuf_get_bufsize();
@@ -299,8 +299,10 @@ static bool dbg_buffering_thread(void)
299 ticks = boost_ticks = freq_sum = 0; 299 ticks = boost_ticks = freq_sum = 0;
300 300
301 tick_add_task(dbg_audio_task); 301 tick_add_task(dbg_audio_task);
302 302
303 lcd_setfont(FONT_SYSFIXED); 303 FOR_NB_SCREENS(i)
304 screens[i].setfont(FONT_SYSFIXED);
305
304 while(!done) 306 while(!done)
305 { 307 {
306 button = get_action(CONTEXT_STD,HZ/5); 308 button = get_action(CONTEXT_STD,HZ/5);
@@ -318,72 +320,83 @@ static bool dbg_buffering_thread(void)
318 } 320 }
319 321
320 buffering_get_debugdata(&d); 322 buffering_get_debugdata(&d);
323 bufused = bufsize - pcmbuf_free();
321 324
322 line = 0; 325 FOR_NB_SCREENS(i)
323 lcd_clear_display(); 326 {
327 line = 0;
328 screens[i].clear_display();
324 329
325 bufused = bufsize - pcmbuf_free();
326 330
327 lcd_putsf(0, line++, "pcm: %6ld/%ld", (long) bufused, (long) bufsize); 331 screens[i].putsf(0, line++, "pcm: %6ld/%ld", (long) bufused, (long) bufsize);
328 332
329 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, 333 gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6,
330 bufsize, 0, bufused, HORIZONTAL); 334 bufsize, 0, bufused, HORIZONTAL);
331 line++; 335 line++;
332 336
333 lcd_putsf(0, line++, "alloc: %6ld/%ld", audio_filebufused(), 337 screens[i].putsf(0, line++, "alloc: %6ld/%ld", audio_filebufused(),
334 (long) filebuflen); 338 (long) filebuflen);
335 339
336#if LCD_HEIGHT > 80 340#if LCD_HEIGHT > 80|| REMOTE_LCD_HEIGHT > 80
337 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, 341 if (screens[i].lcdheight > 80)
338 filebuflen, 0, audio_filebufused(), HORIZONTAL); 342 {
339 line++; 343 gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6,
344 filebuflen, 0, audio_filebufused(), HORIZONTAL);
345 line++;
340 346
341 lcd_putsf(0, line++, "real: %6ld/%ld", (long)d.buffered_data, 347 screens[i].putsf(0, line++, "real: %6ld/%ld", (long)d.buffered_data,
342 (long)filebuflen); 348 (long)filebuflen);
343 349
344 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, 350 gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6,
345 filebuflen, 0, (long)d.buffered_data, HORIZONTAL); 351 filebuflen, 0, (long)d.buffered_data, HORIZONTAL);
346 line++; 352 line++;
353 }
347#endif 354#endif
348 355
349 lcd_putsf(0, line++, "usefl: %6ld/%ld", (long)(d.useful_data), 356 screens[i].putsf(0, line++, "usefl: %6ld/%ld", (long)(d.useful_data),
350 (long)filebuflen); 357 (long)filebuflen);
351 358
352#if LCD_HEIGHT > 80 359#if LCD_HEIGHT > 80 || REMOTE_LCD_HEIGHT > 80
353 gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, 360 if (screens[i].lcdheight > 80)
354 filebuflen, 0, d.useful_data, HORIZONTAL); 361 {
355 line++; 362 gui_scrollbar_draw(&screens[i],0, line*8, screens[i].lcdwidth, 6,
363 filebuflen, 0, d.useful_data, HORIZONTAL);
364 line++;
365 }
356#endif 366#endif
357 367
358 lcd_putsf(0, line++, "data_rem: %ld", (long)d.data_rem); 368 screens[i].putsf(0, line++, "data_rem: %ld", (long)d.data_rem);
359 369
360 lcd_putsf(0, line++, "track count: %2d", audio_track_count()); 370 screens[i].putsf(0, line++, "track count: %2d", audio_track_count());
361 371
362 lcd_putsf(0, line++, "handle count: %d", (int)d.num_handles); 372 screens[i].putsf(0, line++, "handle count: %d", (int)d.num_handles);
363 373
364#ifndef SIMULATOR 374#ifndef SIMULATOR
365 lcd_putsf(0, line++, "cpu freq: %3dMHz", 375 screens[i].putsf(0, line++, "cpu freq: %3dMHz",
366 (int)((FREQ + 500000) / 1000000)); 376 (int)((FREQ + 500000) / 1000000));
367#endif 377#endif
368 378
369 if (ticks > 0) 379 if (ticks > 0)
370 { 380 {
371 int boostquota = boost_ticks * 1000 / ticks; /* in 0.1 % */ 381 int boostquota = boost_ticks * 1000 / ticks; /* in 0.1 % */
372 int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */ 382 int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */
373 lcd_putsf(0, line++, "boost:%3d.%d%% (%d.%dMHz)", 383 screens[i].putsf(0, line++, "boost:%3d.%d%% (%d.%dMHz)",
374 boostquota/10, boostquota%10, avgclock/10, avgclock%10); 384 boostquota/10, boostquota%10, avgclock/10, avgclock%10);
375 } 385 }
376 386
377 lcd_putsf(0, line++, "pcmbufdesc: %2d/%2d", 387 screens[i].putsf(0, line++, "pcmbufdesc: %2d/%2d",
378 pcmbuf_used_descs(), pcmbufdescs); 388 pcmbuf_used_descs(), pcmbufdescs);
379 lcd_putsf(0, line++, "watermark: %6d", 389 screens[i].putsf(0, line++, "watermark: %6d",
380 (int)(d.watermark)); 390 (int)(d.watermark));
381 391
382 lcd_update(); 392 screens[i].update();
393 }
383 } 394 }
384 395
385 tick_remove_task(dbg_audio_task); 396 tick_remove_task(dbg_audio_task);
386 lcd_setfont(FONT_UI); 397
398 FOR_NB_SCREENS(i)
399 screens[i].setfont(FONT_UI);
387 400
388 return false; 401 return false;
389} 402}