From 152c67bb38e71c1b189774beac07008cbc4d1631 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 16 Feb 2009 15:11:36 +0100 Subject: Autostart station setting added You may define a station that is played when starting pianobar now. --- src/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main.c') 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); } -- cgit v1.2.3