summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-03 15:46:21 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-03 15:46:21 +0000
commitcc05424e4456fc9fa3eba49b97bf1406d540b3c3 (patch)
tree504378cb4a1a57cb4b1f65b56048430e1d2fad3b
parent2287dd9daaf62e8624755c41f2a0571c5b9d3357 (diff)
downloadrockbox-cc05424e4456fc9fa3eba49b97bf1406d540b3c3.tar.gz
rockbox-cc05424e4456fc9fa3eba49b97bf1406d540b3c3.zip
Fix reds for IAP and a missing #include.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22141 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/wps.c8
-rw-r--r--apps/gui/wps.h21
-rw-r--r--apps/iap.c10
3 files changed, 27 insertions, 12 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 447c1d6b00..d62507e0b0 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -1232,3 +1232,11 @@ bool wps_uses_albumart(int *width, int *height)
1232 return false; 1232 return false;
1233} 1233}
1234#endif 1234#endif
1235
1236
1237#ifdef IPOD_ACCESSORY_PROTOCOL
1238int wps_get_ff_rewind_count(void)
1239{
1240 return wps_state.ff_rewind_count;
1241}
1242#endif
diff --git a/apps/gui/wps.h b/apps/gui/wps.h
index b8cb7d2ffa..f2f44859ca 100644
--- a/apps/gui/wps.h
+++ b/apps/gui/wps.h
@@ -18,13 +18,17 @@
18 * KIND, either express or implied. 18 * KIND, either express or implied.
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#ifndef _MUSICSCREEN_H_ 21#ifndef _WPS_H_
22#define _MUSICSCREEN_H_ 22#define _WPS_H_
23#include <stdbool.h> 23#include <stdbool.h>
24#include "screen_access.h"
24 25
25long gui_wps_show(void); 26long gui_wps_show(void);
26 27
27 28/* wrapper for the wps to load the skin (.wps/.rwps) files */
29void wps_data_load(enum screen_type, const char *, bool);
30void wps_data_init(enum screen_type);
31
28void gui_sync_wps_init(void); 32void gui_sync_wps_init(void);
29 33
30/* fades the volume, e.g. on pause or stop */ 34/* fades the volume, e.g. on pause or stop */
@@ -35,9 +39,6 @@ void display_keylock_text(bool locked);
35 39
36bool is_wps_fading(void); 40bool is_wps_fading(void);
37 41
38/* wrapper for the wps to load the skin (.wps/.rwps) files */
39void wps_data_load(enum screen_type, const char *, bool);
40void wps_data_init(enum screen_type);
41 42
42#ifdef HAVE_ALBUMART 43#ifdef HAVE_ALBUMART
43/* 44/*
@@ -47,4 +48,10 @@ void wps_data_init(enum screen_type);
47 */ 48 */
48bool wps_uses_albumart(int*, int*); 49bool wps_uses_albumart(int*, int*);
49#endif 50#endif
50#endif 51
52#ifdef IPOD_ACCESSORY_PROTOCOL
53/* return length of the current ff or rewin action, IAP needs this */
54int wps_get_ff_rewind_count(void);
55#endif /* IPOD_ACCESSORY_PROTOCOL */
56
57#endif /* _WPS_H_ */
diff --git a/apps/iap.c b/apps/iap.c
index 8dfef9516f..1d351ab1ea 100644
--- a/apps/iap.c
+++ b/apps/iap.c
@@ -36,7 +36,7 @@
36#include "audio.h" 36#include "audio.h"
37#include "settings.h" 37#include "settings.h"
38#include "metadata.h" 38#include "metadata.h"
39#include "skin_engine/skin_engine.h" 39#include "wps.h"
40 40
41#include "action.h" 41#include "action.h"
42 42
@@ -191,7 +191,7 @@ void iap_periodic(void)
191 unsigned char data[] = {0x04, 0x00, 0x27, 0x04, 0x00, 0x00, 0x00, 0x00}; 191 unsigned char data[] = {0x04, 0x00, 0x27, 0x04, 0x00, 0x00, 0x00, 0x00};
192 unsigned long time_elapsed = audio_current_track()->elapsed; 192 unsigned long time_elapsed = audio_current_track()->elapsed;
193 193
194 time_elapsed += wps_state.ff_rewind_count; 194 time_elapsed += wps_get_ff_rewind_count();
195 195
196 data[3] = 0x04; // playing 196 data[3] = 0x04; // playing
197 197
@@ -685,13 +685,13 @@ void iap_handlepkt(void)
685 /* Jump to track number in current playlist */ 685 /* Jump to track number in current playlist */
686 case 0x0037: 686 case 0x0037:
687 { 687 {
688 int paused = (is_wps_fading() || (audio_status() & AUDIO_STATUS_PAUSE));
688 long tracknum = (signed long)serbuf[4] << 24 | 689 long tracknum = (signed long)serbuf[4] << 24 |
689 (signed long)serbuf[5] << 16 | 690 (signed long)serbuf[5] << 16 |
690 (signed long)serbuf[6] << 8 | serbuf[7]; 691 (signed long)serbuf[6] << 8 | serbuf[7];
691 if (!wps_state.paused) 692 audio_pause();
692 audio_pause();
693 audio_skip(tracknum - playlist_next(0)); 693 audio_skip(tracknum - playlist_next(0));
694 if (!wps_state.paused) 694 if (!paused)
695 audio_resume(); 695 audio_resume();
696 696
697 /* respond with cmd ok packet */ 697 /* respond with cmd ok packet */