feat: Timer Voice & Haptic option, show elapsed speak time value when countdown (#2711)
* fix "odd" elapsed time announcement * announce elapsed seconds * Add support for "Beeps and Haptic" and "Voice and Haptic" for timer countdown.
This commit is contained in:
@@ -274,17 +274,27 @@ namespace YAML
|
||||
{
|
||||
Node convert<TimerData>::encode(const TimerData& rhs)
|
||||
{
|
||||
unsigned int countdownBeep = rhs.countdownBeep;
|
||||
unsigned int extraHaptic = rhs.extraHaptic;
|
||||
if (countdownBeep > TimerData::COUNTDOWNBEEP_VOICE + 1) {
|
||||
extraHaptic = 1;
|
||||
countdownBeep -= TimerData::COUNTDOWNBEEP_VOICE + 1;
|
||||
}
|
||||
else {
|
||||
extraHaptic = 0;
|
||||
}
|
||||
Node node;
|
||||
node["swtch"] = rhs.swtch;
|
||||
node["mode"] = timerModeLut << rhs.mode;
|
||||
node["name"] = rhs.name;
|
||||
node["minuteBeep"] = (int)rhs.minuteBeep;
|
||||
node["countdownBeep"] = rhs.countdownBeep;
|
||||
node["countdownBeep"] = countdownBeep;
|
||||
node["start"] = rhs.val;
|
||||
node["persistent"] = rhs.persistent;
|
||||
node["countdownStart"] = rhs.countdownStart;
|
||||
node["value"] = rhs.pvalue;
|
||||
node["showElapsed"] = rhs.showElapsed;
|
||||
node["extraHaptic"] = extraHaptic;
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -300,6 +310,11 @@ bool convert<TimerData>::decode(const Node& node, TimerData& rhs)
|
||||
node["countdownStart"] >> rhs.countdownStart;
|
||||
node["value"] >> rhs.pvalue;
|
||||
node["showElapsed"] >> rhs.showElapsed;
|
||||
node["extraHaptic"] >> rhs.extraHaptic;
|
||||
|
||||
if (rhs.extraHaptic)
|
||||
rhs.countdownBeep += TimerData::COUNTDOWNBEEP_VOICE + 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,10 @@ QString TimerData::countdownBeepToString(const int value)
|
||||
return tr("Voice");
|
||||
case COUNTDOWNBEEP_HAPTIC:
|
||||
return tr("Haptic");
|
||||
case COUNTDOWNBEEP_BEEPS_AND_HAPTIC:
|
||||
return tr("Beeps and Haptic");
|
||||
case COUNTDOWNBEEP_VOICE_AND_HAPTIC:
|
||||
return tr("Voice and Haptic");
|
||||
default:
|
||||
return CPN_STR_UNKNOWN_ITEM;
|
||||
}
|
||||
|
||||
@@ -40,86 +40,90 @@ class TimerData {
|
||||
Q_DECLARE_TR_FUNCTIONS(TimerData)
|
||||
|
||||
public:
|
||||
enum CountDownBeepType {
|
||||
COUNTDOWNBEEP_SILENT,
|
||||
COUNTDOWNBEEP_BEEPS,
|
||||
COUNTDOWNBEEP_VOICE,
|
||||
COUNTDOWNBEEP_HAPTIC,
|
||||
COUNTDOWNBEEP_COUNT
|
||||
};
|
||||
enum CountDownBeepType {
|
||||
COUNTDOWNBEEP_SILENT,
|
||||
COUNTDOWNBEEP_BEEPS,
|
||||
COUNTDOWNBEEP_VOICE,
|
||||
COUNTDOWNBEEP_HAPTIC,
|
||||
COUNTDOWNBEEP_BEEPS_AND_HAPTIC,
|
||||
COUNTDOWNBEEP_VOICE_AND_HAPTIC,
|
||||
COUNTDOWNBEEP_COUNT
|
||||
};
|
||||
|
||||
enum CountDownStart {
|
||||
COUNTDOWNSTART_5 = -2,
|
||||
COUNTDOWNSTART_FIRST = COUNTDOWNSTART_5,
|
||||
COUNTDOWNSTART_10,
|
||||
COUNTDOWNSTART_20,
|
||||
COUNTDOWNSTART_30,
|
||||
COUNTDOWNSTART_LAST = COUNTDOWNSTART_30
|
||||
};
|
||||
enum CountDownStart {
|
||||
COUNTDOWNSTART_5 = -2,
|
||||
COUNTDOWNSTART_FIRST = COUNTDOWNSTART_5,
|
||||
COUNTDOWNSTART_10,
|
||||
COUNTDOWNSTART_20,
|
||||
COUNTDOWNSTART_30,
|
||||
COUNTDOWNSTART_LAST = COUNTDOWNSTART_30
|
||||
};
|
||||
|
||||
enum PersistentType {
|
||||
PERSISTENT_NOT,
|
||||
PERSISTENT_FLIGHT,
|
||||
PERSISTENT_MANUALRESET,
|
||||
PERSISTENT_COUNT
|
||||
};
|
||||
enum PersistentType {
|
||||
PERSISTENT_NOT,
|
||||
PERSISTENT_FLIGHT,
|
||||
PERSISTENT_MANUALRESET,
|
||||
PERSISTENT_COUNT
|
||||
};
|
||||
|
||||
enum TimerMode {
|
||||
TIMERMODE_OFF,
|
||||
TIMERMODE_ON,
|
||||
TIMERMODE_START,
|
||||
TIMERMODE_THR,
|
||||
TIMERMODE_THR_REL,
|
||||
TIMERMODE_THR_START,
|
||||
TIMERMODE_COUNT,
|
||||
TIMERMODE_MAX = TIMERMODE_COUNT - 1
|
||||
};
|
||||
enum TimerMode {
|
||||
TIMERMODE_OFF,
|
||||
TIMERMODE_ON,
|
||||
TIMERMODE_START,
|
||||
TIMERMODE_THR,
|
||||
TIMERMODE_THR_REL,
|
||||
TIMERMODE_THR_START,
|
||||
TIMERMODE_COUNT,
|
||||
TIMERMODE_MAX = TIMERMODE_COUNT - 1
|
||||
};
|
||||
|
||||
enum TimerShowDirection {
|
||||
TIMER_SHOW_REMAINING,
|
||||
TIMER_SHOW_ELAPSED,
|
||||
TIMER_SHOW_COUNT
|
||||
};
|
||||
enum TimerShowDirection {
|
||||
TIMER_SHOW_REMAINING,
|
||||
TIMER_SHOW_ELAPSED,
|
||||
TIMER_SHOW_COUNT
|
||||
};
|
||||
|
||||
TimerData() { clear(); }
|
||||
TimerData() { clear(); }
|
||||
|
||||
RawSwitch swtch;
|
||||
unsigned int mode;
|
||||
char name[TIMER_NAME_LEN + 1];
|
||||
bool minuteBeep;
|
||||
unsigned int countdownBeep;
|
||||
unsigned int val;
|
||||
unsigned int persistent;
|
||||
int countdownStart;
|
||||
int pvalue;
|
||||
unsigned int showElapsed;
|
||||
RawSwitch swtch;
|
||||
unsigned int mode;
|
||||
char name[TIMER_NAME_LEN + 1];
|
||||
bool minuteBeep;
|
||||
unsigned int countdownBeep;
|
||||
unsigned int val;
|
||||
unsigned int persistent;
|
||||
int countdownStart;
|
||||
int pvalue;
|
||||
unsigned int showElapsed;
|
||||
unsigned int extraHaptic;
|
||||
|
||||
void convert(RadioDataConversionState & cstate);
|
||||
void clear();
|
||||
bool isEmpty() const;
|
||||
bool isModeOff();
|
||||
QString nameToString(int index) const;
|
||||
QString countdownBeepToString() const;
|
||||
QString countdownStartToString() const;
|
||||
QString persistentToString(const bool verbose = true) const;
|
||||
QString pvalueToString() const;
|
||||
QString valToString() const;
|
||||
QString modeToString() const;
|
||||
QString showElapsedToString() const;
|
||||
void convert(RadioDataConversionState& cstate);
|
||||
void clear();
|
||||
bool isEmpty() const;
|
||||
bool isModeOff();
|
||||
QString nameToString(int index) const;
|
||||
QString countdownBeepToString() const;
|
||||
QString countdownStartToString() const;
|
||||
QString persistentToString(const bool verbose = true) const;
|
||||
QString pvalueToString() const;
|
||||
QString valToString() const;
|
||||
QString modeToString() const;
|
||||
QString showElapsedToString() const;
|
||||
|
||||
void countdownBeepChanged();
|
||||
void modeChanged();
|
||||
void countdownBeepChanged();
|
||||
void modeChanged();
|
||||
|
||||
static QString countdownBeepToString(const int value);
|
||||
static QString countdownStartToString(const int value);
|
||||
static QString persistentToString(const int value, const bool verbose = true);
|
||||
static QString pvalueToString(const int value);
|
||||
static QString valToString(const int value);
|
||||
static QString modeToString(const int value);
|
||||
static QString showElapsedToString(const unsigned int value);
|
||||
static AbstractStaticItemModel * countdownBeepItemModel();
|
||||
static AbstractStaticItemModel * countdownStartItemModel();
|
||||
static AbstractStaticItemModel * persistentItemModel();
|
||||
static AbstractStaticItemModel * modeItemModel();
|
||||
static AbstractStaticItemModel * showElapsedItemModel();
|
||||
static QString countdownBeepToString(const int value);
|
||||
static QString countdownStartToString(const int value);
|
||||
static QString persistentToString(const int value,
|
||||
const bool verbose = true);
|
||||
static QString pvalueToString(const int value);
|
||||
static QString valToString(const int value);
|
||||
static QString modeToString(const int value);
|
||||
static QString showElapsedToString(const unsigned int value);
|
||||
static AbstractStaticItemModel* countdownBeepItemModel();
|
||||
static AbstractStaticItemModel* countdownStartItemModel();
|
||||
static AbstractStaticItemModel* persistentItemModel();
|
||||
static AbstractStaticItemModel* modeItemModel();
|
||||
static AbstractStaticItemModel* showElapsedItemModel();
|
||||
};
|
||||
|
||||
+19
-15
@@ -996,32 +996,36 @@ void audioTrimPress(int value)
|
||||
void audioTimerCountdown(uint8_t timer, int value)
|
||||
{
|
||||
if (g_model.timers[timer].countdownBeep == COUNTDOWN_VOICE) {
|
||||
int announceValue = value;
|
||||
if (g_model.timers[timer].showElapsed) {
|
||||
announceValue = g_model.timers[timer].start - value;
|
||||
}
|
||||
if (value >= 0 && value <= TIMER_COUNTDOWN_START(timer)) {
|
||||
playNumber(value, 0, 0, 0);
|
||||
if (announceValue > 60 && !(announceValue % 2) && (announceValue % 30) &&
|
||||
(announceValue % 30))
|
||||
playNumber(announceValue / 60, 0, 0, 0);
|
||||
if (announceValue < 60 ||
|
||||
(announceValue > 60 && !(announceValue % 2) && (announceValue % 60)))
|
||||
playNumber(announceValue % 60, 0, 0, 0);
|
||||
} else if ((!(announceValue % 30) || !(announceValue % 20)) && value < 31) {
|
||||
playDuration(announceValue, 0, 0);
|
||||
}
|
||||
else if (value == 30 || value == 20) {
|
||||
playDuration(value, 0, 0);
|
||||
}
|
||||
}
|
||||
else if (g_model.timers[timer].countdownBeep == COUNTDOWN_BEEPS) {
|
||||
} else if (g_model.timers[timer].countdownBeep == COUNTDOWN_BEEPS) {
|
||||
if (value == 0) {
|
||||
audioQueue.playTone(BEEP_DEFAULT_FREQ + 150, 300, 20, PLAY_NOW);
|
||||
}
|
||||
else if (value > 0 && value <= TIMER_COUNTDOWN_START(timer)) {
|
||||
} else if (value > 0 && value <= TIMER_COUNTDOWN_START(timer)) {
|
||||
audioQueue.playTone(BEEP_DEFAULT_FREQ + 150, 100, 20, PLAY_NOW);
|
||||
}
|
||||
else if (value == 30) {
|
||||
} else if (value == 30) {
|
||||
audioQueue.playTone(BEEP_DEFAULT_FREQ + 150, 120, 20, PLAY_REPEAT(2));
|
||||
}
|
||||
else if (value == 20) {
|
||||
} else if (value == 20) {
|
||||
audioQueue.playTone(BEEP_DEFAULT_FREQ + 150, 120, 20, PLAY_REPEAT(1));
|
||||
}
|
||||
else if (value == 10) {
|
||||
} else if (value == 10) {
|
||||
audioQueue.playTone(BEEP_DEFAULT_FREQ + 150, 120, 20, PLAY_NOW);
|
||||
}
|
||||
}
|
||||
#if defined(HAPTIC)
|
||||
else if (g_model.timers[timer].countdownBeep == COUNTDOWN_HAPTIC) {
|
||||
if ( (g_model.timers[timer].countdownBeep == COUNTDOWN_HAPTIC) ||
|
||||
(g_model.timers[timer].extraHaptic) ) {
|
||||
if (value == 0) {
|
||||
haptic.play(15, 3, PLAY_NOW);
|
||||
}
|
||||
|
||||
@@ -866,8 +866,11 @@ enum CountDownModes {
|
||||
COUNTDOWN_SILENT,
|
||||
COUNTDOWN_BEEPS,
|
||||
COUNTDOWN_VOICE,
|
||||
COUNTDOWN_NON_HAPTIC_LAST = COUNTDOWN_VOICE,
|
||||
#if defined(HAPTIC)
|
||||
COUNTDOWN_HAPTIC,
|
||||
COUNTDOWN_BEEPS_AND_HAPTIC,
|
||||
COUNTDOWN_VOICE_AND_HPTIC,
|
||||
#endif
|
||||
COUNTDOWN_COUNT SKIP
|
||||
};
|
||||
|
||||
@@ -238,7 +238,8 @@ PACK(struct TimerData {
|
||||
uint32_t persistent:2;
|
||||
int32_t countdownStart:2;
|
||||
uint8_t showElapsed:1;
|
||||
uint8_t spare:7 SKIP;
|
||||
uint8_t extraHaptic:1;
|
||||
uint8_t spare:6 SKIP;
|
||||
NOBACKUP(char name[LEN_TIMER_NAME]);
|
||||
});
|
||||
|
||||
|
||||
@@ -341,16 +341,29 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
{
|
||||
TimerData & timer = g_model.timers[timerIdx];
|
||||
lcdDrawTextAlignedLeft(y, STR_BEEPCOUNTDOWN);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition == 0 ? attr : 0));
|
||||
int value = timer.countdownBeep;
|
||||
if (timer.extraHaptic) value += (COUNTDOWN_VOICE + 1);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, value, (menuHorizontalPosition == 0 ? attr : 0));
|
||||
if (timer.countdownBeep != COUNTDOWN_SILENT) {
|
||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN + 6 * FW, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT);
|
||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||
}
|
||||
if (attr && s_editMode > 0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR(event, timer.countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1);
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
value = timer.countdownBeep;
|
||||
if (timer.extraHaptic) value += (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
CHECK_INCDEC_MODELVAR(event, value, COUNTDOWN_SILENT,
|
||||
COUNTDOWN_COUNT - 1);
|
||||
if (value > COUNTDOWN_VOICE + 1) {
|
||||
timer.extraHaptic = 1;
|
||||
timer.countdownBeep = value - (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
} else {
|
||||
timer.extraHaptic = 0;
|
||||
timer.countdownBeep = value;
|
||||
}
|
||||
} break;
|
||||
case 1:
|
||||
timer.countdownStart = -checkIncDecModel(event, -timer.countdownStart, -1, +2);
|
||||
break;
|
||||
|
||||
@@ -262,7 +262,10 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
{
|
||||
TimerData & timer = g_model.timers[timerIdx];
|
||||
lcdDrawTextAlignedLeft(y, STR_BEEPCOUNTDOWN);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition==0 ? attr : 0));
|
||||
int value = timer.countdownBeep;
|
||||
if (timer.extraHaptic) value += (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, value,
|
||||
(menuHorizontalPosition == 0 ? attr : 0));
|
||||
if (timer.countdownBeep != COUNTDOWN_SILENT) {
|
||||
lcdDrawNumber(MODEL_SETUP_3RD_COLUMN, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT);
|
||||
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||
@@ -270,8 +273,20 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
|
||||
if (attr && s_editMode>0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
CHECK_INCDEC_MODELVAR(event, timer.countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1);
|
||||
break;
|
||||
{
|
||||
value = timer.countdownBeep;
|
||||
if (timer.extraHaptic) value += (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
TRACE("value=%d\ttimer.extraHaptic=%d", value, timer.extraHaptic);
|
||||
CHECK_INCDEC_MODELVAR(event, value, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1);
|
||||
if (value > COUNTDOWN_VOICE + 1) {
|
||||
timer.extraHaptic = 1;
|
||||
timer.countdownBeep = value - (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
} else {
|
||||
timer.extraHaptic = 0;
|
||||
timer.countdownBeep = value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
timer.countdownStart = -checkIncDecModel(event, -timer.countdownStart, -1, +2);
|
||||
break;
|
||||
|
||||
@@ -117,8 +117,28 @@ TimerWindow::TimerWindow(uint8_t timer) : Page(ICON_STATS_TIMERS)
|
||||
box->setFlexLayout(LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_width(box->getLvObj(), LV_SIZE_CONTENT);
|
||||
|
||||
new Choice(box, rect_t{}, STR_VBEEPCOUNTDOWN, COUNTDOWN_SILENT,
|
||||
COUNTDOWN_COUNT - 1, GET_SET_DEFAULT(p_timer->countdownBeep));
|
||||
new Choice(
|
||||
box, rect_t{}, STR_VBEEPCOUNTDOWN, COUNTDOWN_SILENT, COUNTDOWN_COUNT - 1,
|
||||
[=]() -> int {
|
||||
int value = p_timer->countdownBeep;
|
||||
if (p_timer->extraHaptic) {
|
||||
value += (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
}
|
||||
return (value);
|
||||
},
|
||||
[=](int value) {
|
||||
if (value > COUNTDOWN_NON_HAPTIC_LAST + 1) {
|
||||
p_timer->extraHaptic = 1;
|
||||
p_timer->countdownBeep = value - (COUNTDOWN_NON_HAPTIC_LAST + 1);
|
||||
} else {
|
||||
p_timer->extraHaptic = 0;
|
||||
p_timer->countdownBeep = value;
|
||||
}
|
||||
SET_DIRTY();
|
||||
TRACE("value=%d\tcountdownBeep = %d\textraHaptic = %d", value,
|
||||
p_timer->countdownBeep, p_timer->extraHaptic);
|
||||
});
|
||||
|
||||
new Choice(box, rect_t{}, STR_COUNTDOWNVALUES, 0, 3,
|
||||
GET_SET_WITH_OFFSET(p_timer->countdownStart, 2));
|
||||
|
||||
|
||||
@@ -294,6 +294,7 @@ static int luaModelGetTimer(lua_State *L)
|
||||
lua_pushtableboolean(L, "showElapsed", timer.showElapsed);
|
||||
lua_pushtableinteger(L, "switch", timer.swtch);
|
||||
lua_pushtableinteger(L, "countdownStart", timer.countdownStart);
|
||||
lua_pushtableinteger(L, "extraHaptic", timer.extraHaptic);
|
||||
}
|
||||
else {
|
||||
lua_pushnil(L);
|
||||
@@ -349,13 +350,16 @@ static int luaModelSetTimer(lua_State *L)
|
||||
}
|
||||
else if (!strcmp(key, "showElapsed")) {
|
||||
timer.showElapsed = lua_toboolean(L, -1);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(key, "switch")) {
|
||||
timer.swtch = luaL_checkinteger(L, -1);
|
||||
}
|
||||
else if (!strcmp(key, "countdownStart")) {
|
||||
timer.countdownStart = luaL_checkinteger(L, -1);
|
||||
}
|
||||
else if (!strcmp(key, "extraHaptic")) {
|
||||
timer.extraHaptic = lua_tointeger(L, -1);
|
||||
}
|
||||
}
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -470,7 +470,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -442,7 +442,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -501,7 +501,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -499,7 +499,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -444,7 +444,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -483,7 +483,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 8),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -421,7 +421,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -431,7 +431,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -428,7 +428,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -432,7 +432,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -436,7 +436,8 @@ static const struct YamlNode struct_TimerData[] = {
|
||||
YAML_UNSIGNED( "persistent", 2 ),
|
||||
YAML_SIGNED( "countdownStart", 2 ),
|
||||
YAML_UNSIGNED( "showElapsed", 1 ),
|
||||
YAML_PADDING( 7 ),
|
||||
YAML_UNSIGNED( "extraHaptic", 1 ),
|
||||
YAML_PADDING( 6 ),
|
||||
YAML_STRING("name", 3),
|
||||
YAML_END
|
||||
};
|
||||
|
||||
@@ -166,9 +166,9 @@ void evalTimers(int16_t throttle, uint8_t tick10ms)
|
||||
if (g_model.timers[i].countdownBeep && g_model.timers[i].start) {
|
||||
AUDIO_TIMER_COUNTDOWN(i, newTimerVal);
|
||||
}
|
||||
if (g_model.timers[i].minuteBeep && (newTimerVal % 60) == 0) {
|
||||
tmrval_t announceVal = newTimerVal;
|
||||
if (showElapsed) announceVal = timerStart - newTimerVal;
|
||||
tmrval_t announceVal = newTimerVal;
|
||||
if (showElapsed) announceVal = timerStart - newTimerVal;
|
||||
if (g_model.timers[i].minuteBeep && (announceVal % 60) == 0) {
|
||||
AUDIO_TIMER_MINUTE(announceVal);
|
||||
// TRACE("Timer[%d] %d minute announcement", i, newTimerVal/60);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,12 @@
|
||||
|
||||
#define TR(x, y) TR2(x, y) // for compatibility
|
||||
|
||||
#if LCD_W <= 212 && !defined(COLORLCD)
|
||||
#define TR2_2(x, y) x
|
||||
#else
|
||||
#define TR2_2(x, y) TR2(x, y)
|
||||
#endif
|
||||
|
||||
#if defined(COLORLCD)
|
||||
#define BUTTON(x) x
|
||||
#define INDENT
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#define TR_MULTI_CUSTOM "自定义"
|
||||
#define TR_VTRIMINC "指数","很小","较小","中等","较大"
|
||||
#define TR_VDISPLAYTRIMS "不显示","改变时","始终显示"
|
||||
#define TR_VBEEPCOUNTDOWN "静音","蜂鸣","语音","震动"
|
||||
#define TR_VBEEPCOUNTDOWN "静音","蜂鸣","语音","震动",TR2_2("B & H","Beeps & Haptic"),TR2_2("V & H","Voice & Haptic")
|
||||
#define TR_COUNTDOWNVALUES "5秒","10秒","20秒","30秒"
|
||||
#define TR_VVARIOCENTER "音调","静音"
|
||||
#define TR_CURVE_TYPES "标准","自定义"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#define TR_MULTI_CUSTOM "Vlastní"
|
||||
#define TR_VTRIMINC "Expo","ExJemný","Jemný","Střední","Hrubý"
|
||||
#define TR_VDISPLAYTRIMS "Ne","Změna","Ano"
|
||||
#define TR_VBEEPCOUNTDOWN "Ne","Zvuk","Hlas","Vibrace"
|
||||
#define TR_VBEEPCOUNTDOWN "Ne", "Zvuk", "Hlas", "Vibrace", TR2_2("Zv & Vib","Zvuk & Vibrace"),TR2_2("Hl & Vib", "Hlas & Vibrace")
|
||||
#define TR_VVARIOCENTER "Tón","Ticho"
|
||||
#define TR_CURVE_TYPES "Rastr-X","Volná-XY"
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
#define TR_MULTI_CUSTOM "Tilpasset"
|
||||
#define TR_VTRIMINC TR("Expo","Exponentiel"),TR("ExFin","Ekstra fin"),"Fin","Medium","Grov"
|
||||
#define TR_VDISPLAYTRIMS "Nej","Ændre","Ja"
|
||||
#define TR_VBEEPCOUNTDOWN "Stille","Bip","Stemme","Vibration"
|
||||
#define TR_VBEEPCOUNTDOWN "Stille","Bip","Stemme","Vibration",TR2_2("B & V","Bips & Vibration"),TR2_2("St & Vib","Stemme & Vibration")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tone","Stille"
|
||||
#define TR_CURVE_TYPES "Standard","Tilpasset"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#define TR_MULTI_CUSTOM "Benutzer"
|
||||
#define TR_VTRIMINC TR("Expo","Exponentiell"),TR("ExFein","Extrafein"),"Fein","Mittel","Grob"
|
||||
#define TR_VDISPLAYTRIMS "Nein","Kurz","Ja" // Trimmwerte Keine, kurze Anzeigen, Ja
|
||||
#define TR_VBEEPCOUNTDOWN "Kein","Pieps","Stimme","Haptik"
|
||||
#define TR_VBEEPCOUNTDOWN "Kein", "Pieps", "Stimme", "Haptik", TR2_2("P & H","Pieps & Haptik"), TR2_2("St & H","Stimme & Haptik")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Ton","Ruhe"
|
||||
#define TR_CURVE_TYPES "Nur Y","X und Y" // "Standard","Custom"
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
#define TR_VTRIMINC TR("Expo","Exponential"),TR("ExFine","Extra Fine"),"Fine","Medium","Coarse"
|
||||
#define TR_VDISPLAYTRIMS "No","Change","Yes"
|
||||
#define TR_VBEEPCOUNTDOWN "Silent","Beeps","Voice","Haptic"
|
||||
#define TR_VBEEPCOUNTDOWN "Silent","Beeps","Voice","Haptic",TR2_2("B & H","Beeps & Haptic"),TR2_2("V & H","Voice & Haptic")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tone","Silent"
|
||||
#define TR_CURVE_TYPES "Standard","Custom"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
#define TR_VTRIMINC TR("Expo","Exponencial"),TR("ExFino","Extra fino")"Fino","Medio","Grueso"
|
||||
#define TR_VDISPLAYTRIMS "No","Cambiar","Si"
|
||||
#define TR_VBEEPCOUNTDOWN "Silencio","Beeps","Voz","Haptic"
|
||||
#define TR_VBEEPCOUNTDOWN "Silencio", "Beeps", "Voz", "Haptic", TR2_2("B & H","Beeps & Haptic"),TR2_2("V & H", "Voz & Haptic")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tono","Silencio"
|
||||
#define TR_CURVE_TYPES "Normal","Custom"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
#define TR_VTRIMINC TR("Expo","Exponential"),TR("EriHie","Eri Hieno"),"Hieno","Keski","Karkea"
|
||||
#define TR_VDISPLAYTRIMS "No","Change","Yes"
|
||||
#define TR_VBEEPCOUNTDOWN "Silent","Beeps","Voice","Haptic"
|
||||
#define TR_VBEEPCOUNTDOWN "Silent","Beeps","Voice","Haptic",TR2_2("B & H","Beeps & Haptic"),TR2_2("V & H","Voice & Haptic")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tone","Silent"
|
||||
#define TR_CURVE_TYPES "Standard","Custom"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#define TR_MULTI_CUSTOM "Perso"
|
||||
#define TR_VTRIMINC TR("Expo","Exponentiel"),TR("ExFin","Extra Fin"),"Fin","Moyen",TR("Gros","Grossier")
|
||||
#define TR_VDISPLAYTRIMS "Non","Change","Oui"
|
||||
#define TR_VBEEPCOUNTDOWN "Aucun","Bips","Voix","Haptic"
|
||||
#define TR_VBEEPCOUNTDOWN "Aucun","Bips","Voix","Haptic",TR2_2("B & H","Bips & Haptic"),TR2_2("V & H","Voix & Haptic")
|
||||
#define TR_VVARIOCENTER "Tone","Silent"
|
||||
#define TR_CURVE_TYPES "Standard","Libre"
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
#define TR_MULTI_CUSTOM "Person."
|
||||
#define TR_VTRIMINC "Exp","ExFine","Fine","Medio","Ampio "
|
||||
#define TR_VDISPLAYTRIMS "No","Cambio","Si"
|
||||
#define TR_VBEEPCOUNTDOWN "Niente","Suoni","Voce","Vibra"
|
||||
#define TR_VBEEPCOUNTDOWN "Niente", "Suoni", "Voce", "Vibra", TR2_2("S & V","Suoni & Vibra"),TR2_2("V & V","Voce & Vibra")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tono","Silenz."
|
||||
#define TR_CURVE_TYPES "Fisso","Modific."
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#define TR_MULTI_CUSTOM "カスタム"
|
||||
#define TR_VTRIMINC "ステップExpo","ステップ極小","ステップ小","ステップ中","ステップ大"
|
||||
#define TR_VDISPLAYTRIMS "非表示","変更時","常時表示"
|
||||
#define TR_VBEEPCOUNTDOWN "消音","ビープ","音声","バイブレート"
|
||||
#define TR_VBEEPCOUNTDOWN "消音","ビープ","音声","バイブレート",TR2_2("B & H","Beeps & Haptic"),TR("V & H","Voice & Haptic")
|
||||
#define TR_COUNTDOWNVALUES "5秒","10秒","20秒","30秒"
|
||||
#define TR_VVARIOCENTER "トーン","消音"
|
||||
#define TR_CURVE_TYPES "スタンダード","カスタム"
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
#define TR_VTRIMINC TR("Expo","Exponentieel"),TR("ExFijn","Extra Fijn"),"Fijn","Medium","Grof"
|
||||
#define TR_VDISPLAYTRIMS "Nee","Kort","Ja"
|
||||
#define TR_VBEEPCOUNTDOWN "Stilte","Beeps","Spraak","Tril"
|
||||
#define TR_VBEEPCOUNTDOWN "Stilte","Beeps","Spraak","Tril",TR2_2("B & T","Beeps & Tril"),TR2_2("Spr & Tr","Spraak & Tril")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tonen","Stilte"
|
||||
#define TR_CURVE_TYPES "Standaard","Custom"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
#define TR_VTRIMINC TR("Expo","Expotencja"),TR("B.Dokł","B.Dokładny"),TR("Dokł.","Dokładny"),"Średni",TR("Zgrubn","Zgrubny")
|
||||
#define TR_VDISPLAYTRIMS "Nie","Zmień","Tak"
|
||||
#define TR_VBEEPCOUNTDOWN "Cichy","Pik","Dźwięk","Wibrac"
|
||||
#define TR_VBEEPCOUNTDOWN "Cichy","Pik","Dźwięk","Wibrac",TR2_2("P & W","Pik & Wibrac"),TR2_2("Dzw & Wbr","Dźwięk & Wibrac")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Ton","Cicho"
|
||||
#define TR_CURVE_TYPES "Standard","Własny"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
#define TR_MULTI_CUSTOM "Custom"
|
||||
#define TR_VTRIMINC "Expo","ExFino","Fino","Medio","Largo"
|
||||
#define TR_VDISPLAYTRIMS "No","Change","Yes"
|
||||
#define TR_VBEEPCOUNTDOWN "Silent","Beeps","Voice","Haptic"
|
||||
#define TR_VBEEPCOUNTDOWN "Silent","Beeps","Voice","Haptic",TR2_2("B & H","Beeps & Haptic"),TR2_2("V & H","Voice & Haptic")
|
||||
#define TR_COUNTDOWNVALUES "5s","10s","20s","30s"
|
||||
#define TR_VVARIOCENTER "Tone","Silent"
|
||||
#define TR_CURVE_TYPES "Standard","Custom"
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
#define TR_MULTI_CUSTOM "Anpassad"
|
||||
#define TR_VTRIMINC TR("Expo","Exponentiell"),TR("xFin","Extra fin"),"Fin","Medium","Grov"
|
||||
#define TR_VDISPLAYTRIMS "Nej","Ändring","Ja"
|
||||
#define TR_VBEEPCOUNTDOWN "Tyst","Pip","Röst","Vibrera"
|
||||
#define TR_VBEEPCOUNTDOWN "Tyst", "Pip", "Röst", "Vibrera", TR2_2("P & Vib","Pips & Vibrera"),TR2_2("R & Vib","Röst & Vibrera")
|
||||
#define TR_VVARIOCENTER "Pip","Tyst"
|
||||
#define TR_CURVE_TYPES "Normal","Anpassad"
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#define TR_MULTI_CUSTOM "自定義"
|
||||
#define TR_VTRIMINC "指數","很小","較小","中等","較大"
|
||||
#define TR_VDISPLAYTRIMS "不顯示","改變時","始終顯示"
|
||||
#define TR_VBEEPCOUNTDOWN "靜音","蜂鳴","語音","震動"
|
||||
#define TR_VBEEPCOUNTDOWN "靜音","蜂鳴","語音","震動","Beeps & Haptic","Voice & Haptic"
|
||||
#define TR_COUNTDOWNVALUES "5秒","10秒","20秒","30秒"
|
||||
#define TR_VVARIOCENTER "音調","靜音"
|
||||
#define TR_CURVE_TYPES "標準","自定義"
|
||||
|
||||
Reference in New Issue
Block a user