forked from len0rd/rockbox
Fix reds for IAP and a missing #include.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22141 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2287dd9daa
commit
cc05424e44
3 changed files with 27 additions and 12 deletions
|
|
@ -1232,3 +1232,11 @@ bool wps_uses_albumart(int *width, int *height)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef IPOD_ACCESSORY_PROTOCOL
|
||||||
|
int wps_get_ff_rewind_count(void)
|
||||||
|
{
|
||||||
|
return wps_state.ff_rewind_count;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,16 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifndef _MUSICSCREEN_H_
|
#ifndef _WPS_H_
|
||||||
#define _MUSICSCREEN_H_
|
#define _WPS_H_
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include "screen_access.h"
|
||||||
|
|
||||||
long gui_wps_show(void);
|
long gui_wps_show(void);
|
||||||
|
|
||||||
|
/* wrapper for the wps to load the skin (.wps/.rwps) files */
|
||||||
|
void wps_data_load(enum screen_type, const char *, bool);
|
||||||
|
void wps_data_init(enum screen_type);
|
||||||
|
|
||||||
void gui_sync_wps_init(void);
|
void gui_sync_wps_init(void);
|
||||||
|
|
||||||
|
|
@ -35,9 +39,6 @@ void display_keylock_text(bool locked);
|
||||||
|
|
||||||
bool is_wps_fading(void);
|
bool is_wps_fading(void);
|
||||||
|
|
||||||
/* wrapper for the wps to load the skin (.wps/.rwps) files */
|
|
||||||
void wps_data_load(enum screen_type, const char *, bool);
|
|
||||||
void wps_data_init(enum screen_type);
|
|
||||||
|
|
||||||
#ifdef HAVE_ALBUMART
|
#ifdef HAVE_ALBUMART
|
||||||
/*
|
/*
|
||||||
|
|
@ -47,4 +48,10 @@ void wps_data_init(enum screen_type);
|
||||||
*/
|
*/
|
||||||
bool wps_uses_albumart(int*, int*);
|
bool wps_uses_albumart(int*, int*);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
#ifdef IPOD_ACCESSORY_PROTOCOL
|
||||||
|
/* return length of the current ff or rewin action, IAP needs this */
|
||||||
|
int wps_get_ff_rewind_count(void);
|
||||||
|
#endif /* IPOD_ACCESSORY_PROTOCOL */
|
||||||
|
|
||||||
|
#endif /* _WPS_H_ */
|
||||||
|
|
|
||||||
10
apps/iap.c
10
apps/iap.c
|
|
@ -36,7 +36,7 @@
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
#include "skin_engine/skin_engine.h"
|
#include "wps.h"
|
||||||
|
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
|
|
||||||
|
|
@ -191,7 +191,7 @@ void iap_periodic(void)
|
||||||
unsigned char data[] = {0x04, 0x00, 0x27, 0x04, 0x00, 0x00, 0x00, 0x00};
|
unsigned char data[] = {0x04, 0x00, 0x27, 0x04, 0x00, 0x00, 0x00, 0x00};
|
||||||
unsigned long time_elapsed = audio_current_track()->elapsed;
|
unsigned long time_elapsed = audio_current_track()->elapsed;
|
||||||
|
|
||||||
time_elapsed += wps_state.ff_rewind_count;
|
time_elapsed += wps_get_ff_rewind_count();
|
||||||
|
|
||||||
data[3] = 0x04; // playing
|
data[3] = 0x04; // playing
|
||||||
|
|
||||||
|
|
@ -685,13 +685,13 @@ void iap_handlepkt(void)
|
||||||
/* Jump to track number in current playlist */
|
/* Jump to track number in current playlist */
|
||||||
case 0x0037:
|
case 0x0037:
|
||||||
{
|
{
|
||||||
|
int paused = (is_wps_fading() || (audio_status() & AUDIO_STATUS_PAUSE));
|
||||||
long tracknum = (signed long)serbuf[4] << 24 |
|
long tracknum = (signed long)serbuf[4] << 24 |
|
||||||
(signed long)serbuf[5] << 16 |
|
(signed long)serbuf[5] << 16 |
|
||||||
(signed long)serbuf[6] << 8 | serbuf[7];
|
(signed long)serbuf[6] << 8 | serbuf[7];
|
||||||
if (!wps_state.paused)
|
audio_pause();
|
||||||
audio_pause();
|
|
||||||
audio_skip(tracknum - playlist_next(0));
|
audio_skip(tracknum - playlist_next(0));
|
||||||
if (!wps_state.paused)
|
if (!paused)
|
||||||
audio_resume();
|
audio_resume();
|
||||||
|
|
||||||
/* respond with cmd ok packet */
|
/* respond with cmd ok packet */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue