summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-08-26 21:34:36 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-08-26 21:34:36 +0000
commit6109d39469240418b593e4286e46d0bc8163fbbf (patch)
treeaa189c9d2b71b62b70baf608af3d4efd05e2f4d2
parent8f9717ae6fa59ea3e837a158fe147c84cbc3468e (diff)
only build the clipcounter for targets with recording
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14467 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/lang/english.lang18
-rw-r--r--apps/menus/display_menu.c9
-rw-r--r--apps/recorder/peakmeter.c16
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_list.c4
5 files changed, 35 insertions, 14 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 8a06401cd7..adc3041119 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -11127,13 +11127,16 @@
desc: in settings, for recording peak meter
user:
<source>
- *: "Clip Counter"
+ *: none
+ recording: "Clip Counter"
</source>
<dest>
- *: "Clip Counter"
+ *: none
+ recording: "Clip Counter"
</dest>
<voice>
- *: "Clip Counter"
+ *: none
+ recording: "Clip Counter"
</voice>
</phrase>
<phrase>
@@ -11141,12 +11144,15 @@
desc: in recording GUI, for recording peak meter. MAX 5 characters!
user:
<source>
- *: "CLIP:"
+ *: none
+ recording: "CLIP:"
</source>
<dest>
- *: "CLIP:"
+ *: none
+ recording: "CLIP:"
</dest>
<voice>
- *: ""
+ *: none
+ recording: ""
</voice>
</phrase>
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index a523753119..c1e574a974 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -401,8 +401,10 @@ MENUITEM_SETTING(peak_meter_hold,
&global_settings.peak_meter_hold, peakmeter_callback);
MENUITEM_SETTING(peak_meter_clip_hold,
&global_settings.peak_meter_clip_hold, peakmeter_callback);
-MENUITEM_SETTING(peak_meter_clipcounter,
+#ifdef HAVE_RECORDING
+MENUITEM_SETTING(peak_meter_clipcounter,
&global_settings.peak_meter_clipcounter, NULL);
+#endif
MENUITEM_SETTING(peak_meter_release,
&global_settings.peak_meter_release, peakmeter_callback);
/**
@@ -530,7 +532,10 @@ MENUITEM_FUNCTION(peak_meter_max_item, 0, ID2P(LANG_PM_MAX),
peak_meter_max, NULL, NULL, Icon_NOICON);
MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON,
&peak_meter_release, &peak_meter_hold,
- &peak_meter_clip_hold, &peak_meter_clipcounter,
+ &peak_meter_clip_hold,
+#ifdef HAVE_RECORDING
+ &peak_meter_clipcounter,
+#endif
&peak_meter_scale_item, &peak_meter_min_item, &peak_meter_max_item);
#endif /* HAVE_LCD_BITMAP */
/* PEAK METER MENU */
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index f3f5d67c9c..c7e351f898 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -76,10 +76,6 @@ static bool pm_clip_right = false;
static long pm_clip_timeout_l; /* clip hold timeouts */
static long pm_clip_timeout_r;
-/* clipping counter (only used for recording) */
-static unsigned int pm_clipcount = 0; /* clipping count */
-static bool pm_clipcount_active = false; /* counting or not */
-
/* 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;
@@ -118,6 +114,10 @@ static long trig_lowtime;
static int trig_status = TRIG_OFF;
static void (*trigger_listener)(int) = NULL;
+
+/* clipping counter (only used for recording) */
+static unsigned int pm_clipcount = 0; /* clipping count */
+static bool pm_clipcount_active = false; /* counting or not */
#endif
/* debug only */
@@ -496,6 +496,7 @@ void peak_meter_init_times(int release, int hold, int clip_hold)
pm_clip_hold = clip_hold;
}
+#ifdef HAVE_RECORDING
/**
* Enable/disable clip counting
*/
@@ -519,6 +520,7 @@ void pm_reset_clipcount(void)
{
pm_clipcount = 0;
}
+#endif
/**
* Set the source of the peak meter to playback or to
@@ -566,7 +568,9 @@ static void set_trig_status(int new_state)
void peak_meter_peek(void)
{
int left, right;
+#ifdef HAVE_RECORDING
bool was_clipping = pm_clip_left || pm_clip_right;
+#endif
/* read current values */
#if CONFIG_CODEC == SWCODEC
if (pm_playback)
@@ -617,12 +621,14 @@ void peak_meter_peek(void)
current_tick + clip_time_out[pm_clip_hold];
}
+#ifdef HAVE_RECORDING
if(!was_clipping && (pm_clip_left || pm_clip_right))
{
if(pm_clipcount_active)
pm_clipcount++;
}
-
+#endif
+
/* peaks are searched -> we have to find the maximum. When
many calls of peak_meter_peek the maximum value will be
stored in pm_max_xxx. This maximum is reset by the
diff --git a/apps/settings.h b/apps/settings.h
index 39263f8256..987709ce72 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -465,7 +465,9 @@ struct user_settings
bool peak_meter_dbfs; /* show linear or dbfs values */
int peak_meter_min; /* range minimum */
int peak_meter_max; /* range maximum */
+#ifdef HAVE_RECORDING
bool peak_meter_clipcounter; /* clipping count indicator */
+#endif
bool car_adapter_mode; /* 0=off 1=on */
/* show status bar */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 0fc5cd7d4f..16c3222b5e 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -712,9 +712,11 @@ const struct settings_list settings[] = {
OFFON_SETTING(0,peak_meter_dbfs,LANG_PM_DBFS,true,"peak meter dbfs",NULL),
{F_T_INT,&global_settings.peak_meter_min,LANG_PM_MIN,INT(60),"peak meter min",NULL,UNUSED},
{F_T_INT,&global_settings.peak_meter_max,LANG_PM_MAX,INT(0),"peak meter max",NULL,UNUSED},
+#ifdef HAVE_RECORDING
OFFON_SETTING(0,peak_meter_clipcounter,LANG_PM_CLIPCOUNTER,false,
"peak meter clipcounter",NULL),
-#endif
+#endif /* HAVE_RECORDING */
+#endif /* HAVE_LCD_BITMAP */
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
SOUND_SETTING(0, mdb_strength, LANG_MDB_STRENGTH,
"mdb strength", SOUND_MDB_STRENGTH),