summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
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);
}