summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-07-02 11:55:38 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-07-02 11:55:38 +0000
commit22b6def065ab7c2ca030f405577e34104ad20011 (patch)
tree6be548bf591d2365077b74679048737fe51792a2 /apps
parent8c954e28b75b47543f69abe2c169d83ad38c26ae (diff)
downloadrockbox-22b6def065ab7c2ca030f405577e34104ad20011.tar.gz
rockbox-22b6def065ab7c2ca030f405577e34104ad20011.zip
Use playback channel directly for peakmeters and plugins using peak calculation. Also, for now, don't allow mixer playback to overlap recording, even if full duplex works.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30119 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c1
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/oscilloscope.c3
-rw-r--r--apps/plugins/starfield.c3
-rw-r--r--apps/plugins/vu_meter.c3
-rw-r--r--apps/recorder/peakmeter.c4
6 files changed, 13 insertions, 5 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index bfb7f0e9c1..6b3d39973f 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -781,6 +781,7 @@ static const struct plugin_api rockbox_api = {
#if CONFIG_CODEC == SWCODEC
mixer_channel_status,
mixer_channel_get_buffer,
+ mixer_channel_calculate_peaks,
#endif
};
diff --git a/apps/plugin.h b/apps/plugin.h
index aa39829daf..77c8e831d4 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -146,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 206
+#define PLUGIN_API_VERSION 207
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
@@ -911,6 +911,8 @@ struct plugin_api {
#if CONFIG_CODEC == SWCODEC
enum channel_status (*mixer_channel_status)(enum pcm_mixer_channel channel);
void * (*mixer_channel_get_buffer)(enum pcm_mixer_channel channel, int *count);
+ void (*mixer_channel_calculate_peaks)(enum pcm_mixer_channel channel,
+ int *left, int *right);
#endif
};
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 07bf1da8bb..5eb43fae62 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -826,7 +826,8 @@ enum plugin_status plugin_start(const void* parameter)
left = rb->mas_codec_readreg(0xC);
right = rb->mas_codec_readreg(0xD);
#elif (CONFIG_CODEC == SWCODEC)
- rb->pcm_calculate_peaks(&left, &right);
+ rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
+ &left, &right);
#endif
if (osc.orientation == OSC_HORIZ)
anim_horizontal(left, right);
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index 5e832aa38a..e7bbb425be 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -422,7 +422,8 @@ int plugin_main(void)
/* Get the peaks. ( Borrowed from vu_meter ) */
#if (CONFIG_CODEC == SWCODEC)
int left_peak, right_peak;
- rb->pcm_calculate_peaks(&left_peak, &right_peak);
+ rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
+ &left_peak, &right_peak);
#else
int left_peak = rb->mas_codec_readreg(0xC);
int right_peak = rb->mas_codec_readreg(0xD);
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 5266214723..cb1a035678 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -660,7 +660,8 @@ void analog_meter(void) {
int right_peak = rb->mas_codec_readreg(0xD);
#elif (CONFIG_CODEC == SWCODEC)
int left_peak, right_peak;
- rb->pcm_calculate_peaks(&left_peak, &right_peak);
+ rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
+ &left_peak, &right_peak);
#endif
if(vumeter_settings.analog_use_db_scale) {
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index c13c4c9539..fd8f8d9fbe 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -44,6 +44,7 @@
#if CONFIG_CODEC == SWCODEC
#include "pcm.h"
+#include "pcm_mixer.h"
#ifdef HAVE_RECORDING
#include "pcm_record.h"
@@ -620,7 +621,8 @@ void peak_meter_peek(void)
/* read current values */
#if CONFIG_CODEC == SWCODEC
if (pm_playback)
- pcm_calculate_peaks(&pm_cur_left, &pm_cur_right);
+ mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
+ &pm_cur_left, &pm_cur_right);
#ifdef HAVE_RECORDING
else
pcm_calculate_rec_peaks(&pm_cur_left, &pm_cur_right);