summaryrefslogtreecommitdiff
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.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);
344 344
345/**************************************/ 345/**************************************/
346 346
347/** --- voice event --- **/
348void playback_voice_event(void *data)
349{
350 pcmbuf_soft_mode(*(bool *)data);
351}
352
347/** --- audio_queue helpers --- **/ 353/** --- audio_queue helpers --- **/
348static void audio_queue_post(long id, intptr_t data) 354static void audio_queue_post(long id, intptr_t data)
349{ 355{
@@ -3760,6 +3766,7 @@ void playback_init(void)
3760 mutex_init(&id3_mutex); 3766 mutex_init(&id3_mutex);
3761 track_list_init(); 3767 track_list_init();
3762 buffering_init(); 3768 buffering_init();
3769 add_event(PLAYBACK_EVENT_VOICE_PLAYING, false, playback_voice_event);
3763#ifdef HAVE_CROSSFADE 3770#ifdef HAVE_CROSSFADE
3764 /* Set crossfade setting for next buffer init which should be about... */ 3771 /* Set crossfade setting for next buffer init which should be about... */
3765 pcmbuf_request_crossfade_enable(global_settings.crossfade); 3772 pcmbuf_request_crossfade_enable(global_settings.crossfade);