Skip to content

EN Audio Haptics Input

Cavanshirpro edited this page Sep 20, 2026 · 2 revisions

Audio, Haptics and Input — LeoMiniGames v0.7.0

These services are gameplay feedback/input facilities, not reasons for a game to crash when a platform backend is missing.

Audio

Qt Multimedia is optional at configure time in the root CMake build. When Qt6::Multimedia is present, the host links it and exposes audio capability. When absent, the build uses a silent fallback instead of making the whole application unbuildable.

Modern external packages use GameAudio; legacy packages can use the scoped Audio compatibility facade. GameAudio covers effects, preload, music, pause/resume and volume groups such as SFX/Music/UI/Ambient. External packages should use package-scoped/named resources; arbitrary host filesystem/network audio is not an external API privilege.

Audio objects are intended to be lazy/bounded. A failed decoder/backend, missing optional sound, muted group or unsupported platform must degrade to silent gameplay, not a fatal QML/runtime state.

Haptics

Haptics.light(), medium(), heavy() and pulse(level) are optional feedback. Unsupported hardware/platform behavior is a safe no-op. Do not make game progression depend on vibration availability.

Input

GameInput is action-based: games should respond to actions rather than scattering platform/layout-specific key assumptions throughout QML. Standard actions include directional movement, jump, fire and pause. Arrow keys remain logical fallbacks and physical WASD handling is centralized for keyboard-layout robustness.

Desktop QA should cover mouse and keyboard. Mobile QA should cover the genre-appropriate tap, long-press, swipe, drag, virtual action pad or joystick path. Input during transitions/animations must not leave state half-applied.

Viewport and touch

Use Viewport safe geometry/density/orientation information instead of assuming fixed dimensions at Component.onCompleted. Touch targets, safe areas, text growth and high DPI are part of input usability.

Lifecycle integration

On application background/inactive/suspended states the host pauses lifecycle/audio and forces save safety paths; foreground resumes them. A game must tolerate pause/resume without duplicate timers, audio storms or stale input state.

Cross-platform QA matrix

  • Windows/Linux/macOS: keyboard focus, mouse hover/press, audio backend/device changes.
  • Android/iOS/iPadOS: touch size, gestures, safe area, lifecycle/background, haptics capability.
  • All: muted audio, missing optional resource, rapid open/close, repeated pause/resume, language/theme change during gameplay.

See the pinned docs/PLUGIN_API.md for the current callable surface; note that its title still says 0.6 even though the service set is used by the v0.7 runtime. The wiki records the current source behavior rather than treating that historical heading as a new API version boundary.

Clone this wiki locally