1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Martitz 2009-11-01 13:36:52 +00:00
parent add481bf6d
commit 6db726c147
4 changed files with 15 additions and 15 deletions

View file

@ -53,7 +53,6 @@
#include "viewport.h" #include "viewport.h"
#include "wps_internals.h" #include "wps_internals.h"
#include "wps.h"
#include "root_menu.h" #include "root_menu.h"
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
#include "recording.h" #include "recording.h"
@ -525,7 +524,7 @@ const char *get_token_value(struct gui_wps *gwps,
int mode = 1; /* stop */ int mode = 1; /* stop */
if (status == STATUS_PLAY) if (status == STATUS_PLAY)
mode = 2; /* play */ mode = 2; /* play */
if (is_wps_fading() || if (state->is_fading ||
(status == STATUS_PAUSE && !status_get_ffmode())) (status == STATUS_PAUSE && !status_get_ffmode()))
mode = 3; /* pause */ mode = 3; /* pause */
else else

View file

@ -288,12 +288,13 @@ struct wps_data
and some status infos */ and some status infos */
struct wps_state struct wps_state
{ {
bool ff_rewind;
bool paused;
int ff_rewind_count;
bool wps_time_countup;
struct mp3entry* id3; struct mp3entry* id3;
struct mp3entry* nid3; struct mp3entry* nid3;
int ff_rewind_count;
bool ff_rewind;
bool paused;
bool wps_time_countup;
bool is_fading;
}; };
/* Holds data for all screens in a skin. */ /* Holds data for all screens in a skin. */

View file

@ -159,14 +159,13 @@ void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
#endif #endif
} }
static bool wps_fading_out = false;
void fade(bool fade_in, bool updatewps) void fade(bool fade_in, bool updatewps)
{ {
int fp_global_vol = global_settings.volume << 8; int fp_global_vol = global_settings.volume << 8;
int fp_min_vol = sound_min(SOUND_VOLUME) << 8; int fp_min_vol = sound_min(SOUND_VOLUME) << 8;
int fp_step = (fp_global_vol - fp_min_vol) / 30; int fp_step = (fp_global_vol - fp_min_vol) / 30;
int i; int i;
wps_fading_out = !fade_in; wps_state.is_fading = !fade_in;
if (fade_in) { if (fade_in) {
/* fade in */ /* fade in */
int fp_volume = fp_min_vol; int fp_volume = fp_min_vol;
@ -204,7 +203,7 @@ void fade(bool fade_in, bool updatewps)
sleep(1); sleep(1);
} }
audio_pause(); audio_pause();
wps_fading_out = false; wps_state.is_fading = false;
#if CONFIG_CODEC != SWCODEC #if CONFIG_CODEC != SWCODEC
#ifndef SIMULATOR #ifndef SIMULATOR
/* let audio thread run and wait for the mas to run out of data */ /* 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); sound_set_volume(global_settings.volume);
} }
} }
bool is_wps_fading(void)
{
return wps_fading_out;
}
static bool update_onvol_change(struct gui_wps * gwps) static bool update_onvol_change(struct gui_wps * gwps)
{ {
@ -1305,6 +1300,11 @@ void gui_sync_wps_init(void)
#ifdef IPOD_ACCESSORY_PROTOCOL #ifdef IPOD_ACCESSORY_PROTOCOL
bool is_wps_fading(void)
{
return wps_state.is_fading;
}
int wps_get_ff_rewind_count(void) int wps_get_ff_rewind_count(void)
{ {
return wps_state.ff_rewind_count; return wps_state.ff_rewind_count;

View file

@ -36,9 +36,9 @@ void fade(bool fade_in, bool updatewps);
bool ffwd_rew(int button); bool ffwd_rew(int button);
void display_keylock_text(bool locked); void display_keylock_text(bool locked);
bool is_wps_fading(void);
#ifdef IPOD_ACCESSORY_PROTOCOL #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 */ /* return length of the current ff or rewin action, IAP needs this */
int wps_get_ff_rewind_count(void); int wps_get_ff_rewind_count(void);
#endif /* IPOD_ACCESSORY_PROTOCOL */ #endif /* IPOD_ACCESSORY_PROTOCOL */