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/plugin.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index f15c626667..113296c19a 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -65,6 +65,7 @@ void* plugin_get_buffer(size_t *buffer_size); #include "misc.h" #include "filefuncs.h" #if (CONFIG_CODEC == SWCODEC) +#include "pcm_mixer.h" #include "dsp.h" #include "codecs.h" #include "playback.h" @@ -145,7 +146,7 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 205 +#define PLUGIN_API_VERSION 206 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any @@ -635,9 +636,8 @@ struct plugin_api { const void* (*pcm_get_peak_buffer)(int *count); void (*pcm_play_lock)(void); void (*pcm_play_unlock)(void); - void (*pcmbuf_beep)(unsigned int frequency, - size_t duration, - int amplitude); + void (*beep_play)(unsigned int frequency, unsigned int duration, + unsigned int amplitude); #ifdef HAVE_RECORDING const unsigned long *rec_freq_sampr; void (*pcm_init_recording)(void); @@ -908,6 +908,8 @@ struct plugin_api { /* new stuff at the end, sort into place next time the API gets incompatible */ + enum channel_status (*mixer_channel_status)(enum pcm_mixer_channel channel); + void * (*mixer_channel_get_buffer)(enum pcm_mixer_channel channel, int *count); }; /* plugin header */ -- cgit v1.2.3