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
This commit is contained in:
Anton Oleynikov 2005-11-13 10:57:35 +00:00
parent 0c0534e297
commit 3dbb3a271d
2 changed files with 26 additions and 0 deletions

View file

@ -61,6 +61,10 @@
#include "sound.h" #include "sound.h"
#include "metadata.h" #include "metadata.h"
#include "talk.h" #include "talk.h"
#ifdef CONFIG_TUNER
#include "radio.h"
#include "power.h"
#endif
static volatile bool audio_codec_loaded; static volatile bool audio_codec_loaded;
static volatile bool voice_codec_loaded; static volatile bool voice_codec_loaded;
@ -1696,6 +1700,13 @@ void audio_thread(void)
audio_stop_playback(); audio_stop_playback();
paused = false; paused = false;
} }
#ifdef CONFIG_TUNER
/* check if radio is playing */
if(radio_get_status() != FMRADIO_OFF){
radio_stop();
}
#endif
logf("starting..."); logf("starting...");
playing = true; playing = true;
@ -2081,6 +2092,19 @@ int audio_status(void)
return ret; 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) int audio_get_file_pos(void)
{ {
return 0; return 0;

View file

@ -58,6 +58,8 @@ void voice_init(void);
extern void audio_next_dir(void); extern void audio_next_dir(void);
extern void audio_prev_dir(void); extern void audio_prev_dir(void);
void set_audio_status(int status);
#endif #endif