Index: rockbox-devel/apps/lang/english.lang
===================================================================
--- rockbox-devel.orig/apps/lang/english.lang
+++ rockbox-devel/apps/lang/english.lang
@@ -5108,7 +5108,7 @@
*: "Trigger"
- *: ""
+ *: "Trigger"
@@ -5122,7 +5122,7 @@
*: "Once"
- *: ""
+ *: "Once"
@@ -5136,7 +5136,7 @@
*: "Repeat"
- *: ""
+ *: "Repeat"
@@ -5150,7 +5150,7 @@
*: "Start Above"
- *: ""
+ *: "Start above"
@@ -5164,7 +5164,7 @@
*: "for at least"
- *: ""
+ *: "for at least"
@@ -5178,7 +5178,7 @@
*: "Stop Below"
- *: ""
+ *: "Stop Below"
@@ -5192,7 +5192,7 @@
*: "for at least"
- *: ""
+ *: "for at least"
@@ -5206,7 +5206,7 @@
*: "Presplit Gap"
- *: ""
+ *: "Presplit Gap"
@@ -5220,7 +5220,7 @@
*: "-inf"
- *: ""
+ *: "minus infinity"
@@ -10154,7 +10154,7 @@
*: "Trigtype"
- *: "Trigtype"
+ *: "Trigger type"
Index: rockbox-devel/apps/settings.c
===================================================================
--- rockbox-devel.orig/apps/settings.c
+++ rockbox-devel/apps/settings.c
@@ -2193,11 +2193,15 @@ unsigned long rec_sizesplit_bytes(void)
* Time strings used for the trigger durations.
* Keep synchronous to trigger_times in settings_apply_trigger
*/
-const char * const trig_durations[TRIG_DURATION_COUNT] =
+const struct opt_items trig_durations[TRIG_DURATION_COUNT] =
{
- "0s", "1s", "2s", "5s",
- "10s", "15s", "20s", "25s", "30s",
- "1min", "2min", "5min", "10min"
+#define TS(x) { (unsigned char *)(#x "s"), TALK_ID(x, UNIT_SEC) }
+#define TM(x) { (unsigned char *)(#x "min"), TALK_ID(x, UNIT_MIN) }
+ TS(0), TS(1), TS(2), TS(5),
+ TS(10), TS(15), TS(20), TS(25), TS(30),
+ TM(1), TM(2), TM(5), TM(10)
+#undef TS
+#undef TM
};
void settings_apply_trigger(void)
Index: rockbox-devel/apps/settings.h
===================================================================
--- rockbox-devel.orig/apps/settings.h
+++ rockbox-devel/apps/settings.h
@@ -86,7 +86,7 @@
#define TRIG_MODE_REARM 2
#define TRIG_DURATION_COUNT 13
-extern const char * const trig_durations[TRIG_DURATION_COUNT];
+extern const struct opt_items trig_durations[TRIG_DURATION_COUNT];
#define CROSSFADE_ENABLE_SHUFFLE 1
#define CROSSFADE_ENABLE_ALWAYS 2
Index: rockbox-devel/apps/sound_menu.c
===================================================================
--- rockbox-devel.orig/apps/sound_menu.c
+++ rockbox-devel/apps/sound_menu.c
@@ -824,17 +824,23 @@ enum trigger_menu_option
};
#ifdef HAVE_RECORDING
-static char* create_thres_str(int threshold)
+static char* create_thres_str(int threshold, long *voice_id)
{
static char retval[6];
if (threshold < 0) {
if (threshold < -88) {
snprintf (retval, sizeof retval, "%s", str(LANG_DB_INF));
+ if(voice_id)
+ *voice_id = LANG_DB_INF;
} else {
snprintf (retval, sizeof retval, "%ddb", threshold + 1);
+ if(voice_id)
+ *voice_id = TALK_ID(threshold + 1, UNIT_DB);
}
} else {
snprintf (retval, sizeof retval, "%d%%", threshold);
+ if(voice_id)
+ *voice_id = TALK_ID(threshold, UNIT_PERCENT);
}
return retval;
}
@@ -885,11 +891,13 @@ bool rectrigger(void)
};
#define PRERECORD_TIMES_COUNT 31
- static const unsigned char *prerecord_times[] = {
- ID2P(LANG_OFF),"1s","2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s",
- "10s", "11s", "12s", "13s", "14s", "15s", "16s", "17s", "18s", "19s",
- "20s", "21s", "22s", "23s", "24s", "25s", "26s", "27s", "28s", "29s",
- "30s"
+ static const struct opt_items prerecord_times[] = {
+ { STR(LANG_OFF) },
+#define T(x) { (unsigned char *)(#x "s"), TALK_ID(x, UNIT_SEC) }
+ T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(9), T(10),
+ T(11), T(12), T(13), T(14), T(15), T(16), T(17), T(18), T(19), T(20),
+ T(21), T(22), T(23), T(24), T(25), T(26), T(27), T(28), T(29), T(30),
+#undef T
};
#define TRIGGER_TYPE_COUNT 3
@@ -929,6 +937,8 @@ bool rectrigger(void)
int trig_ypos[NB_SCREENS];
int trig_width[NB_SCREENS];
+ bool say_field = true, say_value = true;
+
FOR_NB_SCREENS(i)
{
offset[i] = 0;
@@ -978,23 +988,17 @@ bool rectrigger(void)
"%s",
P2STR(trigger_types[global_settings.rec_trigger_type]));
- snprintf(
- option_value[TRIGGER_TYPE],
- sizeof option_value[TRIGGER_TYPE],
- "%s",
- P2STR(trigger_types[global_settings.rec_trigger_type]));
-
snprintf (
option_value[PRERECORD_TIME],
sizeof option_value[PRERECORD_TIME],
"%s",
- P2STR(prerecord_times[global_settings.rec_prerecord_time]));
+ prerecord_times[global_settings.rec_prerecord_time].string);
/* due to value range shift (peak_meter_define_trigger) -1 is 0db */
if (global_settings.rec_start_thres == -1) {
str = str(LANG_OFF);
} else {
- str = create_thres_str(global_settings.rec_start_thres);
+ str = create_thres_str(global_settings.rec_start_thres, NULL);
}
snprintf(
option_value[START_THRESHOLD],
@@ -1006,13 +1010,12 @@ bool rectrigger(void)
option_value[START_DURATION],
sizeof option_value[START_DURATION],
"%s",
- trig_durations[global_settings.rec_start_duration]);
-
+ trig_durations[global_settings.rec_start_duration].string);
if (global_settings.rec_stop_thres <= INF_DB) {
str = str(LANG_OFF);
} else {
- str = create_thres_str(global_settings.rec_stop_thres);
+ str = create_thres_str(global_settings.rec_stop_thres, NULL);
}
snprintf(
option_value[STOP_THRESHOLD],
@@ -1024,13 +1027,13 @@ bool rectrigger(void)
option_value[STOP_POSTREC],
sizeof option_value[STOP_POSTREC],
"%s",
- trig_durations[global_settings.rec_stop_postrec]);
+ trig_durations[global_settings.rec_stop_postrec].string);
snprintf(
option_value[STOP_GAP],
sizeof option_value[STOP_GAP],
"%s",
- trig_durations[global_settings.rec_stop_gap]);
+ trig_durations[global_settings.rec_stop_gap].string);
FOR_NB_SCREENS(i)
{
@@ -1072,6 +1075,65 @@ bool rectrigger(void)
VERTICAL);
}
+ bool enqueue = false;
+ if(say_field) {
+ talk_id(P2ID(option_name[selected]), enqueue);
+ enqueue = true;
+ }
+ if(say_value) {
+ switch(selected) {
+ case TRIGGER_MODE:
+ talk_id(P2ID(trigger_modes[global_settings.rec_trigger_mode]),
+ enqueue);
+ break;
+ case TRIGGER_TYPE:
+ talk_id(P2ID(trigger_types[global_settings.rec_trigger_type]),
+ enqueue);
+ break;
+ case PRERECORD_TIME:
+ talk_id(prerecord_times[global_settings
+ .rec_prerecord_time].voice_id,
+ enqueue);
+ break;
+ case START_THRESHOLD:
+ if (global_settings.rec_start_thres == -1)
+ talk_id(LANG_OFF, enqueue);
+ else {
+ long voice_id;
+ create_thres_str(global_settings.rec_start_thres,
+ &voice_id);
+ talk_id(voice_id, enqueue);
+ }
+ break;
+ case START_DURATION:
+ talk_id(trig_durations[global_settings.rec_start_duration]
+ .voice_id, enqueue);
+ break;
+ case STOP_THRESHOLD:
+ if (global_settings.rec_stop_thres <= INF_DB)
+ talk_id(LANG_OFF, enqueue);
+ else {
+ long voice_id;
+ create_thres_str(global_settings.rec_stop_thres,
+ &voice_id);
+ talk_id(voice_id, enqueue);
+ }
+ break;
+ case STOP_POSTREC:
+ talk_id(trig_durations[global_settings.rec_stop_postrec]
+ .voice_id, enqueue);
+ break;
+ case STOP_GAP:
+ talk_id(trig_durations[global_settings.rec_stop_gap]
+ .voice_id, enqueue);
+ break;
+ case TRIG_OPTION_COUNT:
+ // avoid compiler warnings
+ break;
+ };
+ }
+ say_field = say_value = false;
+
peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width, NB_SCREENS);
button = peak_meter_draw_get_btn(0, pm_y, 8, NB_SCREENS);
@@ -1104,6 +1166,7 @@ bool rectrigger(void)
offset[i] = MIN(offset[i], (int)selected);
offset[i] = MAX(offset[i], (int)selected - option_lines[i] + 1);
}
+ say_field = say_value = true;
break;
case ACTION_STD_NEXT:
@@ -1114,6 +1177,7 @@ bool rectrigger(void)
offset[i] = MIN(offset[i], (int)selected);
offset[i] = MAX(offset[i], (int)selected - option_lines[i] + 1);
}
+ say_field = say_value = true;
break;
case ACTION_SETTINGS_INC:
@@ -1162,6 +1226,7 @@ bool rectrigger(void)
}
peak_meter_trigger(global_settings.rec_trigger_mode!=TRIG_OFF);
settings_apply_trigger();
+ say_value = true;
break;
case ACTION_SETTINGS_DEC:
@@ -1213,6 +1278,7 @@ bool rectrigger(void)
}
peak_meter_trigger(global_settings.rec_trigger_mode!=TRIG_OFF);
settings_apply_trigger();
+ say_value = true;
break;
case ACTION_REC_F2: