From 19c6e66c1353993659ee007a6c1792a6b0b7ba13 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sun, 16 Mar 2008 13:55:16 +0000 Subject: 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 --- apps/scrobbler.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'apps/scrobbler.c') 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) } else { cache_pos++; if (!scrobbler_ata_callback) - scrobbler_ata_callback = register_ata_idle_func(scrobbler_flush_callback); + { + register_ata_idle_func(scrobbler_flush_callback); + scrobbler_ata_callback = true; + } } } @@ -224,11 +227,7 @@ int scrobbler_init(void) scrobbler_cache = buffer_alloc(SCROBBLER_MAX_CACHE*SCROBBLER_CACHE_LEN); -#if CONFIG_CODEC == SWCODEC - playback_add_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); -#else - audio_set_track_changed_event(&scrobbler_change_event); -#endif + add_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); cache_pos = 0; pending = false; scrobbler_initialised = true; @@ -263,11 +262,7 @@ void scrobbler_shutdown(void) if (scrobbler_initialised) { -#if CONFIG_CODEC == SWCODEC - playback_remove_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); -#else - audio_set_track_changed_event(NULL); -#endif + remove_event(PLAYBACK_EVENT_TRACK_CHANGE, scrobbler_change_event); scrobbler_initialised = false; } } -- cgit v1.2.3