summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c3
-rw-r--r--apps/gui/skin_engine/wps_internals.h7
-rw-r--r--apps/gui/wps.c14
-rw-r--r--apps/gui/wps.h4
4 files changed, 14 insertions, 14 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index fad6912336..46adbdc097 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -53,7 +53,6 @@
53#include "viewport.h" 53#include "viewport.h"
54 54
55#include "wps_internals.h" 55#include "wps_internals.h"
56#include "wps.h"
57#include "root_menu.h" 56#include "root_menu.h"
58#ifdef HAVE_RECORDING 57#ifdef HAVE_RECORDING
59#include "recording.h" 58#include "recording.h"
@@ -525,7 +524,7 @@ const char *get_token_value(struct gui_wps *gwps,
525 int mode = 1; /* stop */ 524 int mode = 1; /* stop */
526 if (status == STATUS_PLAY) 525 if (status == STATUS_PLAY)
527 mode = 2; /* play */ 526 mode = 2; /* play */
528 if (is_wps_fading() || 527 if (state->is_fading ||
529 (status == STATUS_PAUSE && !status_get_ffmode())) 528 (status == STATUS_PAUSE && !status_get_ffmode()))
530 mode = 3; /* pause */ 529 mode = 3; /* pause */
531 else 530 else
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index d54b54ff00..8763ef9e3d 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -288,12 +288,13 @@ struct wps_data
288 and some status infos */ 288 and some status infos */
289struct wps_state 289struct wps_state
290{ 290{
291 struct mp3entry* id3;
292 struct mp3entry* nid3;
293 int ff_rewind_count;
291 bool ff_rewind; 294 bool ff_rewind;
292 bool paused; 295 bool paused;
293 int ff_rewind_count;
294 bool wps_time_countup; 296 bool wps_time_countup;
295 struct mp3entry* id3; 297 bool is_fading;
296 struct mp3entry* nid3;
297}; 298};
298 299
299/* Holds data for all screens in a skin. */ 300/* Holds data for all screens in a skin. */
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 0cfa92cd63..646f6b4003 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -159,14 +159,13 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
159#endif 159#endif
160} 160}
161 161
162static bool wps_fading_out = false;
163void fade(bool fade_in, bool updatewps) 162void fade(bool fade_in, bool updatewps)
164{ 163{
165 int fp_global_vol = global_settings.volume << 8; 164 int fp_global_vol = global_settings.volume << 8;
166 int fp_min_vol = sound_min(SOUND_VOLUME) << 8; 165 int fp_min_vol = sound_min(SOUND_VOLUME) << 8;
167 int fp_step = (fp_global_vol - fp_min_vol) / 30; 166 int fp_step = (fp_global_vol - fp_min_vol) / 30;
168 int i; 167 int i;
169 wps_fading_out = !fade_in; 168 wps_state.is_fading = !fade_in;
170 if (fade_in) { 169 if (fade_in) {
171 /* fade in */ 170 /* fade in */
172 int fp_volume = fp_min_vol; 171 int fp_volume = fp_min_vol;
@@ -204,7 +203,7 @@ void fade(bool fade_in, bool updatewps)
204 sleep(1); 203 sleep(1);
205 } 204 }
206 audio_pause(); 205 audio_pause();
207 wps_fading_out = false; 206 wps_state.is_fading = false;
208#if CONFIG_CODEC != SWCODEC 207#if CONFIG_CODEC != SWCODEC
209#ifndef SIMULATOR 208#ifndef SIMULATOR
210 /* let audio thread run and wait for the mas to run out of data */ 209 /* let audio thread run and wait for the mas to run out of data */
@@ -217,10 +216,6 @@ void fade(bool fade_in, bool updatewps)
217 sound_set_volume(global_settings.volume); 216 sound_set_volume(global_settings.volume);
218 } 217 }
219} 218}
220bool is_wps_fading(void)
221{
222 return wps_fading_out;
223}
224 219
225static bool update_onvol_change(struct gui_wps * gwps) 220static bool update_onvol_change(struct gui_wps * gwps)
226{ 221{
@@ -1305,6 +1300,11 @@ void gui_sync_wps_init(void)
1305 1300
1306 1301
1307#ifdef IPOD_ACCESSORY_PROTOCOL 1302#ifdef IPOD_ACCESSORY_PROTOCOL
1303bool is_wps_fading(void)
1304{
1305 return wps_state.is_fading;
1306}
1307
1308int wps_get_ff_rewind_count(void) 1308int wps_get_ff_rewind_count(void)
1309{ 1309{
1310 return wps_state.ff_rewind_count; 1310 return wps_state.ff_rewind_count;
diff --git a/apps/gui/wps.h b/apps/gui/wps.h
index 8c6de9e2fc..1ba974cf04 100644
--- a/apps/gui/wps.h
+++ b/apps/gui/wps.h
@@ -36,9 +36,9 @@ void fade(bool fade_in, bool updatewps);
36bool ffwd_rew(int button); 36bool ffwd_rew(int button);
37void display_keylock_text(bool locked); 37void display_keylock_text(bool locked);
38 38
39bool is_wps_fading(void);
40
41#ifdef IPOD_ACCESSORY_PROTOCOL 39#ifdef IPOD_ACCESSORY_PROTOCOL
40/* whether the wps is fading the volume due to pausing/stopping */
41bool is_wps_fading(void);
42/* return length of the current ff or rewin action, IAP needs this */ 42/* return length of the current ff or rewin action, IAP needs this */
43int wps_get_ff_rewind_count(void); 43int wps_get_ff_rewind_count(void);
44#endif /* IPOD_ACCESSORY_PROTOCOL */ 44#endif /* IPOD_ACCESSORY_PROTOCOL */