diff options
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r-- | apps/gui/wps.c | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 80522d04bd..48d9e0912e 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -119,14 +119,28 @@ char* wps_default_skin(enum screen_type screen) | |||
119 | return skin_buf[screen]; | 119 | return skin_buf[screen]; |
120 | } | 120 | } |
121 | 121 | ||
122 | static void update_non_static(void) | ||
123 | { | ||
124 | int i; | ||
125 | FOR_NB_SCREENS(i) | ||
126 | skin_update(WPS, i, SKIN_REFRESH_NON_STATIC); | ||
127 | } | ||
128 | |||
122 | void pause_action(bool may_fade, bool updatewps) | 129 | void pause_action(bool may_fade, bool updatewps) |
123 | { | 130 | { |
124 | #if CONFIG_CODEC != SWCODEC | 131 | #if CONFIG_CODEC == SWCODEC |
132 | /* Do audio first, then update, unless skin were to use its local | ||
133 | status in which case, reverse it */ | ||
134 | audio_pause(); | ||
135 | |||
136 | if (updatewps) | ||
137 | update_non_static(); | ||
138 | #else | ||
125 | if (may_fade && global_settings.fade_on_stop) | 139 | if (may_fade && global_settings.fade_on_stop) |
126 | fade(false, updatewps); | 140 | fade(false, updatewps); |
127 | else | 141 | else |
128 | #endif | ||
129 | audio_pause(); | 142 | audio_pause(); |
143 | #endif | ||
130 | 144 | ||
131 | if (global_settings.pause_rewind) { | 145 | if (global_settings.pause_rewind) { |
132 | long newpos; | 146 | long newpos; |
@@ -139,18 +153,26 @@ void pause_action(bool may_fade, bool updatewps) | |||
139 | audio_ff_rewind(newpos > 0 ? newpos : 0); | 153 | audio_ff_rewind(newpos > 0 ? newpos : 0); |
140 | } | 154 | } |
141 | 155 | ||
142 | (void)may_fade; (void)updatewps; | 156 | (void)may_fade; |
143 | } | 157 | } |
144 | 158 | ||
145 | void unpause_action(bool may_fade, bool updatewps) | 159 | void unpause_action(bool may_fade, bool updatewps) |
146 | { | 160 | { |
147 | #if CONFIG_CODEC != SWCODEC | 161 | #if CONFIG_CODEC == SWCODEC |
162 | /* Do audio first, then update, unless skin were to use its local | ||
163 | status in which case, reverse it */ | ||
164 | audio_resume(); | ||
165 | |||
166 | if (updatewps) | ||
167 | update_non_static(); | ||
168 | #else | ||
148 | if (may_fade && global_settings.fade_on_stop) | 169 | if (may_fade && global_settings.fade_on_stop) |
149 | fade(true, updatewps); | 170 | fade(true, updatewps); |
150 | else | 171 | else |
151 | #endif | ||
152 | audio_resume(); | 172 | audio_resume(); |
153 | (void)may_fade; (void)updatewps; | 173 | #endif |
174 | |||
175 | (void)may_fade; | ||
154 | } | 176 | } |
155 | 177 | ||
156 | #if CONFIG_CODEC != SWCODEC | 178 | #if CONFIG_CODEC != SWCODEC |
@@ -159,7 +181,7 @@ void fade(bool fade_in, bool updatewps) | |||
159 | int fp_global_vol = global_settings.volume << 8; | 181 | int fp_global_vol = global_settings.volume << 8; |
160 | int fp_min_vol = sound_min(SOUND_VOLUME) << 8; | 182 | int fp_min_vol = sound_min(SOUND_VOLUME) << 8; |
161 | int fp_step = (fp_global_vol - fp_min_vol) / 10; | 183 | int fp_step = (fp_global_vol - fp_min_vol) / 10; |
162 | int i; | 184 | |
163 | skin_get_global_state()->is_fading = !fade_in; | 185 | skin_get_global_state()->is_fading = !fade_in; |
164 | if (fade_in) { | 186 | if (fade_in) { |
165 | /* fade in */ | 187 | /* fade in */ |
@@ -171,10 +193,8 @@ void fade(bool fade_in, bool updatewps) | |||
171 | sleep(HZ/10); /* let audio thread run */ | 193 | sleep(HZ/10); /* let audio thread run */ |
172 | audio_resume(); | 194 | audio_resume(); |
173 | 195 | ||
174 | if (updatewps) { | 196 | if (updatewps) |
175 | FOR_NB_SCREENS(i) | 197 | update_non_static(); |
176 | skin_update(WPS, i, SKIN_REFRESH_NON_STATIC); | ||
177 | } | ||
178 | 198 | ||
179 | while (fp_volume < fp_global_vol - fp_step) { | 199 | while (fp_volume < fp_global_vol - fp_step) { |
180 | fp_volume += fp_step; | 200 | fp_volume += fp_step; |
@@ -187,10 +207,8 @@ void fade(bool fade_in, bool updatewps) | |||
187 | /* fade out */ | 207 | /* fade out */ |
188 | int fp_volume = fp_global_vol; | 208 | int fp_volume = fp_global_vol; |
189 | 209 | ||
190 | if (updatewps) { | 210 | if (updatewps) |
191 | FOR_NB_SCREENS(i) | 211 | update_non_static(); |
192 | skin_update(WPS, i, SKIN_REFRESH_NON_STATIC); | ||
193 | } | ||
194 | 212 | ||
195 | while (fp_volume > fp_min_vol + fp_step) { | 213 | while (fp_volume > fp_min_vol + fp_step) { |
196 | fp_volume -= fp_step; | 214 | fp_volume -= fp_step; |
@@ -1140,6 +1158,7 @@ long gui_wps_show(void) | |||
1140 | fade(false, true); | 1158 | fade(false, true); |
1141 | #else | 1159 | #else |
1142 | audio_pause(); | 1160 | audio_pause(); |
1161 | update_non_static(); | ||
1143 | #endif | 1162 | #endif |
1144 | if (bookmark) | 1163 | if (bookmark) |
1145 | bookmark_autobookmark(true); | 1164 | bookmark_autobookmark(true); |