summaryrefslogtreecommitdiffstats
path: root/apps/recorder
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-01-13 06:48:39 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-01-13 06:48:39 +0000
commit261c56ba59235c2da2aa644fbea0b1fa492bd1c6 (patch)
treecdf37e93496f9dc3aaf71f45537ff3d5371c074f /apps/recorder
parentc8535f27d140a2030cedf695a66595aae5b95c27 (diff)
downloadrockbox-261c56ba59235c2da2aa644fbea0b1fa492bd1c6.tar.gz
rockbox-261c56ba59235c2da2aa644fbea0b1fa492bd1c6.tar.bz2
rockbox-261c56ba59235c2da2aa644fbea0b1fa492bd1c6.zip
FS#11867 - Add 2 new tags to allow skins to display themed peakmeters
%pL for the left channel, %pR for the right channel... usable as a value, conditional or bar (exactly the same as %pv/%bl/etc) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29043 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/peakmeter.c24
-rw-r--r--apps/recorder/peakmeter.h2
2 files changed, 19 insertions, 7 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index aacfc23cee..ca1b8c8750 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -930,6 +930,21 @@ void peak_meter_screen(struct screen *display, int x, int y, int height)
peak_meter_draw(display, &scales[display->screen_type], x, y,
display->getwidth() - x, height);
}
+
+/* sets *left and *right to the current *unscaled* values */
+void peak_meter_current_vals(int *left, int *right)
+{
+ static int left_level = 0, right_level = 0;
+ if (level_check){
+ /* only read the volume info from MAS if peek since last read*/
+ left_level = peak_meter_read_l();
+ right_level = peak_meter_read_r();
+ level_check = false;
+ }
+ *left = left_level;
+ *right = right_level;
+}
+
/**
* Draws a peak meter in the specified size at the specified position.
* @param int x - The x coordinate.
@@ -944,7 +959,7 @@ void peak_meter_screen(struct screen *display, int x, int y, int height)
static void peak_meter_draw(struct screen *display, struct meter_scales *scales,
int x, int y, int width, int height)
{
- static int left_level = 0, right_level = 0;
+ int left_level = 0, right_level = 0;
int left = 0, right = 0;
int meterwidth = width - 3;
int i, delta;
@@ -964,12 +979,7 @@ static void peak_meter_draw(struct screen *display, struct meter_scales *scales,
if (peak_meter_enabled) {
- if (level_check){
- /* only read the volume info from MAS if peek since last read*/
- left_level = peak_meter_read_l();
- right_level = peak_meter_read_r();
- level_check = false;
- }
+ peak_meter_current_vals(&left_level, &right_level);
/* scale the samples dBfs */
left = peak_meter_scale_value(left_level, meterwidth);
diff --git a/apps/recorder/peakmeter.h b/apps/recorder/peakmeter.h
index 4abcc154f3..fee4882679 100644
--- a/apps/recorder/peakmeter.h
+++ b/apps/recorder/peakmeter.h
@@ -34,6 +34,8 @@ extern void pm_reset_clipcount(void);
extern void pm_activate_clipcount(bool active);
extern void peak_meter_enable(bool enable);
+/* sets *left and *right to the current *unscaled* values */
+extern void peak_meter_current_vals(int *left, int *right);
extern void peak_meter_playback(bool playback);
extern int peak_meter_draw_get_btn(int action_context, int x[], int y[],