diff options
author | Javier S. Pedro <javier@javispedro.com> | 2012-02-13 20:16:32 +0100 |
---|---|---|
committer | Javier S. Pedro <javier@javispedro.com> | 2012-02-13 20:16:32 +0100 |
commit | 3fbc3f186f8f7817be2ecbdcc7117bd294bb7d88 (patch) | |
tree | 1c3c04a076c449735e350b196bd21dd0555d6887 /radio.c | |
parent | 178fa8e6707c9983ba02bb1d01f773c63b00732d (diff) | |
download | fmrxd-3fbc3f186f8f7817be2ecbdcc7117bd294bb7d88.tar.gz fmrxd-3fbc3f186f8f7817be2ecbdcc7117bd294bb7d88.zip |
add signal monitoring support
Diffstat (limited to 'radio.c')
-rw-r--r-- | radio.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -34,13 +34,33 @@ void radio_start() g_return_if_fail(!active); g_debug("Starting radio"); - configure_bt_muxer(true); + bool ok; + + ok = configure_bt_muxer(true); + if (!ok) goto fail_start; + configure_mixer(true); + if (!ok) goto fail_start; + configure_tuner(true); + if (!ok) goto fail_start; + configure_capture(true); + if (!ok) goto fail_start; + + // Not essential. + configure_signal(true); configure_rds(true); active = true; + return; // Success + +fail_start: + g_critical("Radio failed to start!"); + + // Try to force a stop + active = true; + radio_stop(); } void radio_stop() @@ -49,6 +69,7 @@ void radio_stop() g_debug("Stopping radio"); configure_rds(false); + configure_signal(false); configure_capture(false); configure_tuner(false); configure_mixer(false); |