From ed2240e0990236bf50d795ac86a2dfad05e1a086 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 5 Mar 2010 12:38:03 +0100 Subject: Added song length and rating to eventcmd, new songfinish event --- src/ui.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index 7fd4bba..53fea6c 100644 --- a/src/ui.c +++ b/src/ui.c @@ -377,7 +377,7 @@ inline void BarUiPrintSong (PianoSong_t *song, PianoStation_t *station) { */ void BarUiStartEventCmd (const BarSettings_t *settings, const char *type, const PianoStation_t *curStation, const PianoSong_t *curSong, - PianoReturn_t pRet) { + const struct audioPlayer *player, PianoReturn_t pRet) { pid_t chld; char pipeBuf[1024]; int pipeFd[2]; @@ -395,13 +395,20 @@ void BarUiStartEventCmd (const BarSettings_t *settings, const char *type, "album=%s\n" "stationName=%s\n" "pRet=%i\n" - "pRetStr=%s\n", + "pRetStr=%s\n" + "songDuration=%lu\n" + "songPlayed=%lu\n" + "rating=%i\n", curSong == NULL ? "" : curSong->artist, curSong == NULL ? "" : curSong->title, curSong == NULL ? "" : curSong->album, curStation == NULL ? "" : curStation->name, pRet, - PianoErrorToStr (pRet)); + PianoErrorToStr (pRet), + player->songDuration, + player->songPlayed, + curSong == NULL ? PIANO_RATE_NONE : curSong->rating + ); if (pipe (pipeFd) == -1) { BarUiMsg (MSG_ERR, "Cannot create eventcmd pipe. (%s)\n", strerror (errno)); -- cgit v1.2.3