From a711635a5a031107da3ecc0b0e1c939277e34572 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 2 Jul 2008 20:46:38 +0200 Subject: client: Initial quickmix station selection support --- src/main.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 8a96129..744c731 100644 --- a/src/main.c +++ b/src/main.c @@ -85,7 +85,8 @@ PianoStation_t *BarUiSelectStation (PianoHandle_t *ph) { printf ("which station do you want to listen to?\n"); curStation = ph->stations; while (curStation != NULL) { - printf ("%2i) %s\n", i, curStation->name); + printf ("%2i) %s%s\n", i, curStation->name, + curStation->useQuickMix ? " (QuickMix)" : ""); curStation = curStation->next; i++; } @@ -376,7 +377,8 @@ int main (int argc, char **argv) { "r\trename current station\n" "s\tchange station\n" "t\ttired (ban song for 1 month)\n" - "u\tupcoming songs\n"); + "u\tupcoming songs\n" + "x\tselect quickmix stations\n"); break; case 'a': @@ -562,6 +564,24 @@ int main (int argc, char **argv) { nextSong = nextSong->next; } break; + + case 'x': + if (curStation->isQuickMix) { + PianoStation_t *selStation; + while ((selStation = + BarUiSelectStation (&ph)) != NULL) { + selStation->useQuickMix = !selStation->useQuickMix; + } + BarUiMsg ("Setting quickmix stations... "); + if (PianoSetQuickmix (&ph) == PIANO_RET_OK) { + BarUiMsg ("Ok.\n"); + } else { + BarUiMsg ("Error.\n"); + } + } else { + BarUiMsg ("Not a QuickMix station.\n"); + } + break; } /* end case */ } /* end poll */ -- cgit v1.2.3