mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-07-07 09:51:34 +00:00
feat: update shake detection settings to reduce cooldown and feedback options
This commit is contained in:
parent
6c0265fe5f
commit
4aa2014d3b
3 changed files with 6 additions and 7 deletions
|
|
@ -197,12 +197,12 @@ class ShakeDetectionSettings with _$ShakeDetectionSettings {
|
||||||
@Default(ShakeDirection.horizontal) ShakeDirection direction,
|
@Default(ShakeDirection.horizontal) ShakeDirection direction,
|
||||||
@Default(5) double threshold,
|
@Default(5) double threshold,
|
||||||
@Default(ShakeAction.resetSleepTimer) ShakeAction shakeAction,
|
@Default(ShakeAction.resetSleepTimer) ShakeAction shakeAction,
|
||||||
@Default({ShakeDetectedFeedback.vibrate, ShakeDetectedFeedback.beep})
|
@Default({ShakeDetectedFeedback.vibrate})
|
||||||
Set<ShakeDetectedFeedback> feedback,
|
Set<ShakeDetectedFeedback> feedback,
|
||||||
@Default(0.5) double beepVolume,
|
@Default(0.5) double beepVolume,
|
||||||
|
|
||||||
/// the duration to wait before the shake detection is enabled again
|
/// the duration to wait before the shake detection is enabled again
|
||||||
@Default(Duration(seconds: 5)) Duration shakeTriggerCoolDown,
|
@Default(Duration(seconds: 2)) Duration shakeTriggerCoolDown,
|
||||||
|
|
||||||
/// the number of shakes required to trigger the action
|
/// the number of shakes required to trigger the action
|
||||||
@Default(2) int shakeTriggerCount,
|
@Default(2) int shakeTriggerCount,
|
||||||
|
|
|
||||||
|
|
@ -2633,11 +2633,10 @@ class _$ShakeDetectionSettingsImpl implements _ShakeDetectionSettings {
|
||||||
this.threshold = 5,
|
this.threshold = 5,
|
||||||
this.shakeAction = ShakeAction.resetSleepTimer,
|
this.shakeAction = ShakeAction.resetSleepTimer,
|
||||||
final Set<ShakeDetectedFeedback> feedback = const {
|
final Set<ShakeDetectedFeedback> feedback = const {
|
||||||
ShakeDetectedFeedback.vibrate,
|
ShakeDetectedFeedback.vibrate
|
||||||
ShakeDetectedFeedback.beep
|
|
||||||
},
|
},
|
||||||
this.beepVolume = 0.5,
|
this.beepVolume = 0.5,
|
||||||
this.shakeTriggerCoolDown = const Duration(seconds: 5),
|
this.shakeTriggerCoolDown = const Duration(seconds: 2),
|
||||||
this.shakeTriggerCount = 2,
|
this.shakeTriggerCount = 2,
|
||||||
this.samplingPeriod = const Duration(milliseconds: 100)})
|
this.samplingPeriod = const Duration(milliseconds: 100)})
|
||||||
: _feedback = feedback;
|
: _feedback = feedback;
|
||||||
|
|
|
||||||
|
|
@ -294,10 +294,10 @@ _$ShakeDetectionSettingsImpl _$$ShakeDetectionSettingsImplFromJson(
|
||||||
feedback: (json['feedback'] as List<dynamic>?)
|
feedback: (json['feedback'] as List<dynamic>?)
|
||||||
?.map((e) => $enumDecode(_$ShakeDetectedFeedbackEnumMap, e))
|
?.map((e) => $enumDecode(_$ShakeDetectedFeedbackEnumMap, e))
|
||||||
.toSet() ??
|
.toSet() ??
|
||||||
const {ShakeDetectedFeedback.vibrate, ShakeDetectedFeedback.beep},
|
const {ShakeDetectedFeedback.vibrate},
|
||||||
beepVolume: (json['beepVolume'] as num?)?.toDouble() ?? 0.5,
|
beepVolume: (json['beepVolume'] as num?)?.toDouble() ?? 0.5,
|
||||||
shakeTriggerCoolDown: json['shakeTriggerCoolDown'] == null
|
shakeTriggerCoolDown: json['shakeTriggerCoolDown'] == null
|
||||||
? const Duration(seconds: 5)
|
? const Duration(seconds: 2)
|
||||||
: Duration(
|
: Duration(
|
||||||
microseconds: (json['shakeTriggerCoolDown'] as num).toInt()),
|
microseconds: (json['shakeTriggerCoolDown'] as num).toInt()),
|
||||||
shakeTriggerCount: (json['shakeTriggerCount'] as num?)?.toInt() ?? 2,
|
shakeTriggerCount: (json['shakeTriggerCount'] as num?)?.toInt() ?? 2,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue