summaryrefslogtreecommitdiffstats
path: root/apps/playback.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-05-31 18:45:51 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-05-31 18:45:51 -0400
commite62cb566448ebb56e2b0ddcaea5fe90532d24488 (patch)
tree6f1ae825066f521890c63cb27a6fdac7124ca845 /apps/playback.c
parent1b4135ec0d572f0e85421051cc855be7c5e516e7 (diff)
downloadrockbox-e62cb566448ebb56e2b0ddcaea5fe90532d24488.tar.gz
rockbox-e62cb566448ebb56e2b0ddcaea5fe90532d24488.tar.bz2
rockbox-e62cb566448ebb56e2b0ddcaea5fe90532d24488.zip
Have voice fire an event when it starts and stops playing.
Further decouples voice_thread.c from other playback areas. Also allows other audio sources, such as FM radio, to be attenuated when voice is playing by implementing a callback. Defined as another playback event rather than a new event class: PLAYBACK_EVENT_VOICE_PLAYING Change-Id: I2e3e218be6cd6bebbf39e7883a8c0e4ed42b62bb
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 870cb08d17..9cc29ea2d8 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -344,6 +344,12 @@ void audio_pcmbuf_sync_position(void);
/**************************************/
+/** --- voice event --- **/
+void playback_voice_event(void *data)
+{
+ pcmbuf_soft_mode(*(bool *)data);
+}
+
/** --- audio_queue helpers --- **/
static void audio_queue_post(long id, intptr_t data)
{
@@ -3760,6 +3766,7 @@ void playback_init(void)
mutex_init(&id3_mutex);
track_list_init();
buffering_init();
+ add_event(PLAYBACK_EVENT_VOICE_PLAYING, false, playback_voice_event);
#ifdef HAVE_CROSSFADE
/* Set crossfade setting for next buffer init which should be about... */
pcmbuf_request_crossfade_enable(global_settings.crossfade);