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.tar.gz
rockbox-e4b3ce6cb660d77990e4625a5eb6ee1661a63c28.zip
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 307036eda4..699635df1d 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,
1066/* fades the volume */ 1066/* fades the volume */
1067void fade(bool fade_in) 1067void fade(bool fade_in)
1068{ 1068{
1069 unsigned fp_global_vol = global_settings.volume << 8; 1069 int fp_global_vol = global_settings.volume << 8;
1070 unsigned fp_step = fp_global_vol / 30; 1070 int fp_min_vol = sound_min(SOUND_VOLUME) << 8;
1071 int fp_step = (fp_global_vol - fp_min_vol) / 30;
1071 1072
1072 if (fade_in) { 1073 if (fade_in) {
1073 /* fade in */ 1074 /* fade in */
1074 unsigned fp_volume = 0; 1075 int fp_volume = fp_min_vol;
1075 1076
1076 /* zero out the sound */ 1077 /* zero out the sound */
1077 sound_set_volume(0); 1078 sound_set_volume(fp_min_vol >> 8);
1078 1079
1079 sleep(HZ/10); /* let audio thread run */ 1080 sleep(HZ/10); /* let audio thread run */
1080 audio_resume(); 1081 audio_resume();
1081 1082
1082 while (fp_volume < fp_global_vol) { 1083 while (fp_volume < fp_global_vol - fp_step) {
1083 fp_volume += fp_step; 1084 fp_volume += fp_step;
1084 sleep(1);
1085 sound_set_volume(fp_volume >> 8); 1085 sound_set_volume(fp_volume >> 8);
1086 sleep(1);
1086 } 1087 }
1087 sound_set_volume(global_settings.volume); 1088 sound_set_volume(global_settings.volume);
1088 } 1089 }
1089 else { 1090 else {
1090 /* fade out */ 1091 /* fade out */
1091 unsigned fp_volume = fp_global_vol; 1092 int fp_volume = fp_global_vol;
1092 1093
1093 while (fp_volume > fp_step) { 1094 while (fp_volume > fp_min_vol + fp_step) {
1094 fp_volume -= fp_step; 1095 fp_volume -= fp_step;
1095 sleep(1);
1096 sound_set_volume(fp_volume >> 8); 1096 sound_set_volume(fp_volume >> 8);
1097 sleep(1);
1097 } 1098 }
1098 audio_pause(); 1099 audio_pause();
1099#ifndef SIMULATOR 1100#ifndef SIMULATOR