diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2008-03-16 13:55:16 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2008-03-16 13:55:16 +0000 |
commit | 19c6e66c1353993659ee007a6c1792a6b0b7ba13 (patch) | |
tree | 1dd7f88282b2e543fb5b22458fcb2f3bf1c7eb80 /apps/scrobbler.c | |
parent | 478ba0afa11061a620e44cd9cc60debd955b1b33 (diff) | |
download | rockbox-19c6e66c1353993659ee007a6c1792a6b0b7ba13.tar.gz rockbox-19c6e66c1353993659ee007a6c1792a6b0b7ba13.zip |
Implement the playback event handling as a system-wide multi-purpose event system. Unified mpeg.c and playback.c audio event handling. Converted ata_idle_notify to use the new event handling system also.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16682 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/scrobbler.c')
-rw-r--r-- | apps/scrobbler.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/apps/scrobbler.c b/apps/scrobbler.c index 16869bf18f..2f60e858e1 100644 --- a/apps/scrobbler.c +++ b/apps/scrobbler.c | |||
@@ -183,7 +183,10 @@ static void add_to_cache(unsigned long play_length) | |||
183 | } else { | 183 | } else { |
184 | cache_pos++; | 184 | cache_pos++; |
185 | if (!scrobbler_ata_callback) | 185 | if (!scrobbler_ata_callback) |
186 | scrobbler_ata_callback = register_ata_idle_func(scrobbler_flush_callback); | 186 | { |
187 | register_ata_idle_func(scrobbler_flush_callback); | ||
188 | scrobbler_ata_callback = true; | ||
189 | } | ||
187 | } | 190 | } |
188 | 191 | ||
189 | } | 192 | } |
@@ -224,11 +227,7 @@ int scrobbler_init(void) | |||
224 | 227 | ||
225 | scrobbler_cache = buffer_alloc(SCROBBLER_MAX_CACHE*SCROBBLER_CACHE_LEN); | 228 | scrobbler_cache = buffer_alloc(SCROBBLER_MAX_CACHE*SCROBBLER_CACHE_LEN); |
226 | 229 | ||
227 | #if CONFIG_CODEC == SWCODEC | 230 | add_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); |
228 | playback_add_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); | ||
229 | #else | ||
230 | audio_set_track_changed_event(&scrobbler_change_event); | ||
231 | #endif | ||
232 | cache_pos = 0; | 231 | cache_pos = 0; |
233 | pending = false; | 232 | pending = false; |
234 | scrobbler_initialised = true; | 233 | scrobbler_initialised = true; |
@@ -263,11 +262,7 @@ void scrobbler_shutdown(void) | |||
263 | 262 | ||
264 | if (scrobbler_initialised) | 263 | if (scrobbler_initialised) |
265 | { | 264 | { |
266 | #if CONFIG_CODEC == SWCODEC | 265 | remove_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); |
267 | playback_remove_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); | ||
268 | #else | ||
269 | audio_set_track_changed_event(NULL); | ||
270 | #endif | ||
271 | scrobbler_initialised = false; | 266 | scrobbler_initialised = false; |
272 | } | 267 | } |
273 | } | 268 | } |