From a2b6703a369f6cdbfec1f150c408dadc877631fb Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 29 Jun 2011 06:37:04 +0000 Subject: Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/wps.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'apps/gui/wps.c') diff --git a/apps/gui/wps.c b/apps/gui/wps.c index e686fcc533..cbf003adbd 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -121,9 +121,11 @@ char* wps_default_skin(enum screen_type screen) void pause_action(bool may_fade, bool updatewps) { +#if CONFIG_CODEC != SWCODEC if (may_fade && global_settings.fade_on_stop) fade(false, updatewps); else +#endif audio_pause(); if (global_settings.pause_rewind) { @@ -136,16 +138,22 @@ void pause_action(bool may_fade, bool updatewps) - global_settings.pause_rewind * 1000; audio_ff_rewind(newpos > 0 ? newpos : 0); } + + (void)may_fade; (void)updatewps; } void unpause_action(bool may_fade, bool updatewps) { +#if CONFIG_CODEC != SWCODEC if (may_fade && global_settings.fade_on_stop) fade(true, updatewps); else +#endif audio_resume(); + (void)may_fade; (void)updatewps; } +#if CONFIG_CODEC != SWCODEC void fade(bool fade_in, bool updatewps) { int fp_global_vol = global_settings.volume << 8; @@ -204,6 +212,7 @@ void fade(bool fade_in, bool updatewps) sound_set_volume(global_settings.volume); } } +#endif /* SWCODEC */ static bool update_onvol_change(enum screen_type screen) { @@ -569,7 +578,7 @@ static void play_hop(int direction) { #if CONFIG_CODEC == SWCODEC if(global_settings.beep) - pcmbuf_beep(1000, 150, 1500*global_settings.beep); + beep_play(1000, 150, 1500*global_settings.beep); #endif return; } @@ -1127,9 +1136,12 @@ long gui_wps_show(void) status_set_record(false); status_set_audio(false); #endif +#if CONFIG_CODEC != SWCODEC if (global_settings.fade_on_stop) fade(false, true); - +#else + audio_pause(); +#endif if (bookmark) bookmark_autobookmark(true); audio_stop(); -- cgit v1.2.3