diff options
author | waker <wakeroid@gmail.com> | 2009-08-26 23:23:08 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-26 23:23:08 +0200 |
commit | ad816d21ce318c87d9ef5e11124ad5b56afedd1d (patch) | |
tree | d47b264522f2ce6b5fcef9cf32c16557628ec156 /streamer.c | |
parent | 91c33508d0da3cdb4c521df3cf8c7378dc707a8d (diff) |
lastfm plugin WIP
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -31,6 +31,7 @@ #include "messagepump.h" #include "messages.h" #include "conf.h" +#include "plugins.h" static SRC_STATE *src; static SRC_DATA srcdata; @@ -95,6 +96,7 @@ 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"); @@ -339,6 +341,10 @@ streamer_read (char *bytes, int size) { } streambuffer_fill -= sz; playpos += (float)sz/p_get_rate ()/4.f; + playlist_current.playtime += (float)sz/p_get_rate ()/4.f; + if (playlist_current_ptr) { + playlist_current_ptr->playtime = playlist_current.playtime; + } bytes_until_next_song -= sz; if (bytes_until_next_song < 0) { bytes_until_next_song = 0; |