core/haptic_choreographer
library
Classes
-
HapticChoreographer
-
Schedules and plays back a HapticPattern pulse by pulse, through
fireHaptic (so every existing
hapticsEnabled/hapticSoftMode
contract already applies to every pulse, for free — this never calls
HapticFeedback.* directly).
-
HapticPattern
-
A small, caller-declarable haptic sequence — "1 buzz then a pause then
2 buzzes" instead of a consumer wiring up individual fireHaptic calls
by hand for every combo/reward/error moment.
-
HapticPulse
-
One step of a HapticPattern: fire level, then wait delayAfter
before the next pulse (ignored on the pattern's last pulse).
Functions
-
comboSyncHapticPattern({required int steps, required Duration stepInterval, HapticLevel levelForStep(int step)?})
→ HapticPattern
-
Builds a HapticPattern synced to a combo/SFX sequence whose timing is
already known ahead of time (IDEA-67) — e.g. a pitch-escalating combo
SFX that steps every
stepInterval. No real-time audio analysis: this
is a pure data-driven mapping from "N steps, M ms apart" straight onto
HapticPattern's own pulse/delay shape, played via
HapticChoreographer.play exactly like any other pattern — the caller
is responsible for actually starting the SFX at the same moment.