diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-02-13 13:17:00 +0100 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-02-14 09:35:49 +0100 |
commit | 7eba7e939b87b6bebc16ddca94f799e46b2b0aae (patch) | |
tree | 085f9f3699404353d9f533c101a181b83bf3d938 /src/ui_act.c | |
parent | a99bfd2480636fed808f22122912f76f3827a65b (diff) | |
download | pianobar-7eba7e939b87b6bebc16ddca94f799e46b2b0aae.tar.gz pianobar-7eba7e939b87b6bebc16ddca94f799e46b2b0aae.tar.bz2 pianobar-7eba7e939b87b6bebc16ddca94f799e46b2b0aae.zip |
New feature: Bookmark song/artist (keybinding 'b')
Diffstat (limited to 'src/ui_act.c')
-rw-r--r-- | src/ui_act.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ui_act.c b/src/ui_act.c index 358029e..80f45c4 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -466,3 +466,25 @@ void BarUiActHistory (BAR_KS_ARGS) { "No history yet.\n"); } } + +/* create song bookmark + */ +void BarUiActBookmark (BAR_KS_ARGS) { + char selectBuf[2]; + PianoReturn_t pRet = PIANO_RET_ERR; + + RETURN_IF_NO_SONG; + + BarUiMsg (MSG_QUESTION, "Bookmark [s]ong or [a]rtist? "); + BarReadline (selectBuf, sizeof (selectBuf), "sa", 1, 0, curFd); + if (selectBuf[0] == 's') { + BarUiMsg (MSG_INFO, "Bookmarking song... "); + pRet = BarUiPrintPianoStatus (PianoBookmarkSong (ph, *curSong)); + BarUiStartEventCmd (settings, "songbookmark", *curStation, *curSong, pRet); + } else if (selectBuf[0] == 'a') { + BarUiMsg (MSG_INFO, "Bookmarking artist... "); + pRet = BarUiPrintPianoStatus (PianoBookmarkArtist (ph, *curSong)); + BarUiStartEventCmd (settings, "artistbookmark", *curStation, *curSong, pRet); + } +} + |