summaryrefslogtreecommitdiff
path: root/apps/recorder
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-09 13:01:59 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-09 13:01:59 +0000
commit38ef849d06c7f206b4e9238058ce7b52fbc5d019 (patch)
tree9426af72e4ea2e7c64bec9b65935d363b0af19ae /apps/recorder
parent382c23e10dc44a357c5ce65df01c38559d722314 (diff)
slightly rework peakmeter handling to make it cleaner and be able to be used in conditionals
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25913 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/peakmeter.c6
-rw-r--r--apps/recorder/peakmeter.h2
-rw-r--r--apps/recorder/radio.c2
-rw-r--r--apps/recorder/recording.c6
4 files changed, 10 insertions, 6 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 154f605898..164b14b15c 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -78,7 +78,11 @@ static long pm_clip_timeout_r;
/* Temporarily en- / disables peak meter. This is especially for external
applications to detect if the peak_meter is in use and needs drawing at all */
-bool peak_meter_enabled = true;
+static bool peak_meter_enabled = true;
+void peak_meter_enable(bool enable)
+{
+ peak_meter_enabled = enable;
+}
/** Parameters **/
/* Range */
diff --git a/apps/recorder/peakmeter.h b/apps/recorder/peakmeter.h
index 6fc2d6be58..308e5fb916 100644
--- a/apps/recorder/peakmeter.h
+++ b/apps/recorder/peakmeter.h
@@ -32,7 +32,7 @@ extern int pm_get_clipcount(void);
extern void pm_reset_clipcount(void);
extern void pm_activate_clipcount(bool active);
-extern bool peak_meter_enabled;
+extern void peak_meter_enable(bool enable);
extern void peak_meter_playback(bool playback);
extern int peak_meter_draw_get_btn(int action_context, int x[], int y[],
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 7761f248ca..5841664742 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -548,7 +548,7 @@ int radio_screen(void)
/* Yes, we use the D/A for monitoring */
peak_meter_playback(true);
- peak_meter_enabled = true;
+ peak_meter_enable(true);
rec_init_recording_options(&rec_options);
rec_options.rec_source = AUDIO_SRC_LINEIN;
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index d5ac91000c..21db298184 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -698,7 +698,7 @@ void rec_set_source(int source, unsigned flags)
/* Set peakmeters for recording or reset to playback */
peak_meter_playback((flags & SRCF_RECORDING) == 0);
- peak_meter_enabled = true;
+ peak_meter_enable(true);
}
#endif /* CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) */
@@ -1099,7 +1099,7 @@ bool recording_screen(bool no_source)
buffer */
#else
/* Yes, we use the D/A for monitoring */
- peak_meter_enabled = true;
+ peak_meter_enable(true);
peak_meter_playback(true);
#endif
@@ -1549,7 +1549,7 @@ bool recording_screen(bool no_source)
{
#if CONFIG_CODEC != SWCODEC
peak_meter_playback(true);
- peak_meter_enabled = false;
+ peak_meter_enable(false);
#endif
done = 1;
}