summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-08-12 22:36:48 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-08-12 22:36:48 +0200
commitbfda4e40cce3aa986e4fe8d3881a689cd6ef411f (patch)
tree561b24a1e4f3d54f0cc30c4160322e7a9c4bf74d /src/main.c
parent4878f5911d05af7bfa1917daf984dab0fd07eb42 (diff)
downloadpianobar-windows-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.tar.gz
pianobar-windows-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.tar.bz2
pianobar-windows-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.zip
Initial "narrative" implementation
"Why did you play this song?"
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 67e9319..a2a169d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -511,7 +511,7 @@ int main (int argc, char **argv) {
/* in the meantime: wait for user actions */
struct pollfd polls = {fileno (stdin), POLLIN, POLLIN};
char buf, yesnoBuf;
- char *lineBuf, *musicId;
+ char *lineBuf, *musicId, *explanation;
PianoStation_t *moveStation;
if (poll (&polls, 1, 1000) > 0) {
@@ -522,6 +522,7 @@ int main (int argc, char **argv) {
"b\tban current song\n"
"c\tcreate new station\n"
"d\tdelete current station\n"
+ "e\texplain why this song is played\n"
"g\tadd genre station\n"
"l\tlove current song\n"
"n\tnext song\n"
@@ -597,6 +598,19 @@ int main (int argc, char **argv) {
}
break;
+ case 'e':
+ if (curSong == NULL) {
+ BarUiMsg ("No song playing.\n");
+ break;
+ }
+ BarUiMsg ("Receiving explanation... ");
+ if (BarUiPrintPianoStatus (PianoExplain (&ph, curSong,
+ &explanation)) == PIANO_RET_OK) {
+ printf ("%s\n", explanation);
+ free (explanation);
+ }
+ break;
+
case 'g':
/* use genre station */
BarStationFromGenre (&ph);