diff options
author | waker <wakeroid@gmail.com> | 2009-08-27 20:46:48 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-27 20:46:48 +0200 |
commit | 1266ebad2083550266906b9e6ce37dec18c594bd (patch) | |
tree | 1adab2643e5c7daa0f82126d50c9786aba794a52 | |
parent | 8c9425b1b18bc8f76f9fad25d56bd4d3466fe1e3 (diff) |
new songstarted and song finished event triggering
-rw-r--r-- | playlist.c | 16 | ||||
-rw-r--r-- | plugins/lastfm/lastfm.c | 4 | ||||
-rw-r--r-- | streamer.c | 1 |
3 files changed, 6 insertions, 15 deletions
@@ -585,20 +585,12 @@ pl_set_current (playItem_t *it) { int ret = 0; int from = pl_get_idx_of (playlist_current_ptr); int to = it ? pl_get_idx_of (it) : -1; -#if 0 - // this produces some kind of bug in the beginning of track - if (it == playlist_current_ptr) { - if (it && it->codec) { - codec_lock (); - ret = playlist_current_ptr->codec->seek (0); - codec_unlock (); - } - return ret; + if (playlist_current.codec) { + plug_trigger_event (DB_EV_SONGFINISHED); } -#endif codec_lock (); - if (playlist_current_ptr && playlist_current_ptr->codec) { - playlist_current_ptr->codec->free (); + if (playlist_current.codec) { + playlist_current.codec->free (); } pl_item_free (&playlist_current); playlist_current_ptr = it; diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c index afee5471..926e47de 100644 --- a/plugins/lastfm/lastfm.c +++ b/plugins/lastfm/lastfm.c @@ -249,7 +249,7 @@ lastfm_songstarted (DB_event_song_t *ev, uintptr_t data) { printf ("playtime: %f\nartist: %s\ntitle: %s\nalbum: %s\nduration: %f\ntracknum: %s\n---\n", ev->song->playtime, a, t, b, l, n); } else { - printf ("file %f doesn't have enough tags to submit to last.fm\n", ev->song->fname); + printf ("file %s doesn't have enough tags to submit to last.fm\n", ev->song->fname); } return 0; @@ -268,7 +268,7 @@ lastfm_songfinished (DB_event_song_t *ev, uintptr_t data) { printf ("playtime: %f\nartist: %s\ntitle: %s\nalbum: %s\nduration: %f\ntracknum: %s\n---\n", ev->song->playtime, a, t, b, l, n); } else { - printf ("file %f doesn't have enough tags to submit to last.fm\n", ev->song->fname); + printf ("file %s doesn't have enough tags to submit to last.fm\n", ev->song->fname); } return 0; @@ -96,7 +96,6 @@ streamer_thread (uintptr_t ctx) { badsong = -1; continue; } - plug_trigger_event (DB_EV_SONGFINISHED); int ret = pl_set_current (pl_get_for_idx (sng)); if (ret < 0) { //printf ("bad file in playlist, skipping...\n"); |