diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-08-29 20:07:17 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-08-29 20:07:17 +0000 |
commit | 99a0598c284471342fcda1fdcba90d4b666bfbb3 (patch) | |
tree | 83cc502095e87277de770456498d2de6cf8f473b /apps/wps.c | |
parent | 89a8ca4408c3ea34464898b0ce52a0d8351fa323 (diff) | |
download | rockbox-99a0598c284471342fcda1fdcba90d4b666bfbb3.tar.gz rockbox-99a0598c284471342fcda1fdcba90d4b666bfbb3.zip |
Major peakmeter rework: * Changed set/get functions for dbfs mode to bool type. * Removed performance setting, leaving (slightly adapted) high performance mode only. * Refresh rate is always 20 Hz now. * Readout doesn't do an extra (hidden) peek, should allow for slightly better clip detection. * Brought back high performance peakmeter for recording. Peakmeter stops hogging the CPU when the disk is spinning; this is enough to avoid the performance problem when saving data. * Optimisations, code cleanup and code policeing. * (iriver) Reduced CPU load of peakmeter by not calculating excessive overlaps. ** Bumped config block version, so save your settings before upgrading.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps.c')
-rw-r--r-- | apps/wps.c | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/apps/wps.c b/apps/wps.c index bf0283015f..784289ada4 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -391,46 +391,29 @@ long wps_show(void) | |||
391 | #ifdef HAVE_LCD_BITMAP | 391 | #ifdef HAVE_LCD_BITMAP |
392 | /* when the peak meter is enabled we want to have a | 392 | /* when the peak meter is enabled we want to have a |
393 | few extra updates to make it look smooth. On the | 393 | few extra updates to make it look smooth. On the |
394 | other hand we don't want to waste energy if it | 394 | other hand we don't want to waste energy if it |
395 | isn't displayed */ | 395 | isn't displayed */ |
396 | if (peak_meter_enabled) { | 396 | if (peak_meter_enabled) { |
397 | int i; | 397 | long next_refresh = current_tick; |
398 | 398 | long next_big_refresh = current_tick + HZ / 5; | |
399 | /* In high performance mode we read out the mas as | 399 | button = BUTTON_NONE; |
400 | often as we can. There is no sleep for cpu */ | 400 | while (TIME_BEFORE(current_tick, next_big_refresh)) { |
401 | if (global_settings.peak_meter_performance) { | 401 | button = button_get(false); |
402 | long next_refresh = current_tick; | 402 | if (button != BUTTON_NONE) { |
403 | long next_big_refresh = current_tick + HZ / 5; | 403 | break; |
404 | button = BUTTON_NONE; | ||
405 | while (!TIME_AFTER(current_tick, next_big_refresh)) { | ||
406 | button = button_get(false); | ||
407 | if (button != BUTTON_NONE) { | ||
408 | break; | ||
409 | } | ||
410 | peak_meter_peek(); | ||
411 | sleep(1); | ||
412 | |||
413 | if (TIME_AFTER(current_tick, next_refresh)) { | ||
414 | wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER); | ||
415 | next_refresh = current_tick + HZ / peak_meter_fps; | ||
416 | } | ||
417 | } | 404 | } |
418 | } | 405 | peak_meter_peek(); |
419 | 406 | sleep(0); /* Sleep until end of current tick. */ | |
420 | /* In energy saver mode the cpu may sleep a | 407 | |
421 | little bit while waiting for buttons */ | 408 | if (TIME_AFTER(current_tick, next_refresh)) { |
422 | else { | ||
423 | for (i = 0; i < 4; i++) { | ||
424 | button = button_get_w_tmo(HZ / peak_meter_fps); | ||
425 | if (button != 0) { | ||
426 | break; | ||
427 | } | ||
428 | wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER); | 409 | wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER); |
410 | next_refresh += HZ / PEAK_METER_FPS; | ||
429 | } | 411 | } |
430 | } | 412 | } |
431 | } | 413 | |
432 | 414 | } | |
433 | /* The peak meter is disabled | 415 | |
416 | /* The peak meter is disabled | ||
434 | -> no additional screen updates needed */ | 417 | -> no additional screen updates needed */ |
435 | else { | 418 | else { |
436 | button = button_get_w_tmo(HZ/5); | 419 | button = button_get_w_tmo(HZ/5); |