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 --- firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c') diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c index 01b177da6c..eea4c58e4b 100644 --- a/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c +++ b/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c @@ -99,14 +99,15 @@ void TIMER3(void) INTPND = TIMER3_MASK; } -void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) +void beep_play(unsigned int frequency, unsigned int duration, + unsigned int amplitude) { #define TIMER3_TICK_SEC (TIMER_FREQ / TIMER234_PRESCALE) unsigned long tcnt, tcmp; int oldstatus; - if (amplitude <= 0) + if (frequency == 0 || duration == 0 || amplitude == 0) { beep_stop(); /* won't hear it anyway */ return; -- cgit v1.2.3