summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-12-08 08:38:19 +0000
committerJens Arnold <amiconn@rockbox.org>2005-12-08 08:38:19 +0000
commite4b3ce6cb660d77990e4625a5eb6ee1661a63c28 (patch)
treeb2da2df9fff3d52d10bec50ddbecd7c0dab61c38
parenta4a92c378fe26f3d6c68159387b9d10d085bbe47 (diff)
downloadrockbox-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.c19
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