summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2011-03-10 22:25:18 +0000
committerBjörn Stenberg <bjorn@haxx.se>2011-03-10 22:25:18 +0000
commitb8f29c7eed4e776c5014c41a3e5dc680330202b2 (patch)
treeeebc217d1456b8383863ca4cf71c86bf236beaf5
parent4bb24f29216778fab110148b029ed59c768389f7 (diff)
downloadrockbox-b8f29c7eed4e776c5014c41a3e5dc680330202b2.tar.gz
rockbox-b8f29c7eed4e776c5014c41a3e5dc680330202b2.tar.bz2
rockbox-b8f29c7eed4e776c5014c41a3e5dc680330202b2.zip
Quicker fade_on_stop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29558 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/wps.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index b97f6bcf51..a522a08101 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -123,7 +123,7 @@ void fade(bool fade_in, bool updatewps)
{
int fp_global_vol = global_settings.volume << 8;
int fp_min_vol = sound_min(SOUND_VOLUME) << 8;
- int fp_step = (fp_global_vol - fp_min_vol) / 30;
+ int fp_step = (fp_global_vol - fp_min_vol) / 10;
int i;
skin_get_global_state()->is_fading = !fade_in;
if (fade_in) {
@@ -136,14 +136,14 @@ void fade(bool fade_in, bool updatewps)
sleep(HZ/10); /* let audio thread run */
audio_resume();
+ if (updatewps) {
+ FOR_NB_SCREENS(i)
+ skin_update(WPS, i, SKIN_REFRESH_NON_STATIC);
+ }
+
while (fp_volume < fp_global_vol - fp_step) {
fp_volume += fp_step;
sound_set_volume(fp_volume >> 8);
- if (updatewps)
- {
- FOR_NB_SCREENS(i)
- skin_update(WPS, i, SKIN_REFRESH_NON_STATIC);
- }
sleep(1);
}
sound_set_volume(global_settings.volume);
@@ -152,17 +152,18 @@ void fade(bool fade_in, bool updatewps)
/* fade out */
int fp_volume = fp_global_vol;
+ if (updatewps) {
+ FOR_NB_SCREENS(i)
+ skin_update(WPS, i, SKIN_REFRESH_NON_STATIC);
+ }
+
while (fp_volume > fp_min_vol + fp_step) {
fp_volume -= fp_step;
sound_set_volume(fp_volume >> 8);
- if (updatewps)
- {
- FOR_NB_SCREENS(i)
- skin_update(WPS, i, SKIN_REFRESH_NON_STATIC);
- }
sleep(1);
}
audio_pause();
+
skin_get_global_state()->is_fading = false;
#if CONFIG_CODEC != SWCODEC
#ifndef SIMULATOR