diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-08-12 22:36:48 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-08-12 22:36:48 +0200 |
commit | bfda4e40cce3aa986e4fe8d3881a689cd6ef411f (patch) | |
tree | 561b24a1e4f3d54f0cc30c4160322e7a9c4bf74d /src | |
parent | 4878f5911d05af7bfa1917daf984dab0fd07eb42 (diff) | |
download | pianobar-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.tar.gz pianobar-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.tar.bz2 pianobar-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.zip |
Initial "narrative" implementation
"Why did you play this song?"
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 16 | ||||
-rw-r--r-- | src/pianobar.1 | 4 |
2 files changed, 19 insertions, 1 deletions
@@ -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); diff --git a/src/pianobar.1 b/src/pianobar.1 index 5cf9983..bd0db3c 100644 --- a/src/pianobar.1 +++ b/src/pianobar.1 @@ -35,6 +35,10 @@ artist of your choice. Delete current station. .TP +.B e +Explain why this song is played. + +.TP .B g Add genre station provided by pandora. |