summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-02-16 15:11:36 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-02-16 15:11:36 +0100
commit152c67bb38e71c1b189774beac07008cbc4d1631 (patch)
tree46634617610f2562848a1e1b289c081d80526ff6 /src/main.c
parentcc9fabcf9958d38fcfb61c038ee0770cd3ec61a8 (diff)
downloadpianobar-windows-152c67bb38e71c1b189774beac07008cbc4d1631.tar.gz
pianobar-windows-152c67bb38e71c1b189774beac07008cbc4d1631.tar.bz2
pianobar-windows-152c67bb38e71c1b189774beac07008cbc4d1631.zip
Autostart station setting added
You may define a station that is played when starting pianobar now.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 4f63404..c8a91b2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -110,8 +110,18 @@ int main (int argc, char **argv) {
return 0;
}
- /* select station */
- curStation = BarUiSelectStation (&ph, "Select station: ");
+ /* try to get autostart station */
+ if (settings.autostartStation != NULL) {
+ curStation = PianoFindStationById (ph.stations,
+ settings.autostartStation);
+ if (curStation == NULL) {
+ BarUiMsg ("Error: Autostart station not found.\n");
+ }
+ }
+ /* no autostart? ask the user */
+ if (curStation == NULL) {
+ curStation = BarUiSelectStation (&ph, "Select station: ");
+ }
if (curStation != NULL) {
printf ("Playing station \"%s\"\n", curStation->name);
}