diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-15 11:22:44 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-15 11:22:44 +0000 |
commit | 23bca7e400a9ca5ae26abdae30508485047a058c (patch) | |
tree | 7526bb89c50d947baad6e5f7d1055df4ab85487d /apps/gui | |
parent | 3d30be85577b81489ff3231c1c8b639f132863a4 (diff) | |
download | rockbox-23bca7e400a9ca5ae26abdae30508485047a058c.tar.gz rockbox-23bca7e400a9ca5ae26abdae30508485047a058c.zip |
fix FS#5821 and FS#8449 - WPS isnt updated during fade, play status isnt changed to pause fast enough.
not sure if this is the best fix, wondering why fade() is handled by the wps code and not playback....
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17723 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/gwps-common.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 0498b83e7e..b90c216f58 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -82,12 +82,14 @@ static void gui_wps_statusbar_draw(struct gui_wps *wps, bool force) | |||
82 | #include "pcmbuf.h" | 82 | #include "pcmbuf.h" |
83 | 83 | ||
84 | /* fades the volume */ | 84 | /* fades the volume */ |
85 | bool wps_fading_out = false; | ||
85 | void fade(bool fade_in) | 86 | void fade(bool fade_in) |
86 | { | 87 | { |
87 | int fp_global_vol = global_settings.volume << 8; | 88 | int fp_global_vol = global_settings.volume << 8; |
88 | int fp_min_vol = sound_min(SOUND_VOLUME) << 8; | 89 | int fp_min_vol = sound_min(SOUND_VOLUME) << 8; |
89 | int fp_step = (fp_global_vol - fp_min_vol) / 30; | 90 | int fp_step = (fp_global_vol - fp_min_vol) / 30; |
90 | 91 | int i; | |
92 | wps_fading_out = !fade_in; | ||
91 | if (fade_in) { | 93 | if (fade_in) { |
92 | /* fade in */ | 94 | /* fade in */ |
93 | int fp_volume = fp_min_vol; | 95 | int fp_volume = fp_min_vol; |
@@ -101,6 +103,8 @@ void fade(bool fade_in) | |||
101 | while (fp_volume < fp_global_vol - fp_step) { | 103 | while (fp_volume < fp_global_vol - fp_step) { |
102 | fp_volume += fp_step; | 104 | fp_volume += fp_step; |
103 | sound_set_volume(fp_volume >> 8); | 105 | sound_set_volume(fp_volume >> 8); |
106 | FOR_NB_SCREENS(i) | ||
107 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); | ||
104 | sleep(1); | 108 | sleep(1); |
105 | } | 109 | } |
106 | sound_set_volume(global_settings.volume); | 110 | sound_set_volume(global_settings.volume); |
@@ -112,10 +116,12 @@ void fade(bool fade_in) | |||
112 | while (fp_volume > fp_min_vol + fp_step) { | 116 | while (fp_volume > fp_min_vol + fp_step) { |
113 | fp_volume -= fp_step; | 117 | fp_volume -= fp_step; |
114 | sound_set_volume(fp_volume >> 8); | 118 | sound_set_volume(fp_volume >> 8); |
119 | FOR_NB_SCREENS(i) | ||
120 | gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); | ||
115 | sleep(1); | 121 | sleep(1); |
116 | } | 122 | } |
117 | audio_pause(); | 123 | audio_pause(); |
118 | 124 | wps_fading_out = false; | |
119 | #if CONFIG_CODEC != SWCODEC | 125 | #if CONFIG_CODEC != SWCODEC |
120 | #ifndef SIMULATOR | 126 | #ifndef SIMULATOR |
121 | /* let audio thread run and wait for the mas to run out of data */ | 127 | /* let audio thread run and wait for the mas to run out of data */ |
@@ -1139,7 +1145,8 @@ static char *get_token_value(struct gui_wps *gwps, | |||
1139 | int mode = 1; | 1145 | int mode = 1; |
1140 | if (status == AUDIO_STATUS_PLAY) | 1146 | if (status == AUDIO_STATUS_PLAY) |
1141 | mode = 2; | 1147 | mode = 2; |
1142 | if (status & AUDIO_STATUS_PAUSE && !status_get_ffmode()) | 1148 | if (wps_fading_out || |
1149 | (status & AUDIO_STATUS_PAUSE && !status_get_ffmode())) | ||
1143 | mode = 3; | 1150 | mode = 3; |
1144 | if (status_get_ffmode() == STATUS_FASTFORWARD) | 1151 | if (status_get_ffmode() == STATUS_FASTFORWARD) |
1145 | mode = 4; | 1152 | mode = 4; |