diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-12 16:43:28 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-12 16:44:25 +0200 |
commit | c5819e14350678efc1e2415191848e87f0f21f85 (patch) | |
tree | f4296a3f2275f5aa695dd626aa13027cfe36ca47 /src | |
parent | 6d199669a9276053ee709210539b75435e19fa3c (diff) | |
parent | 682cd6f7d4dbd3b2d18a7b8c9e375f4143559fcd (diff) | |
download | pianobar-windows-c5819e14350678efc1e2415191848e87f0f21f85.tar.gz pianobar-windows-c5819e14350678efc1e2415191848e87f0f21f85.tar.bz2 pianobar-windows-c5819e14350678efc1e2415191848e87f0f21f85.zip |
Merge branch 'deletestation'
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -274,7 +274,7 @@ int main (int argc, char **argv) { /* in the meantime: wait for user actions */ while (!player.finishedPlayback) { struct pollfd polls = {fileno (stdin), POLLIN, POLLIN}; - char buf; + char buf, yesnoBuf; char *lineBuf; if (poll (&polls, 1, 1000) > 0) { @@ -296,6 +296,23 @@ int main (int argc, char **argv) { PianoDestroyPlaylist (&ph); break; + case 'd': + printf ("Really delete \"%s\"? [yn]\n", + curStation->name); + read (fileno (stdin), &yesnoBuf, sizeof (yesnoBuf)); + if (yesnoBuf == 'y') { + if (PianoDeleteStation (&ph, curStation) == + PIANO_RET_OK) { + player.doQuit = 1; + printf ("Deleted.\n"); + PianoDestroyPlaylist (&ph); + curStation = selectStation (&ph); + } else { + printf ("Error while deleting station.\n"); + } + } + break; + case 'l': if (curSong->rating == PIANO_RATE_LOVE) { printf ("Already loved. No need to do this twice.\n"); |