diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-12-08 08:38:19 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-12-08 08:38:19 +0000 |
| commit | e4b3ce6cb660d77990e4625a5eb6ee1661a63c28 (patch) | |
| tree | b2da2df9fff3d52d10bec50ddbecd7c0dab61c38 | |
| parent | a4a92c378fe26f3d6c68159387b9d10d085bbe47 (diff) | |
| download | rockbox-e4b3ce6cb660d77990e4625a5eb6ee1661a63c28.zip rockbox-e4b3ce6cb660d77990e4625a5eb6ee1661a63c28.tar.gz rockbox-e4b3ce6cb660d77990e4625a5eb6ee1661a63c28.tar.bz2 rockbox-e4b3ce6cb660d77990e4625a5eb6ee1661a63c28.tar.xz | |
Ooops, forgot to adjust 'fade on stop/pause' to dB volume. Sorry for any unpleasant noises.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8200 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/gui/gwps-common.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 307036e..699635d 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -1066,34 +1066,35 @@ static void format_display(struct gui_wps *gwps, char* buf, /* fades the volume */ void fade(bool fade_in) { - unsigned fp_global_vol = global_settings.volume << 8; - unsigned fp_step = fp_global_vol / 30; + 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; if (fade_in) { /* fade in */ - unsigned fp_volume = 0; + int fp_volume = fp_min_vol; /* zero out the sound */ - sound_set_volume(0); + sound_set_volume(fp_min_vol >> 8); sleep(HZ/10); /* let audio thread run */ audio_resume(); - while (fp_volume < fp_global_vol) { + while (fp_volume < fp_global_vol - fp_step) { fp_volume += fp_step; - sleep(1); sound_set_volume(fp_volume >> 8); + sleep(1); } sound_set_volume(global_settings.volume); } else { /* fade out */ - unsigned fp_volume = fp_global_vol; + int fp_volume = fp_global_vol; - while (fp_volume > fp_step) { + while (fp_volume > fp_min_vol + fp_step) { fp_volume -= fp_step; - sleep(1); sound_set_volume(fp_volume >> 8); + sleep(1); } audio_pause(); #ifndef SIMULATOR |