diff --git a/apps/playback.c b/apps/playback.c index 045b15bf86..c93dd28071 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -61,6 +61,10 @@ #include "sound.h" #include "metadata.h" #include "talk.h" +#ifdef CONFIG_TUNER +#include "radio.h" +#include "power.h" +#endif static volatile bool audio_codec_loaded; static volatile bool voice_codec_loaded; @@ -1696,6 +1700,13 @@ void audio_thread(void) audio_stop_playback(); paused = false; } + +#ifdef CONFIG_TUNER + /* check if radio is playing */ + if(radio_get_status() != FMRADIO_OFF){ + radio_stop(); + } +#endif logf("starting..."); playing = true; @@ -2081,6 +2092,19 @@ int audio_status(void) return ret; } +void set_audio_status(int status) +{ + if (status & AUDIO_STATUS_PLAY) + playing = true; + else + playing = false; + + if (status & AUDIO_STATUS_PAUSE) + paused = true; + else + paused = false; +} + int audio_get_file_pos(void) { return 0; diff --git a/apps/playback.h b/apps/playback.h index 8128cc2490..4c3f7d1adb 100644 --- a/apps/playback.h +++ b/apps/playback.h @@ -58,6 +58,8 @@ void voice_init(void); extern void audio_next_dir(void); extern void audio_prev_dir(void); +void set_audio_status(int status); + #endif