summaryrefslogtreecommitdiff
path: root/apps/iap.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-04-06 00:39:43 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-04-06 00:39:43 +0000
commit843c7efaf8c953fc3bec40a7da0be3a5da9950df (patch)
treecb27e411394f716d26193433c66132072730ea70 /apps/iap.c
parent9188f0ffd7ce97101a5b2d697cc43072cd63b502 (diff)
downloadrockbox-843c7efaf8c953fc3bec40a7da0be3a5da9950df.tar.gz
rockbox-843c7efaf8c953fc3bec40a7da0be3a5da9950df.zip
FS9795 - some playback cleanup.
* Use events to notify things when the track has changed instead of the nasty has_track_changed() * Event for when the mp3entry for the next track is avilable (which allows alot more tags to be static which means less redrawing in the WPS) * virtually guarentee that the mp3entry sturct returned by audio_current/next_track() is going to be valid for the duration of the current track. The only time it wont be now is during the time between the codec finishing the previous track and the next track actually starting (~2s), but this is not an issue as long as it is called again when the TRACK_CHANGED event happens (or just use the pointer that gives) It is still possible to confuse the WPS with the next tracks id3 info being displayed but this should fix itself up faster than it used to (and be harder to do) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20633 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/iap.c')
-rw-r--r--apps/iap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/iap.c b/apps/iap.c
index dd29563b1e..4d0c473800 100644
--- a/apps/iap.c
+++ b/apps/iap.c
@@ -29,6 +29,7 @@
29#include "system.h" 29#include "system.h"
30#include "kernel.h" 30#include "kernel.h"
31#include "serial.h" 31#include "serial.h"
32#include "appevents.h"
32 33
33#include "playlist.h" 34#include "playlist.h"
34#include "playback.h" 35#include "playback.h"
@@ -80,6 +81,7 @@ void iap_setup(int ratenum)
80 iap_setupflag = true; 81 iap_setupflag = true;
81 iap_remotebtn = BUTTON_NONE; 82 iap_remotebtn = BUTTON_NONE;
82 tick_add_task(iap_task); 83 tick_add_task(iap_task);
84 add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, iap_track_changed);
83} 85}
84 86
85void iap_bitrate_set(int ratenum) 87void iap_bitrate_set(int ratenum)
@@ -175,8 +177,10 @@ int iap_getc(unsigned char x)
175 return newpkt; 177 return newpkt;
176} 178}
177 179
178void iap_track_changed(void) 180/* called by playback when the next track starts */
181void iap_track_changed(void *ignored)
179{ 182{
183 (void)ignored;
180 iap_changedctr = 1; 184 iap_changedctr = 1;
181} 185}
182 186