summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-11-01 13:36:52 +0000
committerThomas Martitz <kugel@rockbox.org>2009-11-01 13:36:52 +0000
commit6db726c147624c4b2f9d80603e9d4f46cb9cd5e3 (patch)
tree945f3167ddf8b34eeede4ed788a4c5f07f2cf0d8
parentadd481bf6d80514953b683f74d3091828e634126 (diff)
Remove a wps function call from skin engine, hopefully the last one.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23461 a1c6a512-1295-4272-9138-f99709370657
-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 @@
#include "viewport.h"
#include "wps_internals.h"
-#include "wps.h"
#include "root_menu.h"
#ifdef HAVE_RECORDING
#include "recording.h"
@@ -525,7 +524,7 @@ const char *get_token_value(struct gui_wps *gwps,
int mode = 1; /* stop */
if (status == STATUS_PLAY)
mode = 2; /* play */
- if (is_wps_fading() ||
+ if (state->is_fading ||
(status == STATUS_PAUSE && !status_get_ffmode()))
mode = 3; /* pause */
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
and some status infos */
struct wps_state
{
+ struct mp3entry* id3;
+ struct mp3entry* nid3;
+ int ff_rewind_count;
bool ff_rewind;
bool paused;
- int ff_rewind_count;
bool wps_time_countup;
- struct mp3entry* id3;
- struct mp3entry* nid3;
+ bool is_fading;
};
/* 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)
#endif
}
-static bool wps_fading_out = false;
void fade(bool fade_in, bool updatewps)
{
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;
int i;
- wps_fading_out = !fade_in;
+ wps_state.is_fading = !fade_in;
if (fade_in) {
/* fade in */
int fp_volume = fp_min_vol;
@@ -204,7 +203,7 @@ void fade(bool fade_in, bool updatewps)
sleep(1);
}
audio_pause();
- wps_fading_out = false;
+ wps_state.is_fading = false;
#if CONFIG_CODEC != SWCODEC
#ifndef SIMULATOR
/* 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)
sound_set_volume(global_settings.volume);
}
}
-bool is_wps_fading(void)
-{
- return wps_fading_out;
-}
static bool update_onvol_change(struct gui_wps * gwps)
{
@@ -1305,6 +1300,11 @@ void gui_sync_wps_init(void)
#ifdef IPOD_ACCESSORY_PROTOCOL
+bool is_wps_fading(void)
+{
+ return wps_state.is_fading;
+}
+
int wps_get_ff_rewind_count(void)
{
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);
bool ffwd_rew(int button);
void display_keylock_text(bool locked);
-bool is_wps_fading(void);
-
#ifdef IPOD_ACCESSORY_PROTOCOL
+/* whether the wps is fading the volume due to pausing/stopping */
+bool is_wps_fading(void);
/* return length of the current ff or rewin action, IAP needs this */
int wps_get_ff_rewind_count(void);
#endif /* IPOD_ACCESSORY_PROTOCOL */