diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-02-16 15:11:36 +0100 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-02-16 15:11:36 +0100 |
commit | 152c67bb38e71c1b189774beac07008cbc4d1631 (patch) | |
tree | 46634617610f2562848a1e1b289c081d80526ff6 /src/main.c | |
parent | cc9fabcf9958d38fcfb61c038ee0770cd3ec61a8 (diff) | |
download | pianobar-152c67bb38e71c1b189774beac07008cbc4d1631.tar.gz pianobar-152c67bb38e71c1b189774beac07008cbc4d1631.tar.bz2 pianobar-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.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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); } |