summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-02-20 10:28:14 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-02-20 10:28:14 +0100
commit3cd104195cd47a216d871acf04ba47fce246cd28 (patch)
treec98b551bd993331597b92799511c7b697b4495d2 /src/ui.c
parent19a5bfdf0eea1e840cd93c99e52b1af5f2647be0 (diff)
downloadpianobar-3cd104195cd47a216d871acf04ba47fce246cd28.tar.gz
pianobar-3cd104195cd47a216d871acf04ba47fce246cd28.tar.bz2
pianobar-3cd104195cd47a216d871acf04ba47fce246cd28.zip
Add song's real station to eventcmd
In case we're playing quickmix. See issue #94.
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui.c b/src/ui.c
index 5df8cdc..0e8f80b 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -602,12 +602,17 @@ void BarUiStartEventCmd (const BarSettings_t *settings, const char *type,
pid_t chld;
char pipeBuf[1024];
int pipeFd[2];
+ PianoStation_t *songStation = NULL;
if (settings->eventCmd == NULL) {
/* nothing to do... */
return;
}
+ if (curSong != NULL && stations != NULL && curStation->isQuickMix) {
+ songStation = PianoFindStationById (stations, curSong->stationId);
+ }
+
/* prepare stdin content */
memset (pipeBuf, 0, sizeof (pipeBuf));
snprintf (pipeBuf, sizeof (pipeBuf),
@@ -616,6 +621,7 @@ void BarUiStartEventCmd (const BarSettings_t *settings, const char *type,
"album=%s\n"
"coverArt=%s\n"
"stationName=%s\n"
+ "songStationName=%s\n"
"pRet=%i\n"
"pRetStr=%s\n"
"wRet=%i\n"
@@ -628,6 +634,7 @@ void BarUiStartEventCmd (const BarSettings_t *settings, const char *type,
curSong == NULL ? "" : curSong->album,
curSong == NULL ? "" : curSong->coverArt,
curStation == NULL ? "" : curStation->name,
+ songStation == NULL ? "" : songStation->name,
pRet,
PianoErrorToStr (pRet),
wRet,