From 3dbb3a271df502322bdaeec529fd0aec3f9b4b1d Mon Sep 17 00:00:00 2001 From: Anton Oleynikov Date: Sun, 13 Nov 2005 10:57:35 +0000 Subject: [PATCH] iRiver: fix for audio kept on while playing a file + new function to set audio status (to be used later) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7838 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 24 ++++++++++++++++++++++++ apps/playback.h | 2 ++ 2 files changed, 26 insertions(+) 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