summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/appevents.h8
-rw-r--r--apps/gui/wps.c5
-rw-r--r--apps/playback.c11
3 files changed, 24 insertions, 0 deletions
diff --git a/apps/appevents.h b/apps/appevents.h
index a303491ae9..36e19b0df7 100644
--- a/apps/appevents.h
+++ b/apps/appevents.h
@@ -31,11 +31,19 @@
31 31
32/** Playback events **/ 32/** Playback events **/
33enum { 33enum {
34 /* Playback is starting from a stopped state */
34 PLAYBACK_EVENT_START_PLAYBACK = (EVENT_CLASS_PLAYBACK|1), 35 PLAYBACK_EVENT_START_PLAYBACK = (EVENT_CLASS_PLAYBACK|1),
36 /* Audio has begun buffering for decoding track (or is already completed) */
35 PLAYBACK_EVENT_TRACK_BUFFER, 37 PLAYBACK_EVENT_TRACK_BUFFER,
38 /* Handles for current user track are ready (other than audio or codec) */
39 PLAYBACK_EVENT_CUR_TRACK_READY,
40 /* Current user track finished */
36 PLAYBACK_EVENT_TRACK_FINISH, 41 PLAYBACK_EVENT_TRACK_FINISH,
42 /* A new current user track has begun */
37 PLAYBACK_EVENT_TRACK_CHANGE, 43 PLAYBACK_EVENT_TRACK_CHANGE,
44 /* A manual skip is about to be processed */
38 PLAYBACK_EVENT_TRACK_SKIP, 45 PLAYBACK_EVENT_TRACK_SKIP,
46 /* Next track medadata was just loaded */
39 PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, 47 PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE,
40}; 48};
41 49
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 0103ace53c..e686fcc533 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -1203,6 +1203,11 @@ static void wps_state_init(void)
1203 /* add the WPS track event callbacks */ 1203 /* add the WPS track event callbacks */
1204 add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback); 1204 add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback);
1205 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, nextid3available_callback); 1205 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, nextid3available_callback);
1206#if CONFIG_CODEC == SWCODEC
1207 /* Use the same callback as ..._TRACK_CHANGE for when remaining handles have
1208 finished */
1209 add_event(PLAYBACK_EVENT_CUR_TRACK_READY, false, track_changed_callback);
1210#endif
1206#ifdef AUDIO_FAST_SKIP_PREVIEW 1211#ifdef AUDIO_FAST_SKIP_PREVIEW
1207 add_event(PLAYBACK_EVENT_TRACK_SKIP, false, track_skip_callback); 1212 add_event(PLAYBACK_EVENT_TRACK_SKIP, false, track_skip_callback);
1208#endif 1213#endif
diff --git a/apps/playback.c b/apps/playback.c
index 2fbc4a85a1..2775e8a95b 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1716,6 +1716,17 @@ static int audio_finish_load_track(struct track_info *info)
1716 } 1716 }
1717#endif 1717#endif
1718 1718
1719 /* All handles available to external routines are ready - audio and codec
1720 information is private */
1721
1722 if (info == track_list_user_current(0))
1723 {
1724 /* Send only when the track handles could not all be opened ahead of
1725 time for the user's current track - otherwise everything is ready
1726 by the time PLAYBACK_EVENT_TRACK_CHANGE is sent */
1727 send_event(PLAYBACK_EVENT_CUR_TRACK_READY, id3_get(PLAYING_ID3));
1728 }
1729
1719#ifdef HAVE_CODEC_BUFFERING 1730#ifdef HAVE_CODEC_BUFFERING
1720 /* Try to buffer a codec for the track */ 1731 /* Try to buffer a codec for the track */
1721 if (info != cur_info && !audio_buffer_codec(info, track_id3)) 1732 if (info != cur_info && !audio_buffer_codec(info, track_id3))