summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2010-12-03 21:49:15 +0100
committerLars-Dominik Braun <lars@6xq.net>2010-12-09 15:48:52 +0100
commit77a064c6563f2c571c0c687eb3bd3bebd3f3a441 (patch)
tree8b8e1ee5c382accf8cb2c020b966710fe239caf7
parenta6340288f8259cc96b5af05bce3612dbf4f9b7e4 (diff)
downloadpianobar-windows-77a064c6563f2c571c0c687eb3bd3bebd3f3a441.tar.gz
pianobar-windows-77a064c6563f2c571c0c687eb3bd3bebd3f3a441.tar.bz2
pianobar-windows-77a064c6563f2c571c0c687eb3bd3bebd3f3a441.zip
History: Add tired keybinding
-rw-r--r--src/ui_act.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/ui_act.c b/src/ui_act.c
index 35bc3ab..679f098 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -466,7 +466,7 @@ BarUiActCallback(BarUiActQuit) {
BarUiActCallback(BarUiActHistory) {
PianoReturn_t pRet;
WaitressReturn_t wRet;
- char selectBuf[2], allowedBuf[3];
+ char selectBuf[2], allowedBuf[4];
PianoSong_t *selectedSong;
if (app->songHistory != NULL) {
@@ -476,16 +476,19 @@ BarUiActCallback(BarUiActHistory) {
/* use user-defined keybindings */
allowedBuf[0] = app->settings.keys[BAR_KS_LOVE];
allowedBuf[1] = app->settings.keys[BAR_KS_BAN];
- allowedBuf[2] = '\0';
+ allowedBuf[2] = app->settings.keys[BAR_KS_TIRED];
+ allowedBuf[3] = '\0';
- BarUiMsg (MSG_QUESTION, "%s - %s: love[%c] or ban[%c]? ",
+ BarUiMsg (MSG_QUESTION, "%s - %s: love[%c], ban[%c] or tired[%c]? ",
selectedSong->artist, selectedSong->title,
app->settings.keys[BAR_KS_LOVE],
- app->settings.keys[BAR_KS_BAN]);
+ app->settings.keys[BAR_KS_BAN],
+ app->settings.keys[BAR_KS_TIRED]);
BarReadline (selectBuf, sizeof (selectBuf), allowedBuf, 1, 0, curFd);
if (selectBuf[0] == app->settings.keys[BAR_KS_LOVE] ||
- selectBuf[0] == app->settings.keys[BAR_KS_BAN]) {
+ selectBuf[0] == app->settings.keys[BAR_KS_BAN] ||
+ selectBuf[0] == app->settings.keys[BAR_KS_TIRED]) {
/* make sure we're transforming the _original_ station (not
* curStation) */
PianoStation_t *songStation =
@@ -523,6 +526,12 @@ BarUiActCallback(BarUiActHistory) {
&reqData);
BarUiStartEventCmd (&app->settings, "songban", songStation,
selectedSong, &app->player, pRet, wRet);
+ } else if (selectBuf[0] == app->settings.keys[BAR_KS_TIRED]) {
+ BarUiMsg (MSG_INFO, "Putting song on shelf... ");
+ BarUiActDefaultPianoCall (PIANO_REQUEST_ADD_TIRED_SONG, selectedSong);
+
+ BarUiStartEventCmd (&app->settings, "songshelf", songStation,
+ selectedSong, &app->player, pRet, wRet);
} /* end if */
} /* end if selectBuf[0] */
} /* end if selectedSong != NULL */